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.
@@ -4077,7 +4077,7 @@ function regex(pattern, flags = "") {
4077
4077
  }
4078
4078
 
4079
4079
  // src/version.ts
4080
- var PARSEMAN_VERSION = "0.61.7";
4080
+ var PARSEMAN_VERSION = "0.61.8";
4081
4081
 
4082
4082
  // src/table/lex-body.ts
4083
4083
  function buildLexBodyRecognizer(spec, constants) {
@@ -13869,11 +13869,15 @@ function failCleanAnalysis(code) {
13869
13869
  case OP_CONT:
13870
13870
  out = clean(code[ip + 1]) && neverFails(code[ip + 3]);
13871
13871
  break;
13872
- // An arm's failure and the fallback's are committed; only the selector's is
13873
- // not, and without a fallback an unknown key fails after the selector wrote.
13874
- case OP_DISPATCH:
13875
- out = code[ip + 3] >= 0 && clean(code[ip + 1]);
13872
+ // An arm's failure and a committing fallback's are committed; only the
13873
+ // selector's is not. An uncommitted fallback's failure leaves the selector's
13874
+ // capture, unless the fallback reads it through `routed()`, which rolls that
13875
+ // capture back first. With no fallback, the dispatch fails after the selector wrote.
13876
+ case OP_DISPATCH: {
13877
+ const flags = code[ip + 4];
13878
+ out = code[ip + 3] >= 0 && ((flags & 2) === 0 || (flags & 1) === 1) && clean(code[ip + 1]);
13876
13879
  break;
13880
+ }
13877
13881
  default: {
13878
13882
  const c = passChild(code, ip);
13879
13883
  out = c >= 0 && clean(c);