]> gitweb.factorcode.org Git - factor.git/blob - extra/cuda/prettyprint/prettyprint.factor
factor: remove some extra whitespace.
[factor.git] / extra / cuda / prettyprint / prettyprint.factor
1 USING: accessors alien.prettyprint combinators
2 combinators.short-circuit cuda.libraries cuda.syntax definitions
3 effects kernel prettyprint.backend prettyprint.sections see
4 see.private sequences words ;
5 IN: cuda.prettyprint
6
7 PREDICATE: cuda-function-word < word
8     def>> { [ length 14 = ] [ last \ cuda-invoke eq? ] } 1&& ;
9
10 : pprint-cuda-library ( library -- )
11     [ \ CUDA-LIBRARY: [ text ] pprint-prefix ] when* ;
12
13 : pprint-cuda-function ( word quot -- )
14     [
15         <block "(" text
16         [ def>> third ] [ stack-effect in>> ] bi
17         pprint-function-args
18         ")" text block>
19     ] bi ; inline
20
21 M: cuda-function-word definer drop \ CUDA-FUNCTION: \ ; ;
22 M: cuda-function-word definition drop f ;
23 M: cuda-function-word synopsis*
24    {
25        [ seeing-word ]
26        [ definer. ]
27        [ [ pprint-word ] pprint-cuda-function ]
28    } cleave ;