Expand description
Parser entry points: build grammar once and parse source.
Structs§
- Text
Edit - A text edit: replace
old_source[start..end]withnew_text.
Functions§
- parse
- Parse source as a program (Phase 3/4: list of statements).
- parse_
error_ to_ diagnostics - Convert a parse error into semantic diagnostics for LSP or other tooling.
- parse_
error_ to_ miette - Convert a parse error into a
miette::Reportwith source snippet and resolved literals. - parse_
expression - Parse source as a single expression (Phase 2).
- parse_
recovering - Parse in recovering mode: on failure, returns the partial output and the error.
- parse_
recovering_ multi - Parse in multi-error recovery mode: on statement failures, skip to the next sync point
(e.g.
;,}, or statement-start keyword) and continue, collecting up tomax_errorserrors. - parse_
signatures - Parse source as a signature file (function/class/global declarations only).
- parse_
to_ doc - Parse source and return a
ParsedDoc: source bytes, line index, and syntax root. - parse_
tokens - Parse source as a token stream (Phase 1 lexer).
- program_
expected_ labels - Expected labels for the program grammar (used for diagnostics).
- program_
literals - Literal table for the program grammar (used for parsing full programs).
- program_
rule_ names - Rule names for the program grammar (used for diagnostics).
- reparse
- Reparse after a text edit, reusing unchanged parts of the tree.
- reparse_
or_ parse - Apply a text edit and reparse incrementally, or fall back to full parse.