parseman 0.61.7 → 0.61.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5666,7 +5666,7 @@ function sourceLeaf(root, fn) {
5666
5666
  }
5667
5667
 
5668
5668
  // src/version.ts
5669
- var PARSEMAN_VERSION = "0.61.7";
5669
+ var PARSEMAN_VERSION = "0.61.8";
5670
5670
 
5671
5671
  // src/table/lex-body.ts
5672
5672
  function buildLexBodyRecognizer(spec, constants) {
@@ -14325,11 +14325,15 @@ function failCleanAnalysis(code) {
14325
14325
  case OP_CONT:
14326
14326
  out = clean(code[ip + 1]) && neverFails(code[ip + 3]);
14327
14327
  break;
14328
- // An arm's failure and the fallback's are committed; only the selector's is
14329
- // not, and without a fallback an unknown key fails after the selector wrote.
14330
- case OP_DISPATCH:
14331
- out = code[ip + 3] >= 0 && clean(code[ip + 1]);
14328
+ // An arm's failure and a committing fallback's are committed; only the
14329
+ // selector's is not. An uncommitted fallback's failure leaves the selector's
14330
+ // capture, unless the fallback reads it through `routed()`, which rolls that
14331
+ // capture back first. With no fallback, the dispatch fails after the selector wrote.
14332
+ case OP_DISPATCH: {
14333
+ const flags = code[ip + 4];
14334
+ out = code[ip + 3] >= 0 && ((flags & 2) === 0 || (flags & 1) === 1) && clean(code[ip + 1]);
14332
14335
  break;
14336
+ }
14333
14337
  default: {
14334
14338
  const c = passChild(code, ip);
14335
14339
  out = c >= 0 && clean(c);