@loopstack/loopstack-studio 0.25.0 → 0.25.2
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/components/ai-elements/message.js +2 -2
- package/dist/components/ai-elements/reasoning.js +9 -9
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
- package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
- package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
- package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
- package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
- package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
- package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
- package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
- package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
- package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
- package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
- package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
- package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
- package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
- package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
- package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
- package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
- package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
- package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
- package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
- package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
- package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
- package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
- package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
- package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
- package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
- package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
- package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
- package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
- package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
- package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
- package/dist/node_modules/katex/dist/katex.js +1256 -1209
- package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
- package/dist/node_modules/lodash-es/_baseClone.js +2 -2
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
- package/dist/node_modules/lodash-es/_baseToString.js +1 -1
- package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
- package/dist/node_modules/lodash-es/_createSet.js +1 -1
- package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
- package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
- package/dist/node_modules/lodash-es/findIndex.js +2 -2
- package/dist/node_modules/lodash-es/flatMap.js +1 -1
- package/dist/node_modules/lodash-es/forEach.js +1 -1
- package/dist/node_modules/lodash-es/max.js +1 -1
- package/dist/node_modules/lodash-es/min.js +1 -1
- package/dist/node_modules/lodash-es/minBy.js +1 -1
- package/dist/node_modules/lodash-es/reduce.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
- package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
- package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
- package/dist/node_modules/remend/dist/index.js +333 -264
- package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
- package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
- package/dist/node_modules/streamdown/dist/index.js +1 -1
- package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
- package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
- package/dist/pages/DashboardPage.js +3 -3
- package/package.json +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
- package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
- package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
- package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
- package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
- package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
- package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
- package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
- package/dist/node_modules/lodash-es/_baseSome.js +0 -9
- package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
- package/dist/node_modules/lodash-es/assign.js +0 -14
- package/dist/node_modules/lodash-es/compact.js +0 -9
- package/dist/node_modules/lodash-es/difference.js +0 -8
- package/dist/node_modules/lodash-es/drop.js +0 -8
- package/dist/node_modules/lodash-es/dropRight.js +0 -8
- package/dist/node_modules/lodash-es/every.js +0 -11
- package/dist/node_modules/lodash-es/groupBy.js +0 -6
- package/dist/node_modules/lodash-es/head.js +0 -5
- package/dist/node_modules/lodash-es/includes.js +0 -13
- package/dist/node_modules/lodash-es/indexOf.js +0 -11
- package/dist/node_modules/lodash-es/isRegExp.js +0 -5
- package/dist/node_modules/lodash-es/negate.js +0 -16
- package/dist/node_modules/lodash-es/pickBy.js +0 -15
- package/dist/node_modules/lodash-es/reject.js +0 -10
- package/dist/node_modules/lodash-es/some.js +0 -11
- package/dist/node_modules/lodash-es/uniq.js +0 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
- package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
- package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
- package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
|
|
2
|
-
import clone_default from "../../../../../lodash-es/clone.js";
|
|
3
|
-
import forEach_default from "../../../../../lodash-es/forEach.js";
|
|
4
|
-
import map_default from "../../../../../lodash-es/map.js";
|
|
5
|
-
import has_default from "../../../../../lodash-es/has.js";
|
|
6
|
-
import values_default from "../../../../../lodash-es/values.js";
|
|
7
1
|
import { toFastProperties } from "../../../../../@chevrotain/utils/lib/src/to-fast-properties.js";
|
|
8
2
|
import { computeAllProdsFollows } from "../grammar/follow.js";
|
|
9
3
|
import { EOF, createTokenInstance } from "../../scan/tokens_public.js";
|
|
@@ -17,7 +11,6 @@ import { LexerAdapter } from "./traits/lexer_adapter.js";
|
|
|
17
11
|
import { RecognizerApi } from "./traits/recognizer_api.js";
|
|
18
12
|
import { RecognizerEngine } from "./traits/recognizer_engine.js";
|
|
19
13
|
import { ErrorHandler } from "./traits/error_handler.js";
|
|
20
|
-
import { ContentAssist } from "./traits/context_assist.js";
|
|
21
14
|
import { GastRecorder } from "./traits/gast_recorder.js";
|
|
22
15
|
import { PerformanceTracer } from "./traits/perf_tracer.js";
|
|
23
16
|
import { applyMixins } from "./utils/apply_mixins.js";
|
|
@@ -37,68 +30,68 @@ const DEFAULT_PARSER_CONFIG = Object.freeze({
|
|
|
37
30
|
resyncEnabled: !0
|
|
38
31
|
});
|
|
39
32
|
var ParserDefinitionErrorType;
|
|
40
|
-
(function(
|
|
41
|
-
|
|
33
|
+
(function(e) {
|
|
34
|
+
e[e.INVALID_RULE_NAME = 0] = "INVALID_RULE_NAME", e[e.DUPLICATE_RULE_NAME = 1] = "DUPLICATE_RULE_NAME", e[e.INVALID_RULE_OVERRIDE = 2] = "INVALID_RULE_OVERRIDE", e[e.DUPLICATE_PRODUCTIONS = 3] = "DUPLICATE_PRODUCTIONS", e[e.UNRESOLVED_SUBRULE_REF = 4] = "UNRESOLVED_SUBRULE_REF", e[e.LEFT_RECURSION = 5] = "LEFT_RECURSION", e[e.NONE_LAST_EMPTY_ALT = 6] = "NONE_LAST_EMPTY_ALT", e[e.AMBIGUOUS_ALTS = 7] = "AMBIGUOUS_ALTS", e[e.CONFLICT_TOKENS_RULES_NAMESPACE = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE", e[e.INVALID_TOKEN_NAME = 9] = "INVALID_TOKEN_NAME", e[e.NO_NON_EMPTY_LOOKAHEAD = 10] = "NO_NON_EMPTY_LOOKAHEAD", e[e.AMBIGUOUS_PREFIX_ALTS = 11] = "AMBIGUOUS_PREFIX_ALTS", e[e.TOO_MANY_ALTS = 12] = "TOO_MANY_ALTS", e[e.CUSTOM_LOOKAHEAD_VALIDATION = 13] = "CUSTOM_LOOKAHEAD_VALIDATION";
|
|
42
35
|
})(ParserDefinitionErrorType ||= {});
|
|
43
|
-
function EMPTY_ALT(
|
|
36
|
+
function EMPTY_ALT(e = void 0) {
|
|
44
37
|
return function() {
|
|
45
|
-
return
|
|
38
|
+
return e;
|
|
46
39
|
};
|
|
47
40
|
}
|
|
48
|
-
var Parser = class
|
|
49
|
-
static performSelfAnalysis(
|
|
41
|
+
var Parser = class S {
|
|
42
|
+
static performSelfAnalysis(e) {
|
|
50
43
|
throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.");
|
|
51
44
|
}
|
|
52
45
|
performSelfAnalysis() {
|
|
53
46
|
this.TRACE_INIT("performSelfAnalysis", () => {
|
|
54
|
-
let
|
|
47
|
+
let C;
|
|
55
48
|
this.selfAnalysisDone = !0;
|
|
56
|
-
let
|
|
49
|
+
let w = this.className;
|
|
57
50
|
this.TRACE_INIT("toFastProps", () => {
|
|
58
51
|
toFastProperties(this);
|
|
59
52
|
}), this.TRACE_INIT("Grammar Recording", () => {
|
|
60
53
|
try {
|
|
61
|
-
this.enableRecording(),
|
|
62
|
-
let
|
|
63
|
-
this.TRACE_INIT(`${
|
|
64
|
-
|
|
65
|
-
}), this.gastProductionsCache[
|
|
54
|
+
this.enableRecording(), this.definedRulesNames.forEach((e) => {
|
|
55
|
+
let x = this[e].originalGrammarAction, S;
|
|
56
|
+
this.TRACE_INIT(`${e} Rule`, () => {
|
|
57
|
+
S = this.topLevelRuleRecord(e, x);
|
|
58
|
+
}), this.gastProductionsCache[e] = S;
|
|
66
59
|
});
|
|
67
60
|
} finally {
|
|
68
61
|
this.disableRecording();
|
|
69
62
|
}
|
|
70
63
|
});
|
|
71
|
-
let
|
|
64
|
+
let T = [];
|
|
72
65
|
if (this.TRACE_INIT("Grammar Resolving", () => {
|
|
73
|
-
|
|
66
|
+
T = resolveGrammar({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(T);
|
|
74
67
|
}), this.TRACE_INIT("Grammar Validations", () => {
|
|
75
|
-
if (
|
|
76
|
-
let
|
|
77
|
-
rules:
|
|
78
|
-
tokenTypes:
|
|
68
|
+
if (T.length === 0 && this.skipValidations === !1) {
|
|
69
|
+
let e = validateGrammar({
|
|
70
|
+
rules: Object.values(this.gastProductionsCache),
|
|
71
|
+
tokenTypes: Object.values(this.tokensMap),
|
|
79
72
|
errMsgProvider: defaultGrammarValidatorErrorProvider,
|
|
80
|
-
grammarName:
|
|
81
|
-
}),
|
|
73
|
+
grammarName: w
|
|
74
|
+
}), x = validateLookahead({
|
|
82
75
|
lookaheadStrategy: this.lookaheadStrategy,
|
|
83
|
-
rules:
|
|
84
|
-
tokenTypes:
|
|
85
|
-
grammarName:
|
|
76
|
+
rules: Object.values(this.gastProductionsCache),
|
|
77
|
+
tokenTypes: Object.values(this.tokensMap),
|
|
78
|
+
grammarName: w
|
|
86
79
|
});
|
|
87
|
-
this.definitionErrors = this.definitionErrors.concat(
|
|
80
|
+
this.definitionErrors = this.definitionErrors.concat(e, x);
|
|
88
81
|
}
|
|
89
|
-
}),
|
|
90
|
-
this.resyncFollows = computeAllProdsFollows(
|
|
82
|
+
}), this.definitionErrors.length === 0 && (this.recoveryEnabled && this.TRACE_INIT("computeAllProdsFollows", () => {
|
|
83
|
+
this.resyncFollows = computeAllProdsFollows(Object.values(this.gastProductionsCache));
|
|
91
84
|
}), this.TRACE_INIT("ComputeLookaheadFunctions", () => {
|
|
92
|
-
var
|
|
93
|
-
(
|
|
94
|
-
})), !
|
|
85
|
+
var e, x;
|
|
86
|
+
(x = (e = this.lookaheadStrategy).initialize) == null || x.call(e, { rules: Object.values(this.gastProductionsCache) }), this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache));
|
|
87
|
+
})), !S.DEFER_DEFINITION_ERRORS_HANDLING && this.definitionErrors.length !== 0) throw C = this.definitionErrors.map((e) => e.message), Error(`Parser Definition Errors detected:\n ${C.join("\n-------------------------------\n")}`);
|
|
95
88
|
});
|
|
96
89
|
}
|
|
97
|
-
constructor(
|
|
90
|
+
constructor(e, x) {
|
|
98
91
|
this.definitionErrors = [], this.selfAnalysisDone = !1;
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
this.skipValidations =
|
|
92
|
+
let S = this;
|
|
93
|
+
if (S.initErrorHandler(x), S.initLexerAdapter(), S.initLooksAhead(x), S.initRecognizerEngine(e, x), S.initRecoverable(x), S.initTreeBuilder(x), S.initGastRecorder(x), S.initPerformanceTracer(x), Object.hasOwn(x, "ignoredIssues")) throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");
|
|
94
|
+
this.skipValidations = Object.hasOwn(x, "skipValidations") ? x.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
|
|
102
95
|
}
|
|
103
96
|
};
|
|
104
97
|
Parser.DEFER_DEFINITION_ERRORS_HANDLING = !1, applyMixins(Parser, [
|
|
@@ -109,14 +102,13 @@ Parser.DEFER_DEFINITION_ERRORS_HANDLING = !1, applyMixins(Parser, [
|
|
|
109
102
|
RecognizerEngine,
|
|
110
103
|
RecognizerApi,
|
|
111
104
|
ErrorHandler,
|
|
112
|
-
ContentAssist,
|
|
113
105
|
GastRecorder,
|
|
114
106
|
PerformanceTracer
|
|
115
107
|
]);
|
|
116
108
|
var EmbeddedActionsParser = class extends Parser {
|
|
117
|
-
constructor(
|
|
118
|
-
let
|
|
119
|
-
|
|
109
|
+
constructor(e, x = DEFAULT_PARSER_CONFIG) {
|
|
110
|
+
let S = Object.assign({}, x);
|
|
111
|
+
S.outputCst = !1, super(e, S);
|
|
120
112
|
}
|
|
121
113
|
};
|
|
122
114
|
export { DEFAULT_PARSER_CONFIG, DEFAULT_RULE_CONFIG, EMPTY_ALT, END_OF_FILE, EmbeddedActionsParser, ParserDefinitionErrorType };
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
import clone_default from "../../../../../../lodash-es/clone.js";
|
|
2
|
-
import has_default from "../../../../../../lodash-es/has.js";
|
|
3
1
|
import { getLookaheadPathsForOptionalProd, getLookaheadPathsForOr } from "../../grammar/lookahead.js";
|
|
4
2
|
import { EarlyExitException, NoViableAltException, isRecognitionException } from "../../exceptions_public.js";
|
|
5
3
|
import { DEFAULT_PARSER_CONFIG } from "../parser.js";
|
|
6
4
|
var ErrorHandler = class {
|
|
7
5
|
initErrorHandler(e) {
|
|
8
|
-
this._errors = [], this.errorMessageProvider =
|
|
6
|
+
this._errors = [], this.errorMessageProvider = Object.hasOwn(e, "errorMessageProvider") ? e.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider;
|
|
9
7
|
}
|
|
10
|
-
SAVE_ERROR(
|
|
11
|
-
if (isRecognitionException(
|
|
8
|
+
SAVE_ERROR(e) {
|
|
9
|
+
if (isRecognitionException(e)) return e.context = {
|
|
12
10
|
ruleStack: this.getHumanReadableRuleStack(),
|
|
13
|
-
ruleOccurrenceStack:
|
|
14
|
-
}, this._errors.push(
|
|
11
|
+
ruleOccurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1)
|
|
12
|
+
}, this._errors.push(e), e;
|
|
15
13
|
throw Error("Trying to save an Error which is not a RecognitionException");
|
|
16
14
|
}
|
|
17
15
|
get errors() {
|
|
18
|
-
return
|
|
16
|
+
return [...this._errors];
|
|
19
17
|
}
|
|
20
18
|
set errors(e) {
|
|
21
19
|
this._errors = e;
|
|
22
20
|
}
|
|
23
|
-
raiseEarlyExitException(
|
|
24
|
-
let a = this.getCurrRuleFullName(), o = this.getGAstProductions()[a], s = getLookaheadPathsForOptionalProd(
|
|
21
|
+
raiseEarlyExitException(t, r, i) {
|
|
22
|
+
let a = this.getCurrRuleFullName(), o = this.getGAstProductions()[a], s = getLookaheadPathsForOptionalProd(t, o, r, this.maxLookahead)[0], c = [];
|
|
25
23
|
for (let e = 1; e <= this.maxLookahead; e++) c.push(this.LA(e));
|
|
26
24
|
let l = this.errorMessageProvider.buildEarlyExitMessage({
|
|
27
25
|
expectedIterationPaths: s,
|
|
28
26
|
actual: c,
|
|
29
27
|
previous: this.LA(0),
|
|
30
|
-
customUserDescription:
|
|
28
|
+
customUserDescription: i,
|
|
31
29
|
ruleName: a
|
|
32
30
|
});
|
|
33
31
|
throw this.SAVE_ERROR(new EarlyExitException(l, this.LA(1), this.LA(0)));
|
|
34
32
|
}
|
|
35
|
-
raiseNoAltException(e,
|
|
36
|
-
let
|
|
33
|
+
raiseNoAltException(e, n) {
|
|
34
|
+
let i = this.getCurrRuleFullName(), a = this.getGAstProductions()[i], o = getLookaheadPathsForOr(e, a, this.maxLookahead), s = [];
|
|
37
35
|
for (let e = 1; e <= this.maxLookahead; e++) s.push(this.LA(e));
|
|
38
36
|
let c = this.LA(0), l = this.errorMessageProvider.buildNoViableAltMessage({
|
|
39
37
|
expectedPathsPerAlt: o,
|
|
40
38
|
actual: s,
|
|
41
39
|
previous: c,
|
|
42
|
-
customUserDescription:
|
|
40
|
+
customUserDescription: n,
|
|
43
41
|
ruleName: this.getCurrRuleFullName()
|
|
44
42
|
});
|
|
45
43
|
throw this.SAVE_ERROR(new NoViableAltException(l, this.LA(1), c));
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import isFunction_default from "../../../../../../lodash-es/isFunction.js";
|
|
2
|
-
import isArray_default from "../../../../../../lodash-es/isArray.js";
|
|
3
|
-
import last_default from "../../../../../../lodash-es/last.js";
|
|
4
|
-
import forEach_default from "../../../../../../lodash-es/forEach.js";
|
|
5
|
-
import has_default from "../../../../../../lodash-es/has.js";
|
|
6
|
-
import some_default from "../../../../../../lodash-es/some.js";
|
|
7
1
|
import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Rule, Terminal } from "../../../../../../@chevrotain/gast/lib/src/model.js";
|
|
8
2
|
import { augmentTokenTypes, hasShortKeyProperty } from "../../../scan/tokens.js";
|
|
9
3
|
import { Lexer } from "../../../scan/lexer_public.js";
|
|
@@ -23,149 +17,149 @@ var RECORDING_PHASE_CSTNODE = {
|
|
|
23
17
|
name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",
|
|
24
18
|
children: {}
|
|
25
19
|
}, GastRecorder = class {
|
|
26
|
-
initGastRecorder(
|
|
20
|
+
initGastRecorder(e) {
|
|
27
21
|
this.recordingProdStack = [], this.RECORDING_PHASE = !1;
|
|
28
22
|
}
|
|
29
23
|
enableRecording() {
|
|
30
24
|
this.RECORDING_PHASE = !0, this.TRACE_INIT("Enable Recording", () => {
|
|
31
|
-
for (let
|
|
32
|
-
let x =
|
|
25
|
+
for (let e = 0; e < 10; e++) {
|
|
26
|
+
let x = e > 0 ? e : "";
|
|
33
27
|
this[`CONSUME${x}`] = function(x, S) {
|
|
34
|
-
return this.consumeInternalRecord(x,
|
|
28
|
+
return this.consumeInternalRecord(x, e, S);
|
|
35
29
|
}, this[`SUBRULE${x}`] = function(x, S) {
|
|
36
|
-
return this.subruleInternalRecord(x,
|
|
30
|
+
return this.subruleInternalRecord(x, e, S);
|
|
37
31
|
}, this[`OPTION${x}`] = function(x) {
|
|
38
|
-
return this.optionInternalRecord(x,
|
|
32
|
+
return this.optionInternalRecord(x, e);
|
|
39
33
|
}, this[`OR${x}`] = function(x) {
|
|
40
|
-
return this.orInternalRecord(x,
|
|
34
|
+
return this.orInternalRecord(x, e);
|
|
41
35
|
}, this[`MANY${x}`] = function(x) {
|
|
42
|
-
this.manyInternalRecord(
|
|
36
|
+
this.manyInternalRecord(e, x);
|
|
43
37
|
}, this[`MANY_SEP${x}`] = function(x) {
|
|
44
|
-
this.manySepFirstInternalRecord(
|
|
38
|
+
this.manySepFirstInternalRecord(e, x);
|
|
45
39
|
}, this[`AT_LEAST_ONE${x}`] = function(x) {
|
|
46
|
-
this.atLeastOneInternalRecord(
|
|
40
|
+
this.atLeastOneInternalRecord(e, x);
|
|
47
41
|
}, this[`AT_LEAST_ONE_SEP${x}`] = function(x) {
|
|
48
|
-
this.atLeastOneSepFirstInternalRecord(
|
|
42
|
+
this.atLeastOneSepFirstInternalRecord(e, x);
|
|
49
43
|
};
|
|
50
44
|
}
|
|
51
|
-
this.consume = function(
|
|
52
|
-
return this.consumeInternalRecord(x,
|
|
53
|
-
}, this.subrule = function(
|
|
54
|
-
return this.subruleInternalRecord(x,
|
|
55
|
-
}, this.option = function(
|
|
56
|
-
return this.optionInternalRecord(x,
|
|
57
|
-
}, this.or = function(
|
|
58
|
-
return this.orInternalRecord(x,
|
|
59
|
-
}, this.many = function(
|
|
60
|
-
this.manyInternalRecord(
|
|
61
|
-
}, this.atLeastOne = function(
|
|
62
|
-
this.atLeastOneInternalRecord(
|
|
45
|
+
this.consume = function(e, x, S) {
|
|
46
|
+
return this.consumeInternalRecord(x, e, S);
|
|
47
|
+
}, this.subrule = function(e, x, S) {
|
|
48
|
+
return this.subruleInternalRecord(x, e, S);
|
|
49
|
+
}, this.option = function(e, x) {
|
|
50
|
+
return this.optionInternalRecord(x, e);
|
|
51
|
+
}, this.or = function(e, x) {
|
|
52
|
+
return this.orInternalRecord(x, e);
|
|
53
|
+
}, this.many = function(e, x) {
|
|
54
|
+
this.manyInternalRecord(e, x);
|
|
55
|
+
}, this.atLeastOne = function(e, x) {
|
|
56
|
+
this.atLeastOneInternalRecord(e, x);
|
|
63
57
|
}, this.ACTION = this.ACTION_RECORD, this.BACKTRACK = this.BACKTRACK_RECORD, this.LA = this.LA_RECORD;
|
|
64
58
|
});
|
|
65
59
|
}
|
|
66
60
|
disableRecording() {
|
|
67
61
|
this.RECORDING_PHASE = !1, this.TRACE_INIT("Deleting Recording methods", () => {
|
|
68
|
-
let
|
|
62
|
+
let e = this;
|
|
69
63
|
for (let x = 0; x < 10; x++) {
|
|
70
64
|
let S = x > 0 ? x : "";
|
|
71
|
-
delete
|
|
65
|
+
delete e[`CONSUME${S}`], delete e[`SUBRULE${S}`], delete e[`OPTION${S}`], delete e[`OR${S}`], delete e[`MANY${S}`], delete e[`MANY_SEP${S}`], delete e[`AT_LEAST_ONE${S}`], delete e[`AT_LEAST_ONE_SEP${S}`];
|
|
72
66
|
}
|
|
73
|
-
delete
|
|
67
|
+
delete e.consume, delete e.subrule, delete e.option, delete e.or, delete e.many, delete e.atLeastOne, delete e.ACTION, delete e.BACKTRACK, delete e.LA;
|
|
74
68
|
});
|
|
75
69
|
}
|
|
76
|
-
ACTION_RECORD(
|
|
77
|
-
BACKTRACK_RECORD(
|
|
70
|
+
ACTION_RECORD(e) {}
|
|
71
|
+
BACKTRACK_RECORD(e, x) {
|
|
78
72
|
return () => !0;
|
|
79
73
|
}
|
|
80
|
-
LA_RECORD(
|
|
74
|
+
LA_RECORD(e) {
|
|
81
75
|
return END_OF_FILE;
|
|
82
76
|
}
|
|
83
|
-
topLevelRuleRecord(
|
|
77
|
+
topLevelRuleRecord(e, x) {
|
|
84
78
|
try {
|
|
85
79
|
let S = new Rule({
|
|
86
80
|
definition: [],
|
|
87
|
-
name:
|
|
81
|
+
name: e
|
|
88
82
|
});
|
|
89
|
-
return S.name =
|
|
90
|
-
} catch (
|
|
91
|
-
if (
|
|
92
|
-
|
|
83
|
+
return S.name = e, this.recordingProdStack.push(S), x.call(this), this.recordingProdStack.pop(), S;
|
|
84
|
+
} catch (e) {
|
|
85
|
+
if (e.KNOWN_RECORDER_ERROR !== !0) try {
|
|
86
|
+
e.message += "\n This error was thrown during the \"grammar recording phase\" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording";
|
|
93
87
|
} catch {
|
|
94
|
-
throw
|
|
88
|
+
throw e;
|
|
95
89
|
}
|
|
96
|
-
throw
|
|
90
|
+
throw e;
|
|
97
91
|
}
|
|
98
92
|
}
|
|
99
|
-
optionInternalRecord(
|
|
100
|
-
return recordProd.call(this, Option,
|
|
93
|
+
optionInternalRecord(e, x) {
|
|
94
|
+
return recordProd.call(this, Option, e, x);
|
|
101
95
|
}
|
|
102
|
-
atLeastOneInternalRecord(
|
|
103
|
-
recordProd.call(this, RepetitionMandatory, x,
|
|
96
|
+
atLeastOneInternalRecord(e, x) {
|
|
97
|
+
recordProd.call(this, RepetitionMandatory, x, e);
|
|
104
98
|
}
|
|
105
|
-
atLeastOneSepFirstInternalRecord(
|
|
106
|
-
recordProd.call(this, RepetitionMandatoryWithSeparator, x,
|
|
99
|
+
atLeastOneSepFirstInternalRecord(e, x) {
|
|
100
|
+
recordProd.call(this, RepetitionMandatoryWithSeparator, x, e, HANDLE_SEPARATOR);
|
|
107
101
|
}
|
|
108
|
-
manyInternalRecord(
|
|
109
|
-
recordProd.call(this, Repetition, x,
|
|
102
|
+
manyInternalRecord(e, x) {
|
|
103
|
+
recordProd.call(this, Repetition, x, e);
|
|
110
104
|
}
|
|
111
|
-
manySepFirstInternalRecord(
|
|
112
|
-
recordProd.call(this, RepetitionWithSeparator, x,
|
|
105
|
+
manySepFirstInternalRecord(e, x) {
|
|
106
|
+
recordProd.call(this, RepetitionWithSeparator, x, e, HANDLE_SEPARATOR);
|
|
113
107
|
}
|
|
114
|
-
orInternalRecord(
|
|
115
|
-
return recordOrProd.call(this,
|
|
108
|
+
orInternalRecord(e, x) {
|
|
109
|
+
return recordOrProd.call(this, e, x);
|
|
116
110
|
}
|
|
117
|
-
subruleInternalRecord(
|
|
118
|
-
if (assertMethodIdxIsValid(x), !
|
|
119
|
-
let S = /* @__PURE__ */ Error(`<SUBRULE${getIdxSuffix(x)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(
|
|
111
|
+
subruleInternalRecord(e, x, C) {
|
|
112
|
+
if (assertMethodIdxIsValid(x), !e || !Object.hasOwn(e, "ruleName")) {
|
|
113
|
+
let S = /* @__PURE__ */ Error(`<SUBRULE${getIdxSuffix(x)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
|
|
120
114
|
throw S.KNOWN_RECORDER_ERROR = !0, S;
|
|
121
115
|
}
|
|
122
|
-
let
|
|
116
|
+
let w = this.recordingProdStack.at(-1), T = e.ruleName, E = new NonTerminal({
|
|
123
117
|
idx: x,
|
|
124
|
-
nonTerminalName:
|
|
118
|
+
nonTerminalName: T,
|
|
125
119
|
label: C?.LABEL,
|
|
126
120
|
referencedRule: void 0
|
|
127
121
|
});
|
|
128
|
-
return
|
|
122
|
+
return w.definition.push(E), this.outputCst ? RECORDING_PHASE_CSTNODE : RECORDING_NULL_OBJECT;
|
|
129
123
|
}
|
|
130
|
-
consumeInternalRecord(
|
|
131
|
-
if (assertMethodIdxIsValid(x), !hasShortKeyProperty(
|
|
132
|
-
let S = /* @__PURE__ */ Error(`<CONSUME${getIdxSuffix(x)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(
|
|
124
|
+
consumeInternalRecord(e, x, S) {
|
|
125
|
+
if (assertMethodIdxIsValid(x), !hasShortKeyProperty(e)) {
|
|
126
|
+
let S = /* @__PURE__ */ Error(`<CONSUME${getIdxSuffix(x)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
|
|
133
127
|
throw S.KNOWN_RECORDER_ERROR = !0, S;
|
|
134
128
|
}
|
|
135
|
-
let
|
|
129
|
+
let C = this.recordingProdStack.at(-1), w = new Terminal({
|
|
136
130
|
idx: x,
|
|
137
|
-
terminalType:
|
|
138
|
-
label:
|
|
131
|
+
terminalType: e,
|
|
132
|
+
label: S?.LABEL
|
|
139
133
|
});
|
|
140
|
-
return
|
|
134
|
+
return C.definition.push(w), RECORDING_PHASE_TOKEN;
|
|
141
135
|
}
|
|
142
136
|
};
|
|
143
|
-
function recordProd(
|
|
144
|
-
assertMethodIdxIsValid(
|
|
145
|
-
let
|
|
137
|
+
function recordProd(e, x, S, C = !1) {
|
|
138
|
+
assertMethodIdxIsValid(S);
|
|
139
|
+
let w = this.recordingProdStack.at(-1), T = typeof x == "function" ? x : x.DEF, E = new e({
|
|
146
140
|
definition: [],
|
|
147
|
-
idx:
|
|
141
|
+
idx: S
|
|
148
142
|
});
|
|
149
|
-
return
|
|
143
|
+
return C && (E.separator = x.SEP), Object.hasOwn(x, "MAX_LOOKAHEAD") && (E.maxLookahead = x.MAX_LOOKAHEAD), this.recordingProdStack.push(E), T.call(this), w.definition.push(E), this.recordingProdStack.pop(), RECORDING_NULL_OBJECT;
|
|
150
144
|
}
|
|
151
|
-
function recordOrProd(
|
|
152
|
-
assertMethodIdxIsValid(
|
|
153
|
-
let
|
|
145
|
+
function recordOrProd(S, C) {
|
|
146
|
+
assertMethodIdxIsValid(C);
|
|
147
|
+
let w = this.recordingProdStack.at(-1), T = Array.isArray(S) === !1, E = T === !1 ? S : S.DEF, D = new Alternation({
|
|
154
148
|
definition: [],
|
|
155
|
-
idx:
|
|
156
|
-
ignoreAmbiguities:
|
|
149
|
+
idx: C,
|
|
150
|
+
ignoreAmbiguities: T && S.IGNORE_AMBIGUITIES === !0
|
|
157
151
|
});
|
|
158
|
-
return
|
|
159
|
-
let
|
|
160
|
-
|
|
152
|
+
return Object.hasOwn(S, "MAX_LOOKAHEAD") && (D.maxLookahead = S.MAX_LOOKAHEAD), D.hasPredicates = E.some((e) => typeof e.GATE == "function"), w.definition.push(D), E.forEach((e) => {
|
|
153
|
+
let S = new Alternative({ definition: [] });
|
|
154
|
+
D.definition.push(S), Object.hasOwn(e, "IGNORE_AMBIGUITIES") ? S.ignoreAmbiguities = e.IGNORE_AMBIGUITIES : Object.hasOwn(e, "GATE") && (S.ignoreAmbiguities = !0), this.recordingProdStack.push(S), e.ALT.call(this), this.recordingProdStack.pop();
|
|
161
155
|
}), RECORDING_NULL_OBJECT;
|
|
162
156
|
}
|
|
163
|
-
function getIdxSuffix(
|
|
164
|
-
return
|
|
157
|
+
function getIdxSuffix(e) {
|
|
158
|
+
return e === 0 ? "" : `${e}`;
|
|
165
159
|
}
|
|
166
|
-
function assertMethodIdxIsValid(
|
|
167
|
-
if (
|
|
168
|
-
let x = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${
|
|
160
|
+
function assertMethodIdxIsValid(e) {
|
|
161
|
+
if (e < 0 || e > MAX_METHOD_IDX) {
|
|
162
|
+
let x = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${MAX_METHOD_IDX + 1}`);
|
|
169
163
|
throw x.KNOWN_RECORDER_ERROR = !0, x;
|
|
170
164
|
}
|
|
171
165
|
}
|
|
@@ -11,7 +11,11 @@ var LexerAdapter = class {
|
|
|
11
11
|
return this.tokVector;
|
|
12
12
|
}
|
|
13
13
|
SKIP_TOKEN() {
|
|
14
|
-
return this.currIdx <= this.
|
|
14
|
+
return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : END_OF_FILE;
|
|
15
|
+
}
|
|
16
|
+
LA_FAST(e) {
|
|
17
|
+
let t = this.currIdx + e;
|
|
18
|
+
return this.tokVector[t];
|
|
15
19
|
}
|
|
16
20
|
LA(t) {
|
|
17
21
|
let n = this.currIdx + t;
|
|
@@ -30,7 +34,7 @@ var LexerAdapter = class {
|
|
|
30
34
|
this.currIdx = -1;
|
|
31
35
|
}
|
|
32
36
|
moveToTerminatedState() {
|
|
33
|
-
this.currIdx = this.
|
|
37
|
+
this.currIdx = this.tokVectorLength - 1;
|
|
34
38
|
}
|
|
35
39
|
getLexerPosition() {
|
|
36
40
|
return this.exportLexerState();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import forEach_default from "../../../../../../lodash-es/forEach.js";
|
|
2
|
-
import has_default from "../../../../../../lodash-es/has.js";
|
|
3
1
|
import { GAstVisitor } from "../../../../../../@chevrotain/gast/lib/src/visitor.js";
|
|
4
2
|
import { getProductionDslName } from "../../../../../../@chevrotain/gast/lib/src/helpers.js";
|
|
5
3
|
import { AT_LEAST_ONE_IDX, AT_LEAST_ONE_SEP_IDX, MANY_IDX, MANY_SEP_IDX, OPTION_IDX, OR_IDX, getKeyForAutomaticLookahead } from "../../grammar/keys.js";
|
|
@@ -7,59 +5,59 @@ import { LLkLookaheadStrategy } from "../../grammar/llk_lookahead.js";
|
|
|
7
5
|
import { DEFAULT_PARSER_CONFIG } from "../parser.js";
|
|
8
6
|
var LooksAhead = class {
|
|
9
7
|
initLooksAhead(e) {
|
|
10
|
-
this.dynamicTokensEnabled =
|
|
8
|
+
this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
|
|
11
9
|
}
|
|
12
|
-
preComputeLookaheadFunctions(
|
|
13
|
-
|
|
14
|
-
this.TRACE_INIT(`${
|
|
15
|
-
let { alternation: s, repetition:
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
this.TRACE_INIT(`${getProductionDslName(
|
|
19
|
-
let
|
|
20
|
-
prodOccurrence:
|
|
21
|
-
rule:
|
|
22
|
-
maxLookahead:
|
|
23
|
-
hasPredicates:
|
|
10
|
+
preComputeLookaheadFunctions(e) {
|
|
11
|
+
e.forEach((e) => {
|
|
12
|
+
this.TRACE_INIT(`${e.name} Rule Lookahead`, () => {
|
|
13
|
+
let { alternation: s, repetition: l, option: u, repetitionMandatory: d, repetitionMandatoryWithSeparator: f, repetitionWithSeparator: p } = collectMethods(e);
|
|
14
|
+
s.forEach((a) => {
|
|
15
|
+
let o = a.idx === 0 ? "" : a.idx;
|
|
16
|
+
this.TRACE_INIT(`${getProductionDslName(a)}${o}`, () => {
|
|
17
|
+
let i = this.lookaheadStrategy.buildLookaheadForAlternation({
|
|
18
|
+
prodOccurrence: a.idx,
|
|
19
|
+
rule: e,
|
|
20
|
+
maxLookahead: a.maxLookahead || this.maxLookahead,
|
|
21
|
+
hasPredicates: a.hasPredicates,
|
|
24
22
|
dynamicTokensEnabled: this.dynamicTokensEnabled
|
|
25
|
-
}),
|
|
26
|
-
this.setLaFuncCache(
|
|
23
|
+
}), o = getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name], 256, a.idx);
|
|
24
|
+
this.setLaFuncCache(o, i);
|
|
27
25
|
});
|
|
28
|
-
}),
|
|
29
|
-
this.computeLookaheadFunc(
|
|
30
|
-
}),
|
|
31
|
-
this.computeLookaheadFunc(
|
|
32
|
-
}),
|
|
33
|
-
this.computeLookaheadFunc(
|
|
34
|
-
}),
|
|
35
|
-
this.computeLookaheadFunc(
|
|
36
|
-
}),
|
|
37
|
-
this.computeLookaheadFunc(
|
|
26
|
+
}), l.forEach((a) => {
|
|
27
|
+
this.computeLookaheadFunc(e, a.idx, 768, "Repetition", a.maxLookahead, getProductionDslName(a));
|
|
28
|
+
}), u.forEach((a) => {
|
|
29
|
+
this.computeLookaheadFunc(e, a.idx, 512, "Option", a.maxLookahead, getProductionDslName(a));
|
|
30
|
+
}), d.forEach((o) => {
|
|
31
|
+
this.computeLookaheadFunc(e, o.idx, AT_LEAST_ONE_IDX, "RepetitionMandatory", o.maxLookahead, getProductionDslName(o));
|
|
32
|
+
}), f.forEach((a) => {
|
|
33
|
+
this.computeLookaheadFunc(e, a.idx, AT_LEAST_ONE_SEP_IDX, "RepetitionMandatoryWithSeparator", a.maxLookahead, getProductionDslName(a));
|
|
34
|
+
}), p.forEach((a) => {
|
|
35
|
+
this.computeLookaheadFunc(e, a.idx, MANY_SEP_IDX, "RepetitionWithSeparator", a.maxLookahead, getProductionDslName(a));
|
|
38
36
|
});
|
|
39
37
|
});
|
|
40
38
|
});
|
|
41
39
|
}
|
|
42
|
-
computeLookaheadFunc(e,
|
|
43
|
-
this.TRACE_INIT(`${
|
|
44
|
-
let
|
|
45
|
-
prodOccurrence:
|
|
40
|
+
computeLookaheadFunc(e, i, a, o, s, c) {
|
|
41
|
+
this.TRACE_INIT(`${c}${i === 0 ? "" : i}`, () => {
|
|
42
|
+
let c = this.lookaheadStrategy.buildLookaheadForOptional({
|
|
43
|
+
prodOccurrence: i,
|
|
46
44
|
rule: e,
|
|
47
|
-
maxLookahead:
|
|
45
|
+
maxLookahead: s || this.maxLookahead,
|
|
48
46
|
dynamicTokensEnabled: this.dynamicTokensEnabled,
|
|
49
|
-
prodType:
|
|
50
|
-
}),
|
|
51
|
-
this.setLaFuncCache(
|
|
47
|
+
prodType: o
|
|
48
|
+
}), l = getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name], a, i);
|
|
49
|
+
this.setLaFuncCache(l, c);
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
|
-
getKeyForAutomaticLookahead(e,
|
|
55
|
-
return getKeyForAutomaticLookahead(this.
|
|
52
|
+
getKeyForAutomaticLookahead(e, i) {
|
|
53
|
+
return getKeyForAutomaticLookahead(this.currRuleShortName, e, i);
|
|
56
54
|
}
|
|
57
55
|
getLaFuncFromCache(e) {
|
|
58
56
|
return this.lookAheadFuncsCache.get(e);
|
|
59
57
|
}
|
|
60
58
|
/* istanbul ignore next */
|
|
61
|
-
setLaFuncCache(e,
|
|
62
|
-
this.lookAheadFuncsCache.set(e,
|
|
59
|
+
setLaFuncCache(e, i) {
|
|
60
|
+
this.lookAheadFuncsCache.set(e, i);
|
|
63
61
|
}
|
|
64
62
|
}, collectorVisitor = new class extends GAstVisitor {
|
|
65
63
|
constructor() {
|
|
@@ -103,7 +101,7 @@ var LooksAhead = class {
|
|
|
103
101
|
}();
|
|
104
102
|
function collectMethods(e) {
|
|
105
103
|
collectorVisitor.reset(), e.accept(collectorVisitor);
|
|
106
|
-
let
|
|
107
|
-
return collectorVisitor.reset(),
|
|
104
|
+
let i = collectorVisitor.dslMethods;
|
|
105
|
+
return collectorVisitor.reset(), i;
|
|
108
106
|
}
|
|
109
107
|
export { LooksAhead };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import has_default from "../../../../../../lodash-es/has.js";
|
|
2
1
|
import { timer } from "../../../../../../@chevrotain/utils/lib/src/timer.js";
|
|
3
2
|
import { DEFAULT_PARSER_CONFIG } from "../parser.js";
|
|
4
3
|
var PerformanceTracer = class {
|
|
5
|
-
initPerformanceTracer(
|
|
6
|
-
if (
|
|
7
|
-
let
|
|
8
|
-
this.traceInitMaxIdent = n ?
|
|
4
|
+
initPerformanceTracer(e) {
|
|
5
|
+
if (Object.hasOwn(e, "traceInitPerf")) {
|
|
6
|
+
let t = e.traceInitPerf, n = typeof t == "number";
|
|
7
|
+
this.traceInitMaxIdent = n ? t : Infinity, this.traceInitPerf = n ? t > 0 : t;
|
|
9
8
|
} else this.traceInitMaxIdent = 0, this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf;
|
|
10
9
|
this.traceInitIndent = -1;
|
|
11
10
|
}
|
|
12
|
-
TRACE_INIT(
|
|
11
|
+
TRACE_INIT(t, n) {
|
|
13
12
|
if (this.traceInitPerf === !0) {
|
|
14
13
|
this.traceInitIndent++;
|
|
15
14
|
let r = Array(this.traceInitIndent + 1).join(" ");
|
|
16
|
-
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${
|
|
15
|
+
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${t}>`);
|
|
17
16
|
let { time: i, value: a } = timer(n), o = i > 10 ? console.warn : console.log;
|
|
18
|
-
return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${
|
|
17
|
+
return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${t}> time: ${i}ms`), this.traceInitIndent--, a;
|
|
19
18
|
} else return n();
|
|
20
19
|
}
|
|
21
20
|
};
|