1 ! Copyright (C) 2006 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup peg ;
8 { "object" "an object" } }
10 "Write the object to the standard output stream, unless "
11 "it is an array, in which case recurse through the array "
12 "writing each object to the stream." }
13 { $example "USE: peg.search" "{ 65 \"bc\" { 68 \"ef\" } } tree-write" "AbcDef" } ;
17 { "string" "a string" }
18 { "parser" "a peg based parser" }
19 { "seq" "a sequence" }
22 "Returns a sequence containing the parse results of all substrings "
23 "from the input string that successfully parse using the "
27 { $example "USING: peg.parsers peg.search prettyprint ;" "\"one 123 two 456\" 'integer' search ." "V{ 123 456 }" }
28 { $example "USING: peg peg.parsers peg.search prettyprint ;" "\"one 123 \\\"hello\\\" two 456\" 'integer' 'string' 2choice search ." "V{ 123 \"hello\" 456 }" }
29 { $see-also replace } ;
33 { "string" "a string" }
34 { "parser" "a peg based parser" }
35 { "result" "a string" }
38 "Returns a copy of the original string but with all substrings that "
39 "successfully parse with the given parser replaced with "
40 "the result of that parser."
42 { $example "USING: math math.parser peg peg.parsers peg.search prettyprint ;" "\"one 123 two 456\" 'integer' [ 2 * number>string ] action replace ." "\"one 246 two 912\"" }
43 { $see-also search } ;