peg: fix some old docs that referred to "p1".

db4
John Benediktsson 2015-09-02 10:34:59 -07:00
parent 6ee9fad443
commit b28a24c7df
1 changed files with 12 additions and 12 deletions

View File

@ -75,8 +75,8 @@ HELP: repeat0
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that parses 0 or more instances of the 'p1' parser. The AST produced is " "Returns a parser that parses 0 or more instances of the " { $snippet "parser" } ". The AST produced is "
"an array of the AST produced by the 'p1' parser. An empty array indicates 0 instances were " "an array of the AST produced by the " { $snippet "parser" } ". An empty array indicates 0 instances were "
"parsed." } ; "parsed." } ;
HELP: repeat1 HELP: repeat1
@ -84,16 +84,16 @@ HELP: repeat1
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that parses 1 or more instances of the 'p1' parser. The AST produced is " "Returns a parser that parses 1 or more instances of the " { $snippet "parser" } ". The AST produced is "
"an array of the AST produced by the 'p1' parser." } ; "an array of the AST produced by the " { $snippet "parser" } "." } ;
HELP: optional HELP: optional
{ $values { $values
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that parses 0 or 1 instances of the 'p1' parser. The AST produced is " "Returns a parser that parses 0 or 1 instances of the " { $snippet "parser" } ". The AST produced is "
"'f' if 0 instances are parsed the AST produced is 'f', otherwise it is the AST produced by 'p1'." } ; { $link f } " if 0 instances are parsed the AST produced is " { $link f } ", otherwise it is the AST produced by " { $snippet "parser" } "." } ;
HELP: semantic HELP: semantic
{ $values { $values
@ -101,8 +101,8 @@ HELP: semantic
{ "quot" { $quotation ( object -- ? ) } } { "quot" { $quotation ( object -- ? ) } }
} }
{ $description { $description
"Returns a parser that succeeds if the 'p1' parser succeeds and the quotation called with " "Returns a parser that succeeds if the " { $snippet "parser" } " succeeds and the quotation called with "
"the AST produced by 'p1' on the stack returns true." } "the AST produced by " { $snippet "parser" } " on the stack returns true." }
{ $examples { $examples
{ $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse ." "67" } { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse ." "67" }
} ; } ;
@ -112,7 +112,7 @@ HELP: ensure
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that succeeds if the 'p1' parser succeeds but does not add anything to the " "Returns a parser that succeeds if the " { $snippet "parser" } " succeeds but does not add anything to the "
"AST and does not move the location in the input string. This can be used for lookahead and " "AST and does not move the location in the input string. This can be used for lookahead and "
"disambiguation, along with the " { $link ensure-not } " word." } "disambiguation, along with the " { $link ensure-not } " word." }
{ $examples { $code "\"0\" token ensure octal-parser" } } ; { $examples { $code "\"0\" token ensure octal-parser" } } ;
@ -122,7 +122,7 @@ HELP: ensure-not
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that succeeds if the 'p1' parser fails but does not add anything to the " "Returns a parser that succeeds if the " { $snippet "parser" } " fails but does not add anything to the "
"AST and does not move the location in the input string. This can be used for lookahead and " "AST and does not move the location in the input string. This can be used for lookahead and "
"disambiguation, along with the " { $link ensure } " word." } "disambiguation, along with the " { $link ensure } " word." }
{ $code "\"+\" token \"=\" token ensure-not \"+=\" token 3array seq" } ; { $code "\"+\" token \"=\" token ensure-not \"+=\" token 3array seq" } ;
@ -133,7 +133,7 @@ HELP: action
{ "quot" { $quotation ( ast -- ast ) } } { "quot" { $quotation ( ast -- ast ) } }
} }
{ $description { $description
"Returns a parser that calls the 'p1' parser and applies the quotation to the AST resulting " "Returns a parser that calls the " { $snippet "parser" } " and applies the quotation to the AST resulting "
"from that parse. The result of the quotation is then used as the final AST. This can be used " "from that parse. The result of the quotation is then used as the final AST. This can be used "
"for manipulating the parse tree to produce a AST better suited for the task at hand rather than " "for manipulating the parse tree to produce a AST better suited for the task at hand rather than "
"the default AST. If the quotation returns " { $link fail } " then the parser fails." } "the default AST. If the quotation returns " { $link fail } " then the parser fails." }
@ -144,7 +144,7 @@ HELP: sp
{ "parser" parser } { "parser" parser }
} }
{ $description { $description
"Returns a parser that calls the original parser 'p1' after stripping any whitespace " "Returns a parser that calls the original " { $snippet "parser" } " after stripping any whitespace "
" from the left of the input string." } ; " from the left of the input string." } ;
HELP: hide HELP: hide