Skip to main content

Module lexer

Module lexer 

Source
Expand description

Stateful mode-stack lexer, a direct port of the v0.0.6 lexer.mll.

The transitions between the five states are driven entirely by the lexer’s own stack (see the transition table in the OCaml header comment); the whole file is lexed eagerly so that parser backtracking can never desynchronize the mode stack.

Structs§

LexError

Functions§

lex
Lex a whole source file under SATySFi 0.0.6’s grammar (a .saty document, i.e. program mode at the top) — a thin wrapper over lex_with_version.
lex_partial
lex_with_version, keeping the tokens produced before a failure instead of discarding them.
lex_with_version
Lex a whole source file under an explicit target version. V0_0 through this entry point is byte-for-byte lex’s own behavior — pinned by a differential test that lexes every vendored 0.0.6 package and fixture through both lex(src) and lex_with_version(src, V0_0), asserting identical token streams (crates/rustyfi-syntax/tests/lex_with_version_differential.rs).