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.
@@ -5635,7 +5635,7 @@ function sourceLeaf(root, fn) {
5635
5635
  }
5636
5636
 
5637
5637
  // src/version.ts
5638
- var PARSEMAN_VERSION = "0.61.7";
5638
+ var PARSEMAN_VERSION = "0.61.8";
5639
5639
 
5640
5640
  // src/table/lex-body.ts
5641
5641
  function buildLexBodyRecognizer(spec, constants) {
@@ -13945,11 +13945,15 @@ function failCleanAnalysis(code) {
13945
13945
  case OP_CONT:
13946
13946
  out = clean(code[ip + 1]) && neverFails(code[ip + 3]);
13947
13947
  break;
13948
- // An arm's failure and the fallback's are committed; only the selector's is
13949
- // not, and without a fallback an unknown key fails after the selector wrote.
13950
- case OP_DISPATCH:
13951
- out = code[ip + 3] >= 0 && clean(code[ip + 1]);
13948
+ // An arm's failure and a committing fallback's are committed; only the
13949
+ // selector's is not. An uncommitted fallback's failure leaves the selector's
13950
+ // capture, unless the fallback reads it through `routed()`, which rolls that
13951
+ // capture back first. With no fallback, the dispatch fails after the selector wrote.
13952
+ case OP_DISPATCH: {
13953
+ const flags = code[ip + 4];
13954
+ out = code[ip + 3] >= 0 && ((flags & 2) === 0 || (flags & 1) === 1) && clean(code[ip + 1]);
13952
13955
  break;
13956
+ }
13953
13957
  default: {
13954
13958
  const c = passChild(code, ip);
13955
13959
  out = c >= 0 && clean(c);