prettyprint FUNCTION-ALIAS: definitions
parent
efbc3033da
commit
d20bff5615
|
@ -142,12 +142,15 @@ PRIVATE>
|
|||
current-library get
|
||||
scan-function-name ";" scan-c-args make-callback-type ;
|
||||
|
||||
PREDICATE: alien-function-word < word
|
||||
PREDICATE: alien-function-alias-word < word
|
||||
def>> {
|
||||
[ length 5 = ]
|
||||
[ last \ alien-invoke eq? ]
|
||||
} 1&& ;
|
||||
|
||||
PREDICATE: alien-function-word < alien-function-alias-word
|
||||
[ def>> third ] [ name>> ] bi = ;
|
||||
|
||||
PREDICATE: alien-callback-type-word < typedef-word
|
||||
"callback-effect" word-prop ;
|
||||
|
||||
|
|
|
@ -61,22 +61,36 @@ M: typedef-word synopsis*
|
|||
: pprint-library ( library -- )
|
||||
[ \ LIBRARY: [ text ] pprint-prefix ] when* ;
|
||||
|
||||
: pprint-function ( word quot -- )
|
||||
[ def>> first pprint-c-type ]
|
||||
swap
|
||||
[
|
||||
<block "(" text
|
||||
[ def>> fourth ] [ stack-effect in>> ] bi
|
||||
pprint-function-args
|
||||
")" text block>
|
||||
] tri ; inline
|
||||
|
||||
M: alien-function-alias-word definer
|
||||
drop \ FUNCTION-ALIAS: \ ; ;
|
||||
M: alien-function-alias-word definition drop f ;
|
||||
M: alien-function-alias-word synopsis*
|
||||
{
|
||||
[ seeing-word ]
|
||||
[ def>> second pprint-library ]
|
||||
[ definer. ]
|
||||
[ pprint-word ]
|
||||
[ [ def>> third text ] pprint-function ]
|
||||
} cleave ;
|
||||
|
||||
M: alien-function-word definer
|
||||
drop \ FUNCTION: \ ; ;
|
||||
M: alien-function-word definition drop f ;
|
||||
M: alien-function-word synopsis*
|
||||
{
|
||||
[ seeing-word ]
|
||||
[ def>> second pprint-library ]
|
||||
[ definer. ]
|
||||
[ def>> first pprint-c-type ]
|
||||
[ pprint-word ]
|
||||
[
|
||||
<block "(" text
|
||||
[ def>> fourth ] [ stack-effect in>> ] bi
|
||||
pprint-function-args
|
||||
")" text block>
|
||||
]
|
||||
[ [ pprint-word ] pprint-function ]
|
||||
} cleave ;
|
||||
|
||||
M: alien-callback-type-word definer
|
||||
|
|
Loading…
Reference in New Issue