Handbook
Glossary
surrounded-by ( parser begin end -- parser' )
Vocabulary
peg
.
parsers
Inputs
parser
a parser
begin
a
string
end
a
string
Outputs
parser'
a parser
Word description
Calls token on begin and end to make them into string parsers. Returns a parser that parses the begin, body, and end parsers in order. The begin and end parsers are hidden.
Examples
USING: peg peg.parsers prettyprint ; "hi123bye" integer-parser "hi" "bye" surrounded-by parse .
123
See also
pack
Definition
USING:
kernel
peg
;
IN:
peg.parsers
:
surrounded-by
( parser begin end -- parser' )
[
token
]
bi@
swapd
pack
;