alien.parser: properly generate return type name for FUNCTION: stack effects

db4
Joe Groff 2010-02-22 11:25:01 -08:00
parent 31a0d98e02
commit 4d2ded634b
1 changed files with 9 additions and 1 deletions

View File

@ -62,12 +62,20 @@ IN: alien.parser
] bi
[ parse-c-type ] dip ;
<PRIVATE
GENERIC: return-type-name ( type -- name )
M: object return-type-name drop "void" ;
M: word return-type-name name>> ;
M: pointer return-type-name to>> return-type-name CHAR: * suffix ;
PRIVATE>
: parse-arglist ( parameters return -- types effect )
[
2 group [ first2 normalize-c-arg 2array ] map
unzip [ "," ?tail drop ] map
]
[ [ { } ] [ name>> 1array ] if-void ]
[ [ { } ] [ return-type-name 1array ] if-void ]
bi* <effect> ;
: function-quot ( return library function types -- quot )