list-of-many ( items separator -- parser )


Vocabulary
peg.parsers

Inputs
itemsa sequence
separatora parser


Outputs
parsera parser


Word description
Returns a parser that returns a list of items separated by the separator parser. Hides the separators and matches a list of two or more items.

Notes
Item AST values equal to ignore are omitted. The minimum of two items counts matches, not retained AST values, so the result may be empty.

Use list-of to allow a single item match.

Examples
USING: peg peg.parsers prettyprint ; "a" "a" token "," token list-of-many parse => exception

USING: peg peg.parsers prettyprint ; "a,a,a,a" "a" token "," token list-of-many parse .
V{ "a" "a" "a" "a" }


See also
list-of

Definition