]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.parser/prettyprint: moving the predicates
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 10 Aug 2016 11:45:38 +0000 (13:45 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Wed, 10 Aug 2016 19:34:38 +0000 (21:34 +0200)
basis/alien/parser/parser.factor
basis/alien/prettyprint/prettyprint-docs.factor [new file with mode: 0644]
basis/alien/prettyprint/prettyprint.factor

index 0a813df47dd81c37f0743887ee149dd802da6698..447b082488b2babc067e79143b8c70b1e800f8bf 100755 (executable)
@@ -151,18 +151,6 @@ PRIVATE>
 : (CALLBACK:) ( -- word quot effect )
     (FUNCTION:) make-callback-type ;
 
-PREDICATE: alien-function-alias-word < word
-    def>> {
-        [ length 6 = ]
-        [ 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 >boolean ;
-
 : global-quot ( type word -- quot )
     swap [ name>> current-library get ] dip
     '[ _ _ address-of 0 _ alien-value ] ;
diff --git a/basis/alien/prettyprint/prettyprint-docs.factor b/basis/alien/prettyprint/prettyprint-docs.factor
new file mode 100644 (file)
index 0000000..fa3a204
--- /dev/null
@@ -0,0 +1,5 @@
+USING: help.markup help.syntax ;
+IN: alien.prettyprint
+
+HELP: alien-function-alias-word
+{ $class-description "Used to prettier pretty-printing of alien function words." } ;
index 843686a52453cd9b1949958b9370a76ad838580c..48d9fcb2e0d78c68f1d331d47c70ddf93fa915ee 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2008, 2010 Slava Pestov, Joe Groff.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel combinators alien alien.enums
-alien.strings alien.c-types alien.parser alien.syntax arrays
-assocs effects math.parser prettyprint prettyprint.backend
-prettyprint.custom prettyprint.sections definitions see
-see.private sequences strings words ;
+USING: accessors alien alien.c-types alien.enums alien.strings
+alien.syntax arrays assocs combinators combinators.short-circuit
+definitions effects kernel math.parser prettyprint prettyprint.backend
+prettyprint.custom prettyprint.sections see see.private sequences
+words ;
 IN: alien.prettyprint
 
 M: alien pprint*
@@ -77,6 +77,12 @@ M: typedef-word synopsis*
         ")" text block>
     ] tri ; inline
 
+PREDICATE: alien-function-alias-word < word
+    def>> {
+        [ length 6 = ]
+        [ last \ alien-invoke eq? ]
+    } 1&& ;
+
 M: alien-function-alias-word definer
     drop \ FUNCTION-ALIAS: f ;
 M: alien-function-alias-word definition drop f ;
@@ -90,6 +96,9 @@ M: alien-function-alias-word synopsis*
     } cleave ;
 M: alien-function-alias-word declarations. drop ;
 
+PREDICATE: alien-function-word < alien-function-alias-word
+    [ def>> third ] [ name>> ] bi = ;
+
 M: alien-function-word definer
     drop \ FUNCTION: f ;
 M: alien-function-word synopsis*
@@ -100,6 +109,9 @@ M: alien-function-word synopsis*
         [ [ pprint-word ] pprint-function ]
     } cleave ;
 
+PREDICATE: alien-callback-type-word < typedef-word
+    "callback-effect" word-prop >boolean ;
+
 M: alien-callback-type-word definer
     drop \ CALLBACK: f ;
 M: alien-callback-type-word definition drop f ;