Skip to main content

Module parser

Module parser 

Source
Expand description

The parser itself: the state every production shares, and the helpers they all use.

Design: spec/06-lexer-and-parser.md section 6.3.

The productions live in the modules beside this one and are written as inherent methods on Parser, so they read as one recursive descent parser split across files rather than as a set of functions passing state to each other. What is here is the state, the diagnostics, and the small number of decisions that more than one production needs.

Structs§

Context
Everything the parser needs that is not the tokens.
Parsed
What one parse produced.
Parser
The parser.

Constants§

MAX_NESTING
How deeply brackets may nest before the parser gives up.