Handbook
Glossary
ensure ( parser -- parser )
Vocabulary
peg
Inputs
parser
a
parser
Outputs
parser
a
parser
Word description
Returns a parser that succeeds if the
parser
succeeds but does not add anything to the AST and does not move the location in the input string. This can be used for lookahead and disambiguation, along with the
ensure-not
word.
Examples
"0" token ensure octal-parser
Definition
USING:
kernel
peg.private
;
IN:
peg
:
ensure
( parser -- parser )
ensure-parser
boa
wrap-peg
;