: 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? [
SYMBOL: not-c-type
+CONSTANT: eleven 11
+
[
"alien.parser.tests" use-vocab
"alien.c-types" use-vocab
[ 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
! after restart, we end up here
"OK!"
] [ :1 ] recover
-] unit-test
\ No newline at end of file
+] unit-test