scan-datum ( -- word/number )
Factor handbook » The language » Parsing words » Reading ahead

Prev:scan-word ( -- word )
Next:scan-number ( -- number )


Vocabulary
parser

Inputs
None

Outputs
word/numbera word or a number


Word description
Reads the next token from parser input. If the token is found in the vocabulary search path, returns the word named be the token. If the token is not found in the vocabulary search path, it is converted to a number. If this conversion fails, an error is thrown.

Errors
Throws an error if the token is not a number or end of file is reached.

Notes
This word should only be called from parsing words.

Definition