Handbook
Glossary
(list-of) ( items separator repeat1? -- parser )
Vocabulary
peg
.
parsers
Inputs
items
a
sequence
separator
a parser
repeat1?
a
boolean
Outputs
parser
a parser
Word description
Returns a parser that returns a list of items separated by the separator parser. Does not hide the separators.
See also
list-of
,
list-of-many
Definition
USING:
kernel
peg
sequences
vectors
;
IN:
peg.parsers
:
(list-of)
( items separator repeat1? -- parser )
[
over
2seq
]
dip
[
repeat1
]
[
repeat0
]
if
[
concat
]
action
2seq
[
unclip
1vector
swap
first
append
]
action
;