]> gitweb.factorcode.org Git - factor.git/commitdiff
allow word c-types and definitions to coexist
authorJoe Groff <arcata@gmail.com>
Wed, 16 Sep 2009 22:18:19 +0000 (17:18 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 16 Sep 2009 22:18:19 +0000 (17:18 -0500)
basis/alien/parser/parser.factor
basis/alien/syntax/syntax.factor

index ab09383d7c79cf19662effb3368114cf8d3a53b7..9a24f7cd4d0ac9359cc49c192196e8f13c6b9e93 100644 (file)
@@ -24,6 +24,12 @@ IN: alien.parser
     [ drop \ } parse-until >array ]
     [ parse-c-type ] if ; 
 
+: reset-c-type ( word -- )
+    { "c-type" "pointer-c-type" } reset-props ;
+
+: CREATE-C-TYPE ( -- word )
+    scan current-vocab create dup reset-c-type ;
+
 : normalize-c-arg ( type name -- type' name' )
     [ length ]
     [
index fac45176a3d0897503684be5f97fb1884673d952..0e3b569fffa753b497269ad79d5d502528746b4a 100644 (file)
@@ -19,7 +19,7 @@ SYNTAX: FUNCTION:
     (FUNCTION:) define-declared ;
 
 SYNTAX: TYPEDEF:
-    scan-c-type CREATE typedef ;
+    scan-c-type CREATE-C-TYPE typedef ;
 
 SYNTAX: C-STRUCT:
     scan current-vocab parse-definition define-struct ; deprecated