]> gitweb.factorcode.org Git - factor.git/commitdiff
change parse-c-type so that c-type[symbolic-constant] parses to { c-type symbolic...
authorJoe Groff <arcata@gmail.com>
Fri, 16 Oct 2009 17:27:16 +0000 (12:27 -0500)
committerJoe Groff <arcata@gmail.com>
Fri, 16 Oct 2009 17:27:16 +0000 (12:27 -0500)
basis/alien/c-types/c-types.factor
basis/alien/parser/parser-tests.factor

index dec7f92501459779cfaacc8ca716ceca59c4b907..8196f46263b45af6406b6114b3df5e46e7267414 100755 (executable)
@@ -83,7 +83,7 @@ M: string resolve-pointer-type
 
 : parse-array-type ( name -- dims c-type )
     "[" split unclip
-    [ [ "]" ?tail drop string>number ] map ] dip ;
+    [ [ "]" ?tail drop parse-word ] map ] dip ;
 
 M: string c-type ( name -- c-type )
     CHAR: ] over member? [
index 061deb84c5c5bc6115c71353f3db5dd164ce8a82..e405f499959d5ba19a228d7d2bb6bc6daca1920a 100644 (file)
@@ -8,6 +8,8 @@ TYPEDEF: char char2
 
 SYMBOL: not-c-type
 
+CONSTANT: eleven 11
+
 [
     "alien.parser.tests" use-vocab
     "alien.c-types" use-vocab
@@ -15,6 +17,7 @@ SYMBOL: not-c-type
     [ int ] [ "int" parse-c-type ] unit-test
     [ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
     [ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
+    [ { int 5 10 eleven } ] [ "int[5][10][eleven]" parse-c-type ] unit-test
     [ void* ] [ "int*" parse-c-type ] unit-test
     [ void* ] [ "int**" parse-c-type ] unit-test
     [ void* ] [ "int***" parse-c-type ] unit-test
@@ -40,4 +43,4 @@ TYPEDEF: int alien-parser-test-int ! reasonably unique name...
         ! after restart, we end up here
         "OK!"
     ] [ :1 ] recover
-] unit-test
\ No newline at end of file
+] unit-test