Skip to main content

Module lexer

Module lexer 

Source
Expand description

A deliberately tiny, hand-written tokenizer for fslite-command’s line grammar. It is not a shell: there is no expansion of any kind (globs, $VAR, ~, command substitution) and no shell metacharacter (|, ;, &, <, >, backtick, $() is ever treated as literal text when it appears unquoted — it is rejected outright, so a user who pastes a real shell command gets a clear error instead of a confusing partial parse.

Enums§

LexError
Why a line could not be tokenized.
Token
One lexical token: a bare word/path, or a --flag[=value].

Constants§

MAX_LINE_LEN
The maximum accepted input line length, checked before any allocation proportional to the input beyond the raw string itself.

Functions§

tokenize
Tokenizes one line of fslite-command grammar.