Handbook
Glossary
with-lexer ( lexer quot -- newquot )
The lexer
Prev:
skip-word ( lexer -- )
Vocabulary
lexer
Inputs
lexer
a
lexer
quot
a
quotation
Outputs
newquot
a
quotation
Word description
Calls the quotation with the
lexer
variable set to the given lexer. The quotation can make use of words such as
scan-token
. Any errors thrown by the quotation are wrapped in
lexer-error
instances.
Definition
USING:
continuations
kernel
namespaces
;
IN:
lexer
:
with-lexer
( lexer quot -- newquot )
[
[
<lexer-error>
rethrow
]
recover
]
curry
[
lexer
]
dip
with-variable
;
inline