 ! Copyright (C) 2009 Chris Double.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: help.syntax help.markup peg peg.search ;
-IN: peg.ebnf 
+IN: peg.ebnf
 
 HELP: <EBNF
 { $syntax "<EBNF ...ebnf... EBNF>" }
 { $values { "...ebnf..." "EBNF DSL text" } }
-{ $description 
-    "Creates a " { $vocab-link "peg" } 
+{ $description
+    "Creates a " { $vocab-link "peg" }
     " object that parses a string using the syntax "
     "defined with the EBNF DSL. The peg object can be run using the " { $link parse }
     " word and can be used with the " { $link search } " and " { $link replace } " words."
 }
 { $examples
-    { $example 
+    { $example
        "USING: kernel prettyprint peg.ebnf peg.search ;"
        "\"abcdab\" <EBNF rule=\"a\" \"b\" => [[ drop \"foo\" ]] EBNF> replace ."
        "\"foocdfoo\""

HELP: [EBNF
{ $syntax "[EBNF ...ebnf... EBNF]" }
{ $values { "...ebnf..." "EBNF DSL text" } }
{ $description 
    "Creates and calls a quotation that parses a string using the syntax "
    "defined with the EBNF DSL. The quotation has stack effect " 
    { $snippet "( string -- ast )" } " where 'string' is the text to be parsed "
    "and 'ast' is the resulting abstract syntax tree. If the parsing fails the "
    "quotation throws an exception."
}
{ $examples
    { $example 
       "USING: prettyprint peg.ebnf ;"
       "\"ab\" [EBNF rule=\"a\" \"b\" EBNF] ."
       "V{ \"a\" \"b\" }"

"The AST resulting from the match is an integer of the character code for the "
"character that matched."
{ $examples
    { $example
       "USING: prettyprint peg.ebnf ;"
       "\"123\" [EBNF rule=[0-9]+ EBNF] ."
       "V{ 49 50 51 }"
    }
}
;

ARTICLE: "peg.ebnf.one-or-more" "One or more"
