Skip to main content

Module lexer

Module lexer 

Source
Expand description

The lexer - converts raw source text into a flat Vec<Token>.

ยงPipeline position

source -> Lexer -> [Token] -> Parser -> [Statement] -> Checker -> Evaluator

ยงModule layout

  • tokenizer - the [Tokenizer] struct and its main scanning loop
  • tokentypes - the [Token] and [TokenType] definitions
  • scanner - top-level scan driver called by the pipeline
  • types - sub-scanners for each literal kind (string, char, number, identifier)
  • utils - shared cursor helpers used across the sub-scanners

Modulesยง

scanner ๐Ÿ”’
Top-level scan driver.
tokenizer
Tokenizer struct and the main character-by-character scan loop.
tokentypes
Token and TokenType - the complete vocabulary of the lexer.
types ๐Ÿ”’
Sub-scanners for each literal and identifier kind.
utils ๐Ÿ”’
Shared cursor helpers for the lexer sub-scanners.