parseman 0.48.0 → 0.49.0
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/analysis/diagnostics.js +158 -51
- package/dist/analysis/diagnostics.js.map +2 -2
- package/dist/cli/index.js +160 -52
- package/dist/cli/index.js.map +2 -2
- package/dist/combinators/choice.d.ts.map +1 -1
- package/dist/compiler/ir-serialize.d.ts.map +1 -1
- package/dist/compiler/linker.d.ts.map +1 -1
- package/dist/index.js +169 -55
- package/dist/index.js.map +2 -2
- package/dist/language-service/index.js.map +1 -1
- package/dist/plugin/direct-builder-static.d.ts +20 -0
- package/dist/plugin/direct-builder-static.d.ts.map +1 -1
- package/dist/plugin/evaluator.d.ts +13 -0
- package/dist/plugin/evaluator.d.ts.map +1 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +365 -71
- package/dist/plugin/index.js.map +2 -2
- package/dist/spec/index.js +12 -2
- package/dist/spec/index.js.map +2 -2
- package/dist/table/assemble.d.ts.map +1 -1
- package/dist/table/emit-assembly.d.ts.map +1 -1
- package/dist/table/encode.d.ts.map +1 -1
- package/dist/table/exec.d.ts.map +1 -1
- package/dist/table/index.js +158 -51
- package/dist/table/index.js.map +1 -1
- package/dist/table/lex-program.d.ts.map +1 -1
- package/dist/table/ops.d.ts +4 -4
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/combinators/choice.ts +10 -1
- package/src/compiler/ir-serialize.ts +15 -3
- package/src/compiler/linker.ts +14 -1
- package/src/plugin/direct-builder-static.ts +116 -12
- package/src/plugin/evaluator.ts +50 -2
- package/src/plugin/index.ts +140 -1
- package/src/table/assemble.ts +82 -59
- package/src/table/emit-assembly.ts +10 -5
- package/src/table/encode.ts +6 -10
- package/src/table/exec.ts +13 -18
- package/src/table/lex-program.ts +15 -6
- package/src/table/ops.ts +4 -4
- package/src/types.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../src/combinators/choice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAC+B,QAAQ,EAClD,MAAM,aAAa,CAAA;AAKpB,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;AACvH,KAAK,SAAS,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI;KACrE,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC,MAAM,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAEjD,wBAAgB,MAAM,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EACxH,GAAG,IAAI,EAAE,CAAC,GACT,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"choice.d.ts","sourceRoot":"","sources":["../../src/combinators/choice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAC+B,QAAQ,EAClD,MAAM,aAAa,CAAA;AAKpB,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,UAAU,CA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M,aAAa,CAAA;AAuB7E,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AAiG/B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAC/C,QAAQ,CAAC,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,GAChC,MAAM,GAAG,IAAI,CAUf;AAED;;oFAEoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ir-serialize.d.ts","sourceRoot":"","sources":["../../src/compiler/ir-serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAkC,MAAM,aAAa,CAAA;AAuB7E,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AAiG/B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAC/C,QAAQ,CAAC,EAAE,SAAS,IAAI,EAAE,GAAG,IAAI,GAChC,MAAM,GAAG,IAAI,CAUf;AAED;;oFAEoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAiH/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../src/compiler/linker.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAsC,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEvF,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAKtF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aA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AGgF;AAChF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAsFD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACrD,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,GAC7B,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAErC"}
|
package/dist/index.js
CHANGED
|
@@ -2950,6 +2950,7 @@ function choice(...args) {
|
|
|
2950
2950
|
},
|
|
2951
2951
|
parse(input, pos, ctx) {
|
|
2952
2952
|
const expected = [];
|
|
2953
|
+
let expectedAt = pos;
|
|
2953
2954
|
if (disjoint) {
|
|
2954
2955
|
const code = pos < input.length ? input.codePointAt(pos) : -1;
|
|
2955
2956
|
let idx = code >= 0 && code < 128 ? asciiDispatch[code] : -1;
|
|
@@ -3007,7 +3008,12 @@ function choice(...args) {
|
|
|
3007
3008
|
const result = parsers[i].parse(input, pos, ctx);
|
|
3008
3009
|
if (!result.ok) {
|
|
3009
3010
|
rollbackTrivia(ctx, mark);
|
|
3010
|
-
|
|
3011
|
+
const at = result.span.start;
|
|
3012
|
+
if (at > expectedAt) {
|
|
3013
|
+
expectedAt = at;
|
|
3014
|
+
expected.length = 0;
|
|
3015
|
+
}
|
|
3016
|
+
if (at === expectedAt) expected.push(...result.expected);
|
|
3011
3017
|
if (result.committed) return { ok: false, expected, span: result.span, committed: true };
|
|
3012
3018
|
continue;
|
|
3013
3019
|
}
|
|
@@ -3018,6 +3024,9 @@ function choice(...args) {
|
|
|
3018
3024
|
}
|
|
3019
3025
|
return result;
|
|
3020
3026
|
}
|
|
3027
|
+
if (expected.length === 0) {
|
|
3028
|
+
for (const parser2 of parsers) expected.push(...deriveExpected(parser2));
|
|
3029
|
+
}
|
|
3021
3030
|
return { ok: false, expected, span: { start: pos, end: pos } };
|
|
3022
3031
|
}
|
|
3023
3032
|
};
|
|
@@ -5608,24 +5617,43 @@ function choiceNode(arms, classes, armExpected, choiceExpected) {
|
|
|
5608
5617
|
};
|
|
5609
5618
|
for (let i = arms.length - 1; i >= 0; i--) {
|
|
5610
5619
|
const arm = arms[i], cls = classes[i], staticExpected = armExpected[i], next = tail;
|
|
5611
|
-
tail = (input, pos, ctx, lead2, acc) => {
|
|
5620
|
+
tail = (input, pos, ctx, lead2, acc, best) => {
|
|
5612
5621
|
if (cls !== void 0 && !classHas(cls, lead2)) {
|
|
5613
|
-
return next(
|
|
5622
|
+
return next(
|
|
5623
|
+
input,
|
|
5624
|
+
pos,
|
|
5625
|
+
ctx,
|
|
5626
|
+
lead2,
|
|
5627
|
+
best === pos ? appendExpected(acc, staticExpected) : acc,
|
|
5628
|
+
best
|
|
5629
|
+
);
|
|
5614
5630
|
}
|
|
5615
5631
|
ctx._fc = false;
|
|
5616
5632
|
const end = arm.run(input, pos, ctx);
|
|
5617
5633
|
if (end >= 0) return end;
|
|
5618
|
-
const
|
|
5634
|
+
const at = ctx._fe ?? pos;
|
|
5635
|
+
if (at > best) {
|
|
5636
|
+
best = at;
|
|
5637
|
+
acc = void 0;
|
|
5638
|
+
}
|
|
5639
|
+
const nextAcc = at === best ? appendExpected(acc, ctx._fx) : acc;
|
|
5619
5640
|
if (committed(ctx)) {
|
|
5620
5641
|
if (nextAcc !== void 0) ctx._fx = nextAcc;
|
|
5621
5642
|
return -1;
|
|
5622
5643
|
}
|
|
5623
|
-
return next(input, pos, ctx, lead2, nextAcc);
|
|
5644
|
+
return next(input, pos, ctx, lead2, nextAcc, best);
|
|
5624
5645
|
};
|
|
5625
5646
|
}
|
|
5626
5647
|
return {
|
|
5627
5648
|
match: matchTail,
|
|
5628
|
-
run: (input, pos, ctx) => tail(
|
|
5649
|
+
run: (input, pos, ctx) => tail(
|
|
5650
|
+
input,
|
|
5651
|
+
pos,
|
|
5652
|
+
ctx,
|
|
5653
|
+
pos < input.length ? input.codePointAt(pos) : -1,
|
|
5654
|
+
void 0,
|
|
5655
|
+
pos
|
|
5656
|
+
)
|
|
5629
5657
|
};
|
|
5630
5658
|
}
|
|
5631
5659
|
function notNode(body, failure) {
|
|
@@ -9719,9 +9747,11 @@ ${catchCases}
|
|
|
9719
9747
|
ctx._fc=false
|
|
9720
9748
|
{const v=${arm}(input,pos,ctx)
|
|
9721
9749
|
if(v!==FAIL)return v}
|
|
9722
|
-
acc=${catchName}(${i},prev,acc)
|
|
9750
|
+
if(best===pos)acc=${catchName}(${i},prev,acc)
|
|
9723
9751
|
prev=${i + 1}
|
|
9724
|
-
|
|
9752
|
+
{const at=ctx._fe??pos
|
|
9753
|
+
if(at>best){best=at;acc=undefined}
|
|
9754
|
+
if(at===best)acc=_accSet(ctx._fx,acc)}
|
|
9725
9755
|
if(ctx._fc===true){if(acc!==undefined)ctx._fx=acc;return FAIL}
|
|
9726
9756
|
${emitRollback(p, L.buf, sinks)}
|
|
9727
9757
|
}`;
|
|
@@ -9730,19 +9760,22 @@ ${emitRollback(p, L.buf, sinks)}
|
|
|
9730
9760
|
ctx._fc=false
|
|
9731
9761
|
{const v=${arm}(input,pos,ctx)
|
|
9732
9762
|
if(v!==FAIL)return v}
|
|
9733
|
-
|
|
9763
|
+
{const at=ctx._fe??pos
|
|
9764
|
+
if(at>best){best=at;acc=undefined}
|
|
9765
|
+
if(at===best)acc=_accSet(ctx._fx,acc)}
|
|
9734
9766
|
if(ctx._fc===true){if(acc!==undefined)ctx._fx=acc;return FAIL}
|
|
9735
9767
|
${emitRollback(p, L.buf, sinks)}
|
|
9736
|
-
}else acc=_accSet(${expected[i]},acc)`).join("\n");
|
|
9768
|
+
}else if(best===pos)acc=_accSet(${expected[i]},acc)`).join("\n");
|
|
9737
9769
|
return `${head}
|
|
9738
9770
|
const c=lead(input,pos)
|
|
9739
9771
|
${emitMark(p, L.buf, sinks)}
|
|
9740
9772
|
let acc
|
|
9773
|
+
let best=pos
|
|
9741
9774
|
${maskable ? `if(c<128){
|
|
9742
9775
|
const bits=${maskName}[c<0?128:c]
|
|
9743
9776
|
let prev=0
|
|
9744
9777
|
${maskArms}
|
|
9745
|
-
acc=${catchName}(${n},prev,acc)
|
|
9778
|
+
if(best===pos)acc=${catchName}(${n},prev,acc)
|
|
9746
9779
|
ctx._fe=pos;ctx._fx=acc??${choiceFx}
|
|
9747
9780
|
return FAIL
|
|
9748
9781
|
}
|
|
@@ -10874,14 +10907,19 @@ function assemble(t, prog, cfg) {
|
|
|
10874
10907
|
};
|
|
10875
10908
|
}
|
|
10876
10909
|
function maskedChoiceBlock(start, a0, a1, a2, a3, through, next, total, choiceFx) {
|
|
10877
|
-
return (input, pos, ctx, bits, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev) => {
|
|
10910
|
+
return (input, pos, ctx, bits, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev, best) => {
|
|
10878
10911
|
if ((bits & 1 << start) !== 0) {
|
|
10879
10912
|
ctx._fc = false;
|
|
10880
10913
|
const v = a0(input, pos, ctx);
|
|
10881
10914
|
if (v !== FAIL) return v;
|
|
10882
|
-
acc = through(start, prev, acc);
|
|
10915
|
+
if (best === pos) acc = through(start, prev, acc);
|
|
10883
10916
|
prev = start + 1;
|
|
10884
|
-
|
|
10917
|
+
const at = ctx._fe ?? pos;
|
|
10918
|
+
if (at > best) {
|
|
10919
|
+
best = at;
|
|
10920
|
+
acc = void 0;
|
|
10921
|
+
}
|
|
10922
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10885
10923
|
if (committed3(ctx)) {
|
|
10886
10924
|
if (acc !== void 0) ctx._fx = acc;
|
|
10887
10925
|
return FAIL;
|
|
@@ -10892,9 +10930,14 @@ function assemble(t, prog, cfg) {
|
|
|
10892
10930
|
ctx._fc = false;
|
|
10893
10931
|
const v = a1(input, pos, ctx);
|
|
10894
10932
|
if (v !== FAIL) return v;
|
|
10895
|
-
acc = through(start + 1, prev, acc);
|
|
10933
|
+
if (best === pos) acc = through(start + 1, prev, acc);
|
|
10896
10934
|
prev = start + 2;
|
|
10897
|
-
|
|
10935
|
+
const at = ctx._fe ?? pos;
|
|
10936
|
+
if (at > best) {
|
|
10937
|
+
best = at;
|
|
10938
|
+
acc = void 0;
|
|
10939
|
+
}
|
|
10940
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10898
10941
|
if (committed3(ctx)) {
|
|
10899
10942
|
if (acc !== void 0) ctx._fx = acc;
|
|
10900
10943
|
return FAIL;
|
|
@@ -10905,9 +10948,14 @@ function assemble(t, prog, cfg) {
|
|
|
10905
10948
|
ctx._fc = false;
|
|
10906
10949
|
const v = a2(input, pos, ctx);
|
|
10907
10950
|
if (v !== FAIL) return v;
|
|
10908
|
-
acc = through(start + 2, prev, acc);
|
|
10951
|
+
if (best === pos) acc = through(start + 2, prev, acc);
|
|
10909
10952
|
prev = start + 3;
|
|
10910
|
-
|
|
10953
|
+
const at = ctx._fe ?? pos;
|
|
10954
|
+
if (at > best) {
|
|
10955
|
+
best = at;
|
|
10956
|
+
acc = void 0;
|
|
10957
|
+
}
|
|
10958
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10911
10959
|
if (committed3(ctx)) {
|
|
10912
10960
|
if (acc !== void 0) ctx._fx = acc;
|
|
10913
10961
|
return FAIL;
|
|
@@ -10918,9 +10966,14 @@ function assemble(t, prog, cfg) {
|
|
|
10918
10966
|
ctx._fc = false;
|
|
10919
10967
|
const v = a3(input, pos, ctx);
|
|
10920
10968
|
if (v !== FAIL) return v;
|
|
10921
|
-
acc = through(start + 3, prev, acc);
|
|
10969
|
+
if (best === pos) acc = through(start + 3, prev, acc);
|
|
10922
10970
|
prev = start + 4;
|
|
10923
|
-
|
|
10971
|
+
const at = ctx._fe ?? pos;
|
|
10972
|
+
if (at > best) {
|
|
10973
|
+
best = at;
|
|
10974
|
+
acc = void 0;
|
|
10975
|
+
}
|
|
10976
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10924
10977
|
if (committed3(ctx)) {
|
|
10925
10978
|
if (acc !== void 0) ctx._fx = acc;
|
|
10926
10979
|
return FAIL;
|
|
@@ -10928,23 +10981,28 @@ function assemble(t, prog, cfg) {
|
|
|
10928
10981
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
10929
10982
|
}
|
|
10930
10983
|
if (next !== void 0) {
|
|
10931
|
-
return next(input, pos, ctx, bits, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev);
|
|
10984
|
+
return next(input, pos, ctx, bits, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev, best);
|
|
10932
10985
|
}
|
|
10933
|
-
acc = through(total, prev, acc);
|
|
10986
|
+
if (best === pos) acc = through(total, prev, acc);
|
|
10934
10987
|
ctx._fe = pos;
|
|
10935
10988
|
ctx._fx = acc ?? choiceFx;
|
|
10936
10989
|
return FAIL;
|
|
10937
10990
|
};
|
|
10938
10991
|
}
|
|
10939
10992
|
function generalChoiceBlock(start, a0, a1, a2, a3, g0, g1, g2, g3, through, next, total, choiceFx) {
|
|
10940
|
-
return (input, pos, ctx, c, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev) => {
|
|
10993
|
+
return (input, pos, ctx, c, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev, best) => {
|
|
10941
10994
|
if (g0 === null || classHas2(g0, c)) {
|
|
10942
10995
|
ctx._fc = false;
|
|
10943
10996
|
const v = a0(input, pos, ctx);
|
|
10944
10997
|
if (v !== FAIL) return v;
|
|
10945
|
-
acc = through(start, prev, acc);
|
|
10998
|
+
if (best === pos) acc = through(start, prev, acc);
|
|
10946
10999
|
prev = start + 1;
|
|
10947
|
-
|
|
11000
|
+
const at = ctx._fe ?? pos;
|
|
11001
|
+
if (at > best) {
|
|
11002
|
+
best = at;
|
|
11003
|
+
acc = void 0;
|
|
11004
|
+
}
|
|
11005
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10948
11006
|
if (committed3(ctx)) {
|
|
10949
11007
|
if (acc !== void 0) ctx._fx = acc;
|
|
10950
11008
|
return FAIL;
|
|
@@ -10955,9 +11013,14 @@ function assemble(t, prog, cfg) {
|
|
|
10955
11013
|
ctx._fc = false;
|
|
10956
11014
|
const v = a1(input, pos, ctx);
|
|
10957
11015
|
if (v !== FAIL) return v;
|
|
10958
|
-
acc = through(start + 1, prev, acc);
|
|
11016
|
+
if (best === pos) acc = through(start + 1, prev, acc);
|
|
10959
11017
|
prev = start + 2;
|
|
10960
|
-
|
|
11018
|
+
const at = ctx._fe ?? pos;
|
|
11019
|
+
if (at > best) {
|
|
11020
|
+
best = at;
|
|
11021
|
+
acc = void 0;
|
|
11022
|
+
}
|
|
11023
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10961
11024
|
if (committed3(ctx)) {
|
|
10962
11025
|
if (acc !== void 0) ctx._fx = acc;
|
|
10963
11026
|
return FAIL;
|
|
@@ -10968,9 +11031,14 @@ function assemble(t, prog, cfg) {
|
|
|
10968
11031
|
ctx._fc = false;
|
|
10969
11032
|
const v = a2(input, pos, ctx);
|
|
10970
11033
|
if (v !== FAIL) return v;
|
|
10971
|
-
acc = through(start + 2, prev, acc);
|
|
11034
|
+
if (best === pos) acc = through(start + 2, prev, acc);
|
|
10972
11035
|
prev = start + 3;
|
|
10973
|
-
|
|
11036
|
+
const at = ctx._fe ?? pos;
|
|
11037
|
+
if (at > best) {
|
|
11038
|
+
best = at;
|
|
11039
|
+
acc = void 0;
|
|
11040
|
+
}
|
|
11041
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10974
11042
|
if (committed3(ctx)) {
|
|
10975
11043
|
if (acc !== void 0) ctx._fx = acc;
|
|
10976
11044
|
return FAIL;
|
|
@@ -10981,9 +11049,14 @@ function assemble(t, prog, cfg) {
|
|
|
10981
11049
|
ctx._fc = false;
|
|
10982
11050
|
const v = a3(input, pos, ctx);
|
|
10983
11051
|
if (v !== FAIL) return v;
|
|
10984
|
-
acc = through(start + 3, prev, acc);
|
|
11052
|
+
if (best === pos) acc = through(start + 3, prev, acc);
|
|
10985
11053
|
prev = start + 4;
|
|
10986
|
-
|
|
11054
|
+
const at = ctx._fe ?? pos;
|
|
11055
|
+
if (at > best) {
|
|
11056
|
+
best = at;
|
|
11057
|
+
acc = void 0;
|
|
11058
|
+
}
|
|
11059
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
10987
11060
|
if (committed3(ctx)) {
|
|
10988
11061
|
if (acc !== void 0) ctx._fx = acc;
|
|
10989
11062
|
return FAIL;
|
|
@@ -10991,9 +11064,9 @@ function assemble(t, prog, cfg) {
|
|
|
10991
11064
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
10992
11065
|
}
|
|
10993
11066
|
if (next !== void 0) {
|
|
10994
|
-
return next(input, pos, ctx, c, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev);
|
|
11067
|
+
return next(input, pos, ctx, c, need, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot, acc, prev, best);
|
|
10995
11068
|
}
|
|
10996
|
-
acc = through(total, prev, acc);
|
|
11069
|
+
if (best === pos) acc = through(total, prev, acc);
|
|
10997
11070
|
ctx._fe = pos;
|
|
10998
11071
|
ctx._fx = acc ?? choiceFx;
|
|
10999
11072
|
return FAIL;
|
|
@@ -12349,6 +12422,7 @@ function assemble(t, prog, cfg) {
|
|
|
12349
12422
|
const mLog = need ? ctx._triviaLog?.length ?? 0 : 0;
|
|
12350
12423
|
const mRoot = need ? ctx._rootTriviaLog?.length ?? 0 : 0;
|
|
12351
12424
|
let acc;
|
|
12425
|
+
let best = pos;
|
|
12352
12426
|
if (c < 128) {
|
|
12353
12427
|
const bits = mask[c < 0 ? 128 : c];
|
|
12354
12428
|
let prev = 0;
|
|
@@ -12357,7 +12431,12 @@ function assemble(t, prog, cfg) {
|
|
|
12357
12431
|
const v = a0(input, pos, ctx);
|
|
12358
12432
|
if (v !== FAIL) return v;
|
|
12359
12433
|
prev = 1;
|
|
12360
|
-
|
|
12434
|
+
const at = ctx._fe ?? pos;
|
|
12435
|
+
if (at > best) {
|
|
12436
|
+
best = at;
|
|
12437
|
+
acc = void 0;
|
|
12438
|
+
}
|
|
12439
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12361
12440
|
if (committed3(ctx)) {
|
|
12362
12441
|
if (acc !== void 0) ctx._fx = acc;
|
|
12363
12442
|
return FAIL;
|
|
@@ -12368,9 +12447,14 @@ function assemble(t, prog, cfg) {
|
|
|
12368
12447
|
ctx._fc = false;
|
|
12369
12448
|
const v = a1(input, pos, ctx);
|
|
12370
12449
|
if (v !== FAIL) return v;
|
|
12371
|
-
if (prev < 1) acc = accSet(e0, acc);
|
|
12450
|
+
if (best === pos && prev < 1) acc = accSet(e0, acc);
|
|
12372
12451
|
prev = 2;
|
|
12373
|
-
|
|
12452
|
+
const at = ctx._fe ?? pos;
|
|
12453
|
+
if (at > best) {
|
|
12454
|
+
best = at;
|
|
12455
|
+
acc = void 0;
|
|
12456
|
+
}
|
|
12457
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12374
12458
|
if (committed3(ctx)) {
|
|
12375
12459
|
if (acc !== void 0) ctx._fx = acc;
|
|
12376
12460
|
return FAIL;
|
|
@@ -12381,19 +12465,24 @@ function assemble(t, prog, cfg) {
|
|
|
12381
12465
|
ctx._fc = false;
|
|
12382
12466
|
const v = a2(input, pos, ctx);
|
|
12383
12467
|
if (v !== FAIL) return v;
|
|
12384
|
-
if (prev < 1) acc = accSet(e0, acc);
|
|
12385
|
-
if (prev < 2) acc = accSet(e1, acc);
|
|
12468
|
+
if (best === pos && prev < 1) acc = accSet(e0, acc);
|
|
12469
|
+
if (best === pos && prev < 2) acc = accSet(e1, acc);
|
|
12386
12470
|
prev = 3;
|
|
12387
|
-
|
|
12471
|
+
const at = ctx._fe ?? pos;
|
|
12472
|
+
if (at > best) {
|
|
12473
|
+
best = at;
|
|
12474
|
+
acc = void 0;
|
|
12475
|
+
}
|
|
12476
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12388
12477
|
if (committed3(ctx)) {
|
|
12389
12478
|
if (acc !== void 0) ctx._fx = acc;
|
|
12390
12479
|
return FAIL;
|
|
12391
12480
|
}
|
|
12392
12481
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
12393
12482
|
}
|
|
12394
|
-
if (prev < 1) acc = accSet(e0, acc);
|
|
12395
|
-
if (prev < 2) acc = accSet(e1, acc);
|
|
12396
|
-
if (n === 3 && prev < 3) acc = accSet(e2, acc);
|
|
12483
|
+
if (best === pos && prev < 1) acc = accSet(e0, acc);
|
|
12484
|
+
if (best === pos && prev < 2) acc = accSet(e1, acc);
|
|
12485
|
+
if (best === pos && n === 3 && prev < 3) acc = accSet(e2, acc);
|
|
12397
12486
|
ctx._fe = pos;
|
|
12398
12487
|
ctx._fx = acc ?? choiceFx;
|
|
12399
12488
|
return FAIL;
|
|
@@ -12402,36 +12491,51 @@ function assemble(t, prog, cfg) {
|
|
|
12402
12491
|
ctx._fc = false;
|
|
12403
12492
|
const v = a0(input, pos, ctx);
|
|
12404
12493
|
if (v !== FAIL) return v;
|
|
12405
|
-
|
|
12494
|
+
const at = ctx._fe ?? pos;
|
|
12495
|
+
if (at > best) {
|
|
12496
|
+
best = at;
|
|
12497
|
+
acc = void 0;
|
|
12498
|
+
}
|
|
12499
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12406
12500
|
if (committed3(ctx)) {
|
|
12407
12501
|
if (acc !== void 0) ctx._fx = acc;
|
|
12408
12502
|
return FAIL;
|
|
12409
12503
|
}
|
|
12410
12504
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
12411
|
-
} else acc = accSet(e0, acc);
|
|
12505
|
+
} else if (best === pos) acc = accSet(e0, acc);
|
|
12412
12506
|
if (g1 === null || classHas2(g1, c)) {
|
|
12413
12507
|
ctx._fc = false;
|
|
12414
12508
|
const v = a1(input, pos, ctx);
|
|
12415
12509
|
if (v !== FAIL) return v;
|
|
12416
|
-
|
|
12510
|
+
const at = ctx._fe ?? pos;
|
|
12511
|
+
if (at > best) {
|
|
12512
|
+
best = at;
|
|
12513
|
+
acc = void 0;
|
|
12514
|
+
}
|
|
12515
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12417
12516
|
if (committed3(ctx)) {
|
|
12418
12517
|
if (acc !== void 0) ctx._fx = acc;
|
|
12419
12518
|
return FAIL;
|
|
12420
12519
|
}
|
|
12421
12520
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
12422
|
-
} else acc = accSet(e1, acc);
|
|
12521
|
+
} else if (best === pos) acc = accSet(e1, acc);
|
|
12423
12522
|
if (n === 3) {
|
|
12424
12523
|
if (g2 === null || classHas2(g2, c)) {
|
|
12425
12524
|
ctx._fc = false;
|
|
12426
12525
|
const v = a2(input, pos, ctx);
|
|
12427
12526
|
if (v !== FAIL) return v;
|
|
12428
|
-
|
|
12527
|
+
const at = ctx._fe ?? pos;
|
|
12528
|
+
if (at > best) {
|
|
12529
|
+
best = at;
|
|
12530
|
+
acc = void 0;
|
|
12531
|
+
}
|
|
12532
|
+
if (at === best) acc = accSet(ctx._fx, acc);
|
|
12429
12533
|
if (committed3(ctx)) {
|
|
12430
12534
|
if (acc !== void 0) ctx._fx = acc;
|
|
12431
12535
|
return FAIL;
|
|
12432
12536
|
}
|
|
12433
12537
|
if (need) rollbackTriviaAt(ctx, mRaw, mTl, mLv, mFl, mEr, mLog, mRoot);
|
|
12434
|
-
} else acc = accSet(e2, acc);
|
|
12538
|
+
} else if (best === pos) acc = accSet(e2, acc);
|
|
12435
12539
|
}
|
|
12436
12540
|
ctx._fe = pos;
|
|
12437
12541
|
ctx._fx = acc ?? choiceFx;
|
|
@@ -12529,7 +12633,8 @@ function assemble(t, prog, cfg) {
|
|
|
12529
12633
|
mLog,
|
|
12530
12634
|
mRoot,
|
|
12531
12635
|
void 0,
|
|
12532
|
-
0
|
|
12636
|
+
0,
|
|
12637
|
+
pos
|
|
12533
12638
|
);
|
|
12534
12639
|
}
|
|
12535
12640
|
return general(
|
|
@@ -12546,7 +12651,8 @@ function assemble(t, prog, cfg) {
|
|
|
12546
12651
|
mLog,
|
|
12547
12652
|
mRoot,
|
|
12548
12653
|
void 0,
|
|
12549
|
-
0
|
|
12654
|
+
0,
|
|
12655
|
+
pos
|
|
12550
12656
|
);
|
|
12551
12657
|
};
|
|
12552
12658
|
}
|
|
@@ -12574,7 +12680,8 @@ function assemble(t, prog, cfg) {
|
|
|
12574
12680
|
mLog,
|
|
12575
12681
|
mRoot,
|
|
12576
12682
|
void 0,
|
|
12577
|
-
0
|
|
12683
|
+
0,
|
|
12684
|
+
pos
|
|
12578
12685
|
);
|
|
12579
12686
|
};
|
|
12580
12687
|
}
|
|
@@ -15359,7 +15466,7 @@ function evalRuleMapIR(ir) {
|
|
|
15359
15466
|
l._def.fnSrc = src;
|
|
15360
15467
|
return l;
|
|
15361
15468
|
};
|
|
15362
|
-
const _nd = (type, child, src, opts, staticError, sigSrc) => {
|
|
15469
|
+
const _nd = (type, child, src, opts, staticError, sigSrc, buildImports) => {
|
|
15363
15470
|
if (staticError !== void 0 && staticError.length > 0) {
|
|
15364
15471
|
throw new Error(`IR direct node builder for ${type} must be macro-static and self-contained; unsupported binding(s): ${staticError.join(", ")}`);
|
|
15365
15472
|
}
|
|
@@ -15369,6 +15476,7 @@ function evalRuleMapIR(ir) {
|
|
|
15369
15476
|
n._def.buildSrc = src;
|
|
15370
15477
|
if (staticError !== void 0) n._def.buildStaticError = staticError;
|
|
15371
15478
|
if (sigSrc !== void 0) n._def.buildSigSrc = sigSrc;
|
|
15479
|
+
if (buildImports !== void 0) n._def.buildImports = buildImports;
|
|
15372
15480
|
return n;
|
|
15373
15481
|
};
|
|
15374
15482
|
const _gch = (items) => {
|
|
@@ -15760,11 +15868,12 @@ ${outerDecls.map((d) => " " + d).join("\n")}
|
|
|
15760
15868
|
}
|
|
15761
15869
|
if (def.buildSrc !== void 0) {
|
|
15762
15870
|
const tail = [];
|
|
15763
|
-
if (def.buildStaticError !== void 0 || def.buildSigSrc !== void 0) {
|
|
15871
|
+
if (def.buildStaticError !== void 0 || def.buildSigSrc !== void 0 || def.buildImports !== void 0) {
|
|
15764
15872
|
if (!opts) tail.push("undefined");
|
|
15765
15873
|
tail.push(def.buildStaticError === void 0 ? "undefined" : JSON.stringify(def.buildStaticError));
|
|
15766
15874
|
}
|
|
15767
|
-
if (def.buildSigSrc !== void 0) tail.push(JSON.stringify(def.buildSigSrc));
|
|
15875
|
+
if (def.buildSigSrc !== void 0 || def.buildImports !== void 0) tail.push(def.buildSigSrc === void 0 ? "undefined" : JSON.stringify(def.buildSigSrc));
|
|
15876
|
+
if (def.buildImports !== void 0) tail.push(JSON.stringify(def.buildImports));
|
|
15768
15877
|
const trailing = tail.length > 0 ? `, ${tail.join(", ")}` : "";
|
|
15769
15878
|
return `_nd(${JSON.stringify(def.type)}, ${kid(def.parser)}, ${JSON.stringify(def.buildSrc)}${opts}${trailing})`;
|
|
15770
15879
|
}
|
|
@@ -15911,7 +16020,7 @@ function compileRuleMap(ruleMap, opts = {}) {
|
|
|
15911
16020
|
}
|
|
15912
16021
|
|
|
15913
16022
|
// src/version.ts
|
|
15914
|
-
var PARSEMAN_VERSION = "0.
|
|
16023
|
+
var PARSEMAN_VERSION = "0.49.0";
|
|
15915
16024
|
|
|
15916
16025
|
// src/compiler/compile-linkable-table.ts
|
|
15917
16026
|
function isLocal(rule) {
|
|
@@ -16067,6 +16176,11 @@ function materializeDirectBuilders(ruleMap) {
|
|
|
16067
16176
|
seen.add(p);
|
|
16068
16177
|
const d = p._def;
|
|
16069
16178
|
if (d.tag === "node" && typeof d.buildSrc === "string") {
|
|
16179
|
+
if (d.buildImports !== void 0 && d.buildImports.length > 0) {
|
|
16180
|
+
throw new Error(
|
|
16181
|
+
`IR direct node builder for ${d.type ?? "<anonymous>"} references module import(s) ${d.buildImports.map((bi) => bi.local).join(", ")} that a runtime compose() cannot supply; compose at build time via the parseman macro plugin, which re-emits the imports.`
|
|
16182
|
+
);
|
|
16183
|
+
}
|
|
16070
16184
|
try {
|
|
16071
16185
|
const fn = (0, eval)(`(${d.buildSrc})`);
|
|
16072
16186
|
if (typeof fn === "function") d.build = fn;
|