Skip to main content

Module parser

Module parser 

Source
Expand description

The parser - transforms a flat Vec<Token> produced by the lexer into a Vec<Statement> that represents the abstract syntax tree (AST).

ยงPipeline position

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

ยงModule layout

  • parser_logic - the [Parser] struct and its core cursor primitives
  • expressions - precedence-climbing expression parser
  • statements - one sub-module per statement kind
  • utils - shared helpers (type annotation parsing)

Modulesยง

expressions ๐Ÿ”’
Precedence-climbing expression parser.
parser_logic
Core Parser struct and its cursor primitives.
statements ๐Ÿ”’
Top-level statement dispatcher and block parser.
utils ๐Ÿ”’