Reading ahead
Factor documentation > Factor handbook > The language > Parsing words
Prev:staging-violation ( word -- * )
Next:Nested structure


Parsing words can consume input from the input stream. Words come in two flavors: words that throw upon finding end of file, and words that return f upon the same.

Parsing words that throw on end of file:
scan-token ( -- str )

scan-word-name ( -- string )

scan-word ( -- word )

scan-datum ( -- word/number )

scan-number ( -- number )

scan-object ( -- object )


Parsing words that return f on end of file:
(scan-token) ( -- str/f )

(scan-datum) ( -- word/number/f )


A simple example is the \ word:
USING: kernel parser sequences ;

IN: syntax

SYNTAX: \ scan-word <wrapper> suffix! ;