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