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