]> gitweb.factorcode.org Git - factor.git/commitdiff
catb0t's PR: add a Prolog-like %! ... multiline comment #6
authorkusumotonorio <47816570+kusumotonorio@users.noreply.github.com>
Mon, 2 Mar 2020 11:21:17 +0000 (20:21 +0900)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 3 Mar 2020 15:59:07 +0000 (15:59 +0000)
extra/factlog/factlog-docs.factor
extra/factlog/factlog.factor

index e5fa3e053cf3bcd723b9e05f4f503c1a4d6629de..8f6fc4a39079066dd5815800e8fc0dfc8951e3d3 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2019-2020 KUSUMOTO Norio.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays help.markup help.syntax kernel quotations sequences
-    prettyprint assocs math lists urls factlog.private ;
+    prettyprint assocs math make lists urls factlog.private ;
 IN: factlog
 
 HELP: !!
@@ -140,6 +140,18 @@ HELP: LOGIC-VARS:
   }
 } ;
 
+HELP: %!
+{ $description "A multiline comment. Despite being a Prolog single-line comment, " { $link % } " is already well-known in Factor, so this variant is given instead." }
+{ $syntax "%! comment !%" }
+{ $examples
+    { $example
+        "USE: factlog"
+        "%! I think that I shall never see"
+        "   A proof lovely as a factlog. !%"
+        ""
+    }
+} ;
+
 HELP: \+
 { $var-description "Express negation. \\+ acts on the goal immediately following it.\n" }
 { $examples
@@ -722,7 +734,7 @@ SYMBOLS: Tom Jerry Nibbles ;"
     { cato Y } ;; { mouseo Y }
 } rule"
 } $nl
-{ $link ;; } " is used to represent " { $strong "disjunction" } ". The code below it has the same meaning as the code below it." $nl
+{ $link ;; } " is used to represent " { $strong "disjunction" } ". The following two forms are equivalent:" $nl
 { $code "Gh { Gb1 Gb2 Gb3 ;; Gb4 Gb5 ;; Gb6 } rule" }
 $nl
 { $code
index 89c3d792b3ca09d440741e65dd9db876a26605cf..07c2e555ad7d3972c33111559f98397761a251a4 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs classes classes.tuple combinators
 combinators.short-circuit compiler.units continuations
-formatting fry io kernel lexer lists locals make math namespaces
-parser prettyprint prettyprint.backend prettyprint.config
+formatting fry io kernel lexer lists locals make math multiline
+namespaces parser prettyprint prettyprint.backend prettyprint.config
 prettyprint.custom prettyprint.sections quotations sequences
 sequences.deep sets splitting strings words words.symbol
 vectors ;
@@ -59,6 +59,9 @@ SYNTAX: LOGIC-PREDS: ";"
     ] each-token ;
 >>
 
+SYNTAX: %!
+  "!%" parse-multiline-string drop ;
+
 <PRIVATE
 
 TUPLE: logic-goal pred args ;
@@ -573,4 +576,3 @@ LOGIC-PREDS:
 
 { listo L{ } } fact
 { listo L{ __ . __ } } fact
-