]> gitweb.factorcode.org Git - factor.git/commitdiff
GUID: literals for COM
authorU-VICTORIA\Administrator <Administrator@victoria.(none)>
Sat, 12 Jul 2008 04:18:32 +0000 (21:18 -0700)
committerU-VICTORIA\Administrator <Administrator@victoria.(none)>
Sat, 12 Jul 2008 04:18:32 +0000 (21:18 -0700)
extra/windows/com/com-tests.factor
extra/windows/com/syntax/syntax-docs.factor [changed mode: 0644->0755]
extra/windows/com/syntax/syntax.factor

index 394bec2dfba3af9d4b873b8f09ddb9cb4e70de2a..cd67fd19d29b356c2e51b09f27469e90ba4982ef 100755 (executable)
@@ -16,10 +16,10 @@ COM-INTERFACE: IUnrelated IUnknown {b06ac3f4-30e4-406b-a7cd-c29cead4552c}
     int xPlus ( int y )
     int xMulAdd ( int mul, int add ) ;
 
-"{216fb341-0eb2-44b1-8edb-60b76e353abc}" string>guid 1array [ ISimple-iid ] unit-test
-"{9620ecec-8438-423b-bb14-86f835aa40dd}" string>guid 1array [ IInherited-iid ] unit-test
-"{00000000-0000-0000-C000-000000000046}" string>guid 1array [ IUnknown-iid ] unit-test
-"{b06ac3f4-30e4-406b-a7cd-c29cead4552c}" string>guid 1array [ IUnrelated-iid ] unit-test
+{ GUID: {216fb341-0eb2-44b1-8edb-60b76e353abc} } [ ISimple-iid ] unit-test
+{ GUID: {9620ecec-8438-423b-bb14-86f835aa40dd} } [ IInherited-iid ] unit-test
+{ GUID: {00000000-0000-0000-C000-000000000046} } [ IUnknown-iid ] unit-test
+{ GUID: {b06ac3f4-30e4-406b-a7cd-c29cead4552c} } [ IUnrelated-iid ] unit-test
 
 { (( -- iid )) } [ \ ISimple-iid stack-effect ] unit-test
 { (( this -- HRESULT )) } [ \ ISimple::returnOK stack-effect ] unit-test
old mode 100644 (file)
new mode 100755 (executable)
index fa06d5e..62a3c6e
@@ -1,26 +1,30 @@
-USING: help.markup help.syntax io kernel math quotations\r
-multiline ;\r
-IN: windows.com.syntax\r
-\r
-HELP: COM-INTERFACE:\r
-{ $syntax <"\r
-COM-INTERFACE: <interface> <parent> <iid>\r
-    <function-1> ( <params1> )\r
-    <function-2> ( <params2> )\r
-    ... ;\r
-"> }\r
-{ $description "\nFor the interface " { $snippet "<interface>" } ", a word " { $snippet "<interface>-iid ( -- iid )" } " is defined to push the interface GUID (IID) onto the stack. Words of the form " { $snippet "<interface>::<function>" } " are also defined to invoke each method, as well as the methods inherited from " { $snippet "<parent>" } ". A " { $snippet "<parent>" } " of " { $snippet "f" } " indicates that the interface is a root interface. (Note that COM conventions demand that all interfaces at least inherit from " { $snippet "IUnknown" } ".)\n\nExample:" }\r
-{ $code <"\r
-COM-INTERFACE: IUnknown f {00000000-0000-0000-C000-000000000046}\r
-    HRESULT QueryInterface ( REFGUID iid, void** ppvObject )\r
-    ULONG AddRef ( )\r
-    ULONG Release ( ) ;\r
-\r
-COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc}\r
-    HRESULT returnOK ( )\r
-    HRESULT returnError ( ) ;\r
-\r
-COM-INTERFACE: IInherited ISimple {9620ecec-8438-423b-bb14-86f835aa40dd}\r
-    int getX ( )\r
-    void setX ( int newX ) ;\r
-"> } ;\r
+USING: help.markup help.syntax io kernel math quotations
+multiline ;
+IN: windows.com.syntax
+
+HELP: GUID:
+{ $syntax "GUID: {01234567-89ab-cdef-0123-456789abcdef}" }
+{ $description "\nCreate a COM globally-unique identifier (GUID) literal at parse time, and push it onto the data stack." } ;
+
+HELP: COM-INTERFACE:
+{ $syntax <"
+COM-INTERFACE: <interface> <parent> <iid>
+    <function-1> ( <params1> )
+    <function-2> ( <params2> )
+    ... ;
+"> }
+{ $description "\nFor the interface " { $snippet "<interface>" } ", a word " { $snippet "<interface>-iid ( -- iid )" } " is defined to push the interface GUID (IID) onto the stack. Words of the form " { $snippet "<interface>::<function>" } " are also defined to invoke each method, as well as the methods inherited from " { $snippet "<parent>" } ". A " { $snippet "<parent>" } " of " { $snippet "f" } " indicates that the interface is a root interface. (Note that COM conventions demand that all interfaces at least inherit from " { $snippet "IUnknown" } ".)\n\nExample:" }
+{ $code <"
+COM-INTERFACE: IUnknown f {00000000-0000-0000-C000-000000000046}
+    HRESULT QueryInterface ( REFGUID iid, void** ppvObject )
+    ULONG AddRef ( )
+    ULONG Release ( ) ;
+
+COM-INTERFACE: ISimple IUnknown {216fb341-0eb2-44b1-8edb-60b76e353abc}
+    HRESULT returnOK ( )
+    HRESULT returnError ( ) ;
+
+COM-INTERFACE: IInherited ISimple {9620ecec-8438-423b-bb14-86f835aa40dd}
+    int getX ( )
+    void setX ( int newX ) ;
+"> } ;
index dd7d058a77a8f7c6db1e122ad66d988889c0210d..b6070273325425ba1e2b05a0cf8836f128c17be4 100755 (executable)
@@ -100,3 +100,4 @@ PRIVATE>
     define-words-for-com-interface
     ; parsing
 
+: GUID: scan string>guid parsed ; parsing