package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4361e1324b7754a4c08ab5b505df32061f3ce0cea60443fd0d3699e0fa796b32
sha512=fcc756d2f160ba90a9aa1131f2ab22ed7f45466ccd658c21cf9df6868a6aab0cee7f404719d698a379958802f9820398f2fe0685ecc4dda018ca4f653294e39b
doc/wax-lib.wasm/Wax_wasm/Recover/index.html
Module Wax_wasm.RecoverSource
Sync-token classification for the WAT parser's panic-mode error recovery.
Classify a WAT token for Wax_utils.Parsing.Make.parse_recover: every opening parenthesis (bare LPAREN and the compound (param/… tokens) is Open, RPAREN is Close, end-of-input is Terminal, and everything else is Skip. WAT being fully parenthesized, the parentheses are the only resynchronization points; recovery relies on the nesting-aware skip and on auto-closing with closers.
The closing brackets (")") Wax_utils.Parsing.Make.parse_recover may insert to auto-close a construct still open in front of a boundary or at end of input, each paired with its source spelling (used to build the auto-close quick fix). Passed as its ?closers argument.
Placeholder tokens Wax_utils.Parsing.Make.parse_recover may insert to repair a construct missing a required token — a zero-width 0 for a missing numeric operand or index — each with the diagnostic to report. Passed as its ?insert argument.
The barrier Wax_utils.Parsing.Make.parse_recover uses to recognize a missing closer (a new field offered where an instruction was expected) and restart at that field: the ( token to re-offer, the predicate for a field keyword written after a bare ( (offered as a pair), and the predicate for a fused (type/(import/(export opener (offered alone). Passed as its ?barrier argument.