Parser.Lexer
is a submodule of common-token parsers: whitespace handling, integers, identifiers, and literal symbols.
identifier
(Fn [] (Parser String))
(identifier)
parses a C-style identifier: a letter or
underscore, followed by zero or more letters, digits, or underscores.
Returns the matched text as a String.
integer
(Fn [] (Parser Int))
(integer)
parses an optional - sign followed by decimal
digits as an Int. Fused into a single closure.
lexeme
(Fn [(Parser a)] (Parser a))
(lexeme p)
runs p, then skips trailing whitespace. Returns p's value.
symbol
(Fn [String] (Parser String))
(symbol s)
matches the literal string s, then skips trailing whitespace.
unsigned-int
(Fn [] (Parser Int))
(unsigned-int)
parses one or more decimal digits as an
Int. Fused into a single closure for performance — does not go
through bind/map.
whitespace
(Fn [] (Parser ()))
(whitespace)
consumes zero or more ASCII whitespace bytes (space, tab, CR, LF). Always succeeds; the result is unit.