Skip to main content

Module parser

Module parser 

Source

Structs§

TextEdit
A text edit: replace old_source[start..end] with new_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::Report with 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 to max_errors errors.
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.