alien.parser: favor parsing "foo*" as pointer-to-foo now

db4
Joe Groff 2010-02-21 21:06:00 -08:00
parent d5bf6e55cd
commit 5faa97e42c
2 changed files with 4 additions and 2 deletions

View File

@ -304,7 +304,9 @@ CONSTANT: primitive-types
: resolve-pointer-typedef ( type -- base-type )
dup "c-type" word-prop dup word?
[ nip resolve-pointer-typedef ] [ drop ] if ;
[ nip resolve-pointer-typedef ] [
pointer? [ drop void* ] when
] if ;
: special-pointer-type ( type -- special-type )
dup c-type-word? [

View File

@ -18,8 +18,8 @@ IN: alien.parser
{
{ [ dup "void" = ] [ drop void ] }
{ [ CHAR: ] over member? ] [ parse-array-type parse-c-type-name prefix ] }
{ [ dup search ] [ parse-c-type-name ] }
{ [ "*" ?tail ] [ (parse-c-type) <pointer> ] }
{ [ dup search ] [ parse-c-type-name ] }
[ dup search [ ] [ no-word ] ?if ]
} cond ;