Handbook
Glossary
map-tokens ( ... end quot: ( ... token -- ... elt ) -- ... seq )
Factor handbook
»
The language
»
Parsing words
»
Parsing raw tokens
Prev:
each-token ( ... end quot: ( ... token -- ... ) -- ... )
Next:
parse-tokens ( end -- seq )
Vocabulary
lexer
Inputs
end
a
string
quot
a
quotation
with stack effect
( ... token -- ... elt )
Outputs
seq
a
sequence
of
object
s
Word description
Reads a sequence of tokens until the first occurrence of
end
.
quot
is called on each token as it is read, and the results are collected into a new output sequence.
Notes
This word should only be called from parsing words.
See also
parse-tokens
,
each-token
,
parse-until
,
(parse-until)
Definition
USING:
kernel
sequences
;
IN:
lexer
:
map-tokens
( ... end quot: ( ... token -- ... elt ) -- ... seq )
collector
[
each-token
]
dip
{
}
like
;
inline