package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=41b580846af8d41bdf6c3f005f62e38feda3e60fe2e9e4aa440db34ce515a153
sha512=4b3a181fcc7d743194a8647260870fb5190770066a197bcc48104c2b77fd40c643228b795c2bcd6b29a120820e969eb42a37a9bcec98b3f608d13f152d9f6579
doc/wax-lib.wasm/Wax_wasm/Parsing/index.html
Module Wax_wasm.ParsingSource
Generic 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| Skip(*How the panic-mode recovery of
Make.parse_recovertreats 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 anOpenmet while skipping) and scanning continues.Boundary— a non-bracket resync point (typically a statement separator), counted only at the outer level, like aClose. 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.