Moved two words from alien.inline to alien.inline.types
parent
9cf0c5e33b
commit
ae4b284006
|
@ -14,23 +14,10 @@ SYMBOL: library-is-c++
|
|||
SYMBOL: compiler-args
|
||||
SYMBOL: c-strings
|
||||
|
||||
: annotate-effect ( types effect -- types effect' )
|
||||
[ in>> ] [ out>> ] bi [
|
||||
zip
|
||||
[ over pointer-to-primitive? [ ">" prepend ] when ]
|
||||
assoc-map unzip
|
||||
] dip <effect> ;
|
||||
|
||||
|
||||
: function-types-effect ( -- function types effect )
|
||||
scan scan swap ")" parse-tokens
|
||||
[ "(" subseq? not ] filter swap parse-arglist ;
|
||||
|
||||
: types-effect>params-return ( types effect -- params return )
|
||||
[ in>> zip ]
|
||||
[ nip out>> dup length 0 > [ first ] [ drop "void" ] if ]
|
||||
2bi ;
|
||||
|
||||
: arg-list ( types -- params )
|
||||
CHAR: a swap length CHAR: a + [a,b]
|
||||
[ 1string ] map ;
|
||||
|
|
|
@ -32,3 +32,15 @@ MEMO: resolved-primitives ( -- seq )
|
|||
|
||||
: pointer-to-primitive? ( type -- ? )
|
||||
{ [ pointer? ] [ type-sans-pointer primitive-type? ] } 1&& ;
|
||||
|
||||
: types-effect>params-return ( types effect -- params return )
|
||||
[ in>> zip ]
|
||||
[ nip out>> dup length 0 > [ first ] [ drop "void" ] if ]
|
||||
2bi ;
|
||||
|
||||
: annotate-effect ( types effect -- types effect' )
|
||||
[ in>> ] [ out>> ] bi [
|
||||
zip
|
||||
[ over pointer-to-primitive? [ ">" prepend ] when ]
|
||||
assoc-map unzip
|
||||
] dip <effect> ;
|
||||
|
|
Loading…
Reference in New Issue