package wax-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=41b580846af8d41bdf6c3f005f62e38feda3e60fe2e9e4aa440db34ce515a153
sha512=4b3a181fcc7d743194a8647260870fb5190770066a197bcc48104c2b77fd40c643228b795c2bcd6b29a120820e969eb42a37a9bcec98b3f608d13f152d9f6579
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 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 (")") Parsing.Make.parse_recover may insert to auto-close a construct still open in front of a boundary or at end of input. Passed as its ?closers argument.
Placeholder tokens 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 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.