]> gitweb.factorcode.org Git - factor.git/commitdiff
peg: remove trailing whitespace from docs.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 20 Apr 2015 03:47:05 +0000 (20:47 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 20 Apr 2015 03:47:05 +0000 (20:47 -0700)
basis/peg/peg-docs.factor

index 761c66fdee75f1b19c39f908c97e43cf4ad095e7..c90b9cc2584586c6fdb8c403e7866526d9b53282 100644 (file)
@@ -4,32 +4,32 @@ USING: help.markup help.syntax kernel quotations strings words ;
 IN: peg\r
 \r
 HELP: parse\r
-{ $values \r
+{ $values\r
   { "input" string }\r
   { "parser" parser }\r
   { "ast" object }\r
 }\r
-{ $description \r
+{ $description\r
     "Given the input string, parse it using the given parser. The result is the abstract "\r
-    "syntax tree returned by the parser." } \r
+    "syntax tree returned by the parser." }\r
 { $see-also compile } ;\r
 \r
 HELP: compile\r
-{ $values \r
+{ $values\r
   { "parser" parser }\r
   { "word" word }\r
 }\r
-{ $description \r
+{ $description\r
     "Compile the parser to a word. The word will have stack effect ( -- ast )."\r
-} \r
+}\r
 { $see-also parse } ;\r
 \r
 HELP: token\r
-{ $values \r
+{ $values\r
   { "string" string }\r
   { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that matches the given string." } ;\r
 \r
 HELP: satisfy\r
@@ -37,7 +37,7 @@ HELP: satisfy
   { "quot" quotation }\r
   { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that calls the quotation on the first character of the input string, "\r
     "succeeding if that quotation returns true. The AST is the character from the string." } ;\r
 \r
@@ -56,83 +56,83 @@ HELP: seq
   { "seq" "a sequence of parsers" }\r
   { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that calls all parsers in the given sequence, in order. The parser succeeds if "\r
     "all the parsers succeed, otherwise it fails. The AST produced is a sequence of the AST produced by "\r
     "the individual parsers." } ;\r
 \r
 HELP: choice\r
-{ $values \r
-  { "seq" "a sequence of parsers" } \r
-  { "parser" parser } \r
+{ $values\r
+  { "seq" "a sequence of parsers" }\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that will try all the parsers in the sequence, in order, until one succeeds. "\r
     "The resulting AST is that produced by the successful parser." } ;\r
 \r
 HELP: repeat0\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that parses 0 or more instances of the 'p1' parser. The AST produced is "\r
     "an array of the AST produced by the 'p1' parser. An empty array indicates 0 instances were "\r
     "parsed." } ;\r
 \r
 HELP: repeat1\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that parses 1 or more instances of the 'p1' parser. The AST produced is "\r
     "an array of the AST produced by the 'p1' parser." } ;\r
 \r
 HELP: optional\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that parses 0 or 1 instances of the 'p1' parser. The AST produced is "\r
     "'f' if 0 instances are parsed the AST produced is 'f', otherwise it is the AST produced by 'p1'." } ;\r
 \r
 HELP: semantic\r
-{ $values \r
-  { "parser" parser } \r
-  { "quot" { $quotation ( object -- ? ) } } \r
+{ $values\r
+  { "parser" parser }\r
+  { "quot" { $quotation ( object -- ? ) } }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that succeeds if the 'p1' parser succeeds and the quotation called with "\r
     "the AST produced by 'p1' on the stack returns true." }\r
-{ $examples \r
-  { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse ." "67" } \r
+{ $examples\r
+  { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse ." "67" }\r
 } ;\r
 \r
 HELP: ensure\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that succeeds if the 'p1' parser succeeds but does not add anything to the "\r
     "AST and does not move the location in the input string. This can be used for lookahead and "\r
     "disambiguation, along with the " { $link ensure-not } " word." }\r
 { $examples { $code "\"0\" token ensure octal-parser" } } ;\r
 \r
 HELP: ensure-not\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that succeeds if the 'p1' parser fails but does not add anything to the "\r
     "AST and does not move the location in the input string. This can be used for lookahead and "\r
     "disambiguation, along with the " { $link ensure } " word." }\r
 { $code "\"+\" token \"=\" token ensure-not \"+=\" token 3array seq" } ;\r
 \r
 HELP: action\r
-{ $values \r
-  { "parser" parser } \r
-  { "quot" { $quotation ( ast -- ast ) } } \r
+{ $values\r
+  { "parser" parser }\r
+  { "quot" { $quotation ( ast -- ast ) } }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that calls the 'p1' parser and applies the quotation to the AST resulting "\r
     "from that parse. The result of the quotation is then used as the final AST. This can be used "\r
     "for manipulating the parse tree to produce a AST better suited for the task at hand rather than "\r
@@ -140,41 +140,41 @@ HELP: action
 { $code "CHAR: 0 CHAR: 9 range [ to-digit ] action" } ;\r
 \r
 HELP: sp\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Returns a parser that calls the original parser 'p1' after stripping any whitespace "\r
     " from the left of the input string." } ;\r
 \r
 HELP: hide\r
-{ $values \r
-  { "parser" parser } \r
+{ $values\r
+  { "parser" parser }\r
 }\r
-{ $description \r
-    "Returns a parser that succeeds if the original parser succeeds, but does not " \r
+{ $description\r
+    "Returns a parser that succeeds if the original parser succeeds, but does not "\r
     "put any result in the AST. Useful for ignoring 'syntax' in the AST." }\r
 { $code "\"[\" token hide number \"]\" token hide 3array seq" } ;\r
 \r
 HELP: delay\r
-{ $values \r
-  { "quot" quotation } \r
-  { "parser" parser } \r
+{ $values\r
+  { "quot" quotation }\r
+  { "parser" parser }\r
 }\r
-{ $description \r
-    "Delays the construction of a parser until it is actually required to parse. This " \r
+{ $description\r
+    "Delays the construction of a parser until it is actually required to parse. This "\r
     "allows for calling a parser that results in a recursive call to itself. The quotation "\r
-    "should return the constructed parser and is called the first time the parser is run."\r
+    "should return the constructed parser and is called the first time the parser is run. "\r
     "The compiled result is memoized for future runs. See " { $link box } " for a word "\r
     "that calls the quotation at compile time." } ;\r
 \r
 HELP: box\r
-{ $values \r
-  { "quot" quotation } \r
-  { "parser" parser } \r
+{ $values\r
+  { "quot" quotation }\r
+  { "parser" parser }\r
 }\r
-{ $description \r
+{ $description\r
     "Delays the construction of a parser until the parser is compiled. The quotation "\r
-    "should return the constructed parser and is called when the parser is compiled."\r
+    "should return the constructed parser and is called when the parser is compiled. "\r
     "The compiled result is memoized for future runs. See " { $link delay } " for a word "\r
     "that calls the quotation at runtime." } ;\r