From 463a1991cae6c861e88ee54a3bb256f1b3ff5c44 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Mon, 7 Apr 2008 13:02:56 +1200 Subject: [PATCH] Fix peg help --- extra/peg/parsers/parsers-docs.factor | 4 ++-- extra/peg/peg-docs.factor | 4 ++-- extra/peg/peg.factor | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/peg/parsers/parsers-docs.factor b/extra/peg/parsers/parsers-docs.factor index d49f1158dd..d71fdaea3b 100755 --- a/extra/peg/parsers/parsers-docs.factor +++ b/extra/peg/parsers/parsers-docs.factor @@ -173,7 +173,7 @@ HELP: range-pattern "of characters separated with a dash (-) represents the " "range of characters from the first to the second, inclusive." { $examples - { $example "USING: peg peg.parsers prettyprint ;" "\"a\" \"_a-zA-Z\" range-pattern parse parse-result-ast 1string ." "\"a\"" } - { $example "USING: peg peg.parsers prettyprint ;" "\"0\" \"^0-9\" range-pattern parse ." "f" } + { $example "USING: peg peg.parsers prettyprint strings ;" "\"a\" \"_a-zA-Z\" range-pattern parse parse-result-ast 1string ." "\"a\"" } + { $example "USING: peg peg.parsers prettyprint ;\n\"0\" \"^0-9\" range-pattern parse ." "f" } } } ; diff --git a/extra/peg/peg-docs.factor b/extra/peg/peg-docs.factor index 5f200be78e..10e05a2512 100644 --- a/extra/peg/peg-docs.factor +++ b/extra/peg/peg-docs.factor @@ -104,8 +104,8 @@ HELP: semantic "Returns a parser that succeeds if the 'p1' parser succeeds and the quotation called with " "the AST produced by 'p1' on the stack returns true." } { $examples - { $example "\"A\" [ drop t ] satisfy [ 66 > ] semantic parse" "f" } - { $example "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse parse-result-ast " "67" } + { $example "USING: kernel math peg prettyprint ;" "\"A\" [ drop t ] satisfy [ 66 > ] semantic parse ." "f" } + { $example "USING: kernel math peg prettyprint ;" "\"C\" [ drop t ] satisfy [ 66 > ] semantic parse parse-result-ast ." "67" } } ; HELP: ensure diff --git a/extra/peg/peg.factor b/extra/peg/peg.factor index 3635abac84..ee9037ff25 100755 --- a/extra/peg/peg.factor +++ b/extra/peg/peg.factor @@ -241,7 +241,7 @@ GENERIC: (compile) ( parser -- quot ) : compiled-parse ( state word -- result ) swap [ execute ] with-packrat ; inline -: parse ( state parser -- result ) +: parse ( input parser -- result ) dup word? [ compile ] unless compiled-parse ;