Wax_wasm.ParsingSourceGeneric parsing utilities.
Exception raised when a syntax error occurs, with location range and message.
A syntax error returned as data by parse_diagnostics: the location range, the human-readable message, and any related labels (e.g. the matching opening delimiter).
type sync_class = | Open| Close| Boundary| Leader| Terminal| SkipHow the panic-mode recovery of Make.parse_recover treats a token when it is scanning for a place to resynchronize. The skip is nesting-aware: it tracks the bracket depth entered while skipping so a boundary belonging to a group opened inside the skipped span does not resynchronize the enclosing construct.
Open — an opening bracket. Descends one nesting level; never itself a resync point.Close — a closing bracket. At the outer level (depth 0) it is a resync point closing an enclosing construct; otherwise it ascends one level (matching an Open met while skipping) and scanning continues.Boundary — a non-bracket resync point (typically a statement separator), counted only at the outer level, like a Close. Recovery stops there, unwinds the parser stack to the closest state that can shift it, shifts it, and resumes.Leader — a resync point valid at any depth: an item/statement-leading keyword. Recovery stops at one even inside an unbalanced opener, so a stray bracket cannot swallow the next top-level item.Terminal — the end-of-input token. Recovery stops at it but never discards it; if no stacked state can accept it, parsing gives up (the best-effort AST is then absent).Skip — anything else: discarded while scanning for the next boundary.module Make
(Output : sig ... end)
(Tokens : sig ... end)
(_ : sig ... end)
(_ : sig ... end)
(_ : sig ... end) :
sig ... endCore parser over a Menhir incremental API, without the fast parser. The incremental parser produces both the AST and, via Parser_messages, the error in a single pass, so this is all an in-process consumer that only wants parse_diagnostics needs. See Make_parser for the fast-path variant.