! (c)2009 Joe Groff bsd license
USING: accessors alien.c-types alien.parser alien.syntax
-tools.test vocabs.parser parser ;
+tools.test vocabs.parser parser eval vocabs.parser debugger
+continuations ;
IN: alien.parser.tests
TYPEDEF: char char2
[ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
[ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with
-] with-file-vocabs
\ No newline at end of file
+] with-file-vocabs
+
+! Reported by mnestic
+TYPEDEF: int alien-parser-test-int ! reasonably unique name...
+
+[ "OK!" ] [
+ [
+ "USE: specialized-arrays SPECIALIZED-ARRAY: alien-parser-test-int" eval( -- )
+ ! after restart, we end up here
+ "OK!"
+ ] [ :1 ] recover
+] unit-test
\ No newline at end of file
IN: alien.parser
: parse-c-type-name ( name -- word )
- dup search [ nip ] [ no-word ] if* ;
+ dup search [ ] [ no-word ] ?if ;
: parse-c-type ( string -- type )
{
{ [ dup search c-type-word? ] [ parse-c-type-name ] }
{ [ "**" ?tail ] [ drop void* ] }
{ [ "*" ?tail ] [ parse-c-type-name resolve-pointer-type ] }
- [ parse-c-type-name no-c-type ]
+ [ dup search [ no-c-type ] [ no-word ] ?if ]
} cond ;
: scan-c-type ( -- c-type )