list-of ( items separator -- parser )


Vocabulary
parser-combinators

Inputs
itemsa parser object
separatora parser object


Outputs
parsera parser object


Word description
Return a parser for parsing the repetition of things that are separated by a certain symbol. For example, comma separated lists. 'items' is a parser that can parse the individual elements. 'separator' is a parser for the symbol that separatest them. The result tree of the resulting parser is an array of the parsed elements.
USING: parser-combinators parser-combinators.simple prettyprint ; "1,2,3,4" integer-parser "," token list-of parse-1 .
{ 1 2 3 4 }


See also
list-of

Definition