@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,248 +1,241 @@
|
|
|
1
|
-
import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
|
|
2
|
-
import flatten_default from "../../../../../lodash-es/flatten.js";
|
|
3
|
-
import forEach_default from "../../../../../lodash-es/forEach.js";
|
|
4
|
-
import every_default from "../../../../../lodash-es/every.js";
|
|
5
|
-
import map_default from "../../../../../lodash-es/map.js";
|
|
6
|
-
import has_default from "../../../../../lodash-es/has.js";
|
|
7
|
-
import reduce_default from "../../../../../lodash-es/reduce.js";
|
|
8
1
|
import { Alternation, Alternative, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator } from "../../../../../@chevrotain/gast/lib/src/model.js";
|
|
9
2
|
import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
|
|
10
3
|
import { RestWalker } from "./rest.js";
|
|
11
4
|
import { tokenStructuredMatcher, tokenStructuredMatcherNoCategories } from "../../scan/tokens.js";
|
|
12
5
|
import { possiblePathsFrom } from "./interpreter.js";
|
|
13
6
|
var PROD_TYPE;
|
|
14
|
-
(function(
|
|
15
|
-
|
|
7
|
+
(function(e) {
|
|
8
|
+
e[e.OPTION = 0] = "OPTION", e[e.REPETITION = 1] = "REPETITION", e[e.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", e[e.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", e[e.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", e[e.ALTERNATION = 5] = "ALTERNATION";
|
|
16
9
|
})(PROD_TYPE ||= {});
|
|
17
|
-
function getProdType(
|
|
10
|
+
function getProdType(b) {
|
|
18
11
|
/* istanbul ignore else */
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
if (
|
|
24
|
-
if (
|
|
12
|
+
if (b instanceof Option || b === "Option") return PROD_TYPE.OPTION;
|
|
13
|
+
if (b instanceof Repetition || b === "Repetition") return PROD_TYPE.REPETITION;
|
|
14
|
+
if (b instanceof RepetitionMandatory || b === "RepetitionMandatory") return PROD_TYPE.REPETITION_MANDATORY;
|
|
15
|
+
if (b instanceof RepetitionMandatoryWithSeparator || b === "RepetitionMandatoryWithSeparator") return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR;
|
|
16
|
+
if (b instanceof RepetitionWithSeparator || b === "RepetitionWithSeparator") return PROD_TYPE.REPETITION_WITH_SEPARATOR;
|
|
17
|
+
if (b instanceof Alternation || b === "Alternation") return PROD_TYPE.ALTERNATION;
|
|
25
18
|
throw Error("non exhaustive match");
|
|
26
19
|
}
|
|
27
|
-
function getLookaheadPaths(
|
|
28
|
-
let { occurrence:
|
|
29
|
-
return
|
|
20
|
+
function getLookaheadPaths(e) {
|
|
21
|
+
let { occurrence: b, rule: x, prodType: S, maxLookahead: C } = e, w = getProdType(S);
|
|
22
|
+
return w === PROD_TYPE.ALTERNATION ? getLookaheadPathsForOr(b, x, C) : getLookaheadPathsForOptionalProd(b, x, w, C);
|
|
30
23
|
}
|
|
31
|
-
function buildLookaheadFuncForOr(
|
|
32
|
-
let
|
|
33
|
-
return
|
|
24
|
+
function buildLookaheadFuncForOr(e, b, x, S, C, w) {
|
|
25
|
+
let T = getLookaheadPathsForOr(e, b, x);
|
|
26
|
+
return w(T, S, areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, C);
|
|
34
27
|
}
|
|
35
|
-
function buildLookaheadFuncForOptionalProd(
|
|
36
|
-
let
|
|
37
|
-
return
|
|
28
|
+
function buildLookaheadFuncForOptionalProd(e, b, x, S, C, w) {
|
|
29
|
+
let T = getLookaheadPathsForOptionalProd(e, b, C, x), E = areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
|
|
30
|
+
return w(T[0], E, S);
|
|
38
31
|
}
|
|
39
|
-
function buildAlternativesLookAheadFunc(
|
|
40
|
-
let
|
|
41
|
-
if (
|
|
42
|
-
let
|
|
43
|
-
for (let
|
|
44
|
-
let
|
|
45
|
-
if (!(
|
|
46
|
-
let
|
|
47
|
-
for (let
|
|
48
|
-
return
|
|
32
|
+
function buildAlternativesLookAheadFunc(e, b, x, S) {
|
|
33
|
+
let C = e.length, w = e.every((e) => e.every((e) => e.length === 1));
|
|
34
|
+
if (b) return function(b) {
|
|
35
|
+
let S = b.map((e) => e.GATE);
|
|
36
|
+
for (let b = 0; b < C; b++) {
|
|
37
|
+
let C = e[b], w = C.length, T = S[b];
|
|
38
|
+
if (!(T !== void 0 && T.call(this) === !1)) nextPath: for (let e = 0; e < w; e++) {
|
|
39
|
+
let S = C[e], w = S.length;
|
|
40
|
+
for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
|
|
41
|
+
return b;
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
44
|
};
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
if (w && !S) {
|
|
46
|
+
let b = e.map((e) => e.flat()).reduce((e, b, x) => (b.forEach((b) => {
|
|
47
|
+
b.tokenTypeIdx in e || (e[b.tokenTypeIdx] = x), b.categoryMatches.forEach((b) => {
|
|
48
|
+
Object.hasOwn(e, b) || (e[b] = x);
|
|
56
49
|
});
|
|
57
|
-
}),
|
|
50
|
+
}), e), {});
|
|
58
51
|
return function() {
|
|
59
|
-
return
|
|
52
|
+
return b[this.LA_FAST(1).tokenTypeIdx];
|
|
60
53
|
};
|
|
61
54
|
} else return function() {
|
|
62
|
-
for (let
|
|
63
|
-
let
|
|
64
|
-
nextPath: for (let
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
return
|
|
55
|
+
for (let b = 0; b < C; b++) {
|
|
56
|
+
let S = e[b], C = S.length;
|
|
57
|
+
nextPath: for (let e = 0; e < C; e++) {
|
|
58
|
+
let C = S[e], w = C.length;
|
|
59
|
+
for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), C[e]) === !1) continue nextPath;
|
|
60
|
+
return b;
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
63
|
};
|
|
71
64
|
}
|
|
72
|
-
function buildSingleAlternativeLookaheadFunction(
|
|
73
|
-
let
|
|
74
|
-
if (
|
|
75
|
-
let
|
|
76
|
-
if (
|
|
77
|
-
let
|
|
65
|
+
function buildSingleAlternativeLookaheadFunction(e, b, x) {
|
|
66
|
+
let S = e.every((e) => e.length === 1), C = e.length;
|
|
67
|
+
if (S && !x) {
|
|
68
|
+
let b = e.flat();
|
|
69
|
+
if (b.length === 1 && b[0].categoryMatches.length === 0) {
|
|
70
|
+
let e = b[0].tokenTypeIdx;
|
|
78
71
|
return function() {
|
|
79
|
-
return this.
|
|
72
|
+
return this.LA_FAST(1).tokenTypeIdx === e;
|
|
80
73
|
};
|
|
81
74
|
} else {
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
}),
|
|
75
|
+
let e = b.reduce((e, b, x) => (e[b.tokenTypeIdx] = !0, b.categoryMatches.forEach((b) => {
|
|
76
|
+
e[b] = !0;
|
|
77
|
+
}), e), []);
|
|
85
78
|
return function() {
|
|
86
|
-
return
|
|
79
|
+
return e[this.LA_FAST(1).tokenTypeIdx] === !0;
|
|
87
80
|
};
|
|
88
81
|
}
|
|
89
82
|
} else return function() {
|
|
90
|
-
nextPath: for (let
|
|
91
|
-
let
|
|
92
|
-
for (let
|
|
83
|
+
nextPath: for (let x = 0; x < C; x++) {
|
|
84
|
+
let S = e[x], C = S.length;
|
|
85
|
+
for (let e = 0; e < C; e++) if (b(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
|
|
93
86
|
return !0;
|
|
94
87
|
}
|
|
95
88
|
return !1;
|
|
96
89
|
};
|
|
97
90
|
}
|
|
98
91
|
var RestDefinitionFinderWalker = class extends RestWalker {
|
|
99
|
-
constructor(
|
|
100
|
-
super(), this.topProd =
|
|
92
|
+
constructor(e, b, x) {
|
|
93
|
+
super(), this.topProd = e, this.targetOccurrence = b, this.targetProdType = x;
|
|
101
94
|
}
|
|
102
95
|
startWalking() {
|
|
103
96
|
return this.walk(this.topProd), this.restDef;
|
|
104
97
|
}
|
|
105
|
-
checkIsTarget(
|
|
106
|
-
return
|
|
98
|
+
checkIsTarget(e, b, x, S) {
|
|
99
|
+
return e.idx === this.targetOccurrence && this.targetProdType === b ? (this.restDef = x.concat(S), !0) : !1;
|
|
107
100
|
}
|
|
108
|
-
walkOption(
|
|
109
|
-
this.checkIsTarget(
|
|
101
|
+
walkOption(e, b, x) {
|
|
102
|
+
this.checkIsTarget(e, PROD_TYPE.OPTION, b, x) || super.walkOption(e, b, x);
|
|
110
103
|
}
|
|
111
|
-
walkAtLeastOne(
|
|
112
|
-
this.checkIsTarget(
|
|
104
|
+
walkAtLeastOne(e, b, x) {
|
|
105
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY, b, x) || super.walkOption(e, b, x);
|
|
113
106
|
}
|
|
114
|
-
walkAtLeastOneSep(
|
|
115
|
-
this.checkIsTarget(
|
|
107
|
+
walkAtLeastOneSep(e, b, x) {
|
|
108
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
|
|
116
109
|
}
|
|
117
|
-
walkMany(
|
|
118
|
-
this.checkIsTarget(
|
|
110
|
+
walkMany(e, b, x) {
|
|
111
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION, b, x) || super.walkOption(e, b, x);
|
|
119
112
|
}
|
|
120
|
-
walkManySep(
|
|
121
|
-
this.checkIsTarget(
|
|
113
|
+
walkManySep(e, b, x) {
|
|
114
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
|
|
122
115
|
}
|
|
123
116
|
}, InsideDefinitionFinderVisitor = class extends GAstVisitor {
|
|
124
|
-
constructor(
|
|
125
|
-
super(), this.targetOccurrence =
|
|
117
|
+
constructor(e, b, x) {
|
|
118
|
+
super(), this.targetOccurrence = e, this.targetProdType = b, this.targetRef = x, this.result = [];
|
|
126
119
|
}
|
|
127
|
-
checkIsTarget(
|
|
128
|
-
|
|
120
|
+
checkIsTarget(e, b) {
|
|
121
|
+
e.idx === this.targetOccurrence && this.targetProdType === b && (this.targetRef === void 0 || e === this.targetRef) && (this.result = e.definition);
|
|
129
122
|
}
|
|
130
|
-
visitOption(
|
|
131
|
-
this.checkIsTarget(
|
|
123
|
+
visitOption(e) {
|
|
124
|
+
this.checkIsTarget(e, PROD_TYPE.OPTION);
|
|
132
125
|
}
|
|
133
|
-
visitRepetition(
|
|
134
|
-
this.checkIsTarget(
|
|
126
|
+
visitRepetition(e) {
|
|
127
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION);
|
|
135
128
|
}
|
|
136
|
-
visitRepetitionMandatory(
|
|
137
|
-
this.checkIsTarget(
|
|
129
|
+
visitRepetitionMandatory(e) {
|
|
130
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY);
|
|
138
131
|
}
|
|
139
|
-
visitRepetitionMandatoryWithSeparator(
|
|
140
|
-
this.checkIsTarget(
|
|
132
|
+
visitRepetitionMandatoryWithSeparator(e) {
|
|
133
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR);
|
|
141
134
|
}
|
|
142
|
-
visitRepetitionWithSeparator(
|
|
143
|
-
this.checkIsTarget(
|
|
135
|
+
visitRepetitionWithSeparator(e) {
|
|
136
|
+
this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR);
|
|
144
137
|
}
|
|
145
|
-
visitAlternation(
|
|
146
|
-
this.checkIsTarget(
|
|
138
|
+
visitAlternation(e) {
|
|
139
|
+
this.checkIsTarget(e, PROD_TYPE.ALTERNATION);
|
|
147
140
|
}
|
|
148
141
|
};
|
|
149
|
-
function initializeArrayOfArrays(
|
|
150
|
-
let
|
|
151
|
-
for (let
|
|
152
|
-
return
|
|
142
|
+
function initializeArrayOfArrays(e) {
|
|
143
|
+
let b = Array(e);
|
|
144
|
+
for (let x = 0; x < e; x++) b[x] = [];
|
|
145
|
+
return b;
|
|
153
146
|
}
|
|
154
|
-
function pathToHashKeys(
|
|
155
|
-
let
|
|
156
|
-
for (let
|
|
157
|
-
let
|
|
158
|
-
for (let
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
for (let
|
|
162
|
-
let
|
|
163
|
-
|
|
147
|
+
function pathToHashKeys(e) {
|
|
148
|
+
let b = [""];
|
|
149
|
+
for (let x = 0; x < e.length; x++) {
|
|
150
|
+
let S = e[x], C = [];
|
|
151
|
+
for (let e = 0; e < b.length; e++) {
|
|
152
|
+
let x = b[e];
|
|
153
|
+
C.push(x + "_" + S.tokenTypeIdx);
|
|
154
|
+
for (let e = 0; e < S.categoryMatches.length; e++) {
|
|
155
|
+
let b = "_" + S.categoryMatches[e];
|
|
156
|
+
C.push(x + b);
|
|
164
157
|
}
|
|
165
158
|
}
|
|
166
|
-
|
|
159
|
+
b = C;
|
|
167
160
|
}
|
|
168
|
-
return
|
|
161
|
+
return b;
|
|
169
162
|
}
|
|
170
|
-
function isUniquePrefixHash(
|
|
171
|
-
for (let
|
|
172
|
-
if (
|
|
173
|
-
let
|
|
174
|
-
for (let
|
|
163
|
+
function isUniquePrefixHash(e, b, x) {
|
|
164
|
+
for (let S = 0; S < e.length; S++) {
|
|
165
|
+
if (S === x) continue;
|
|
166
|
+
let C = e[S];
|
|
167
|
+
for (let e = 0; e < b.length; e++) if (C[b[e]] === !0) return !1;
|
|
175
168
|
}
|
|
176
169
|
return !0;
|
|
177
170
|
}
|
|
178
|
-
function lookAheadSequenceFromAlternatives(
|
|
179
|
-
let
|
|
180
|
-
let
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
function lookAheadSequenceFromAlternatives(e, b) {
|
|
172
|
+
let x = e.map((e) => possiblePathsFrom([e], 1)), S = initializeArrayOfArrays(x.length), C = x.map((e) => {
|
|
173
|
+
let b = {};
|
|
174
|
+
return e.forEach((e) => {
|
|
175
|
+
pathToHashKeys(e.partialPath).forEach((e) => {
|
|
176
|
+
b[e] = !0;
|
|
184
177
|
});
|
|
185
|
-
}),
|
|
186
|
-
}),
|
|
187
|
-
for (let
|
|
188
|
-
let
|
|
189
|
-
|
|
190
|
-
for (let
|
|
191
|
-
let
|
|
192
|
-
for (let
|
|
193
|
-
let
|
|
194
|
-
if (isUniquePrefixHash(
|
|
195
|
-
let
|
|
196
|
-
if (containsPath(
|
|
197
|
-
|
|
198
|
-
for (let
|
|
199
|
-
let
|
|
200
|
-
|
|
178
|
+
}), b;
|
|
179
|
+
}), w = x;
|
|
180
|
+
for (let e = 1; e <= b; e++) {
|
|
181
|
+
let x = w;
|
|
182
|
+
w = initializeArrayOfArrays(x.length);
|
|
183
|
+
for (let T = 0; T < x.length; T++) {
|
|
184
|
+
let E = x[T];
|
|
185
|
+
for (let x = 0; x < E.length; x++) {
|
|
186
|
+
let D = E[x].partialPath, O = E[x].suffixDef, k = pathToHashKeys(D);
|
|
187
|
+
if (isUniquePrefixHash(C, k, T) || O.length === 0 || D.length === b) {
|
|
188
|
+
let e = S[T];
|
|
189
|
+
if (containsPath(e, D) === !1) {
|
|
190
|
+
e.push(D);
|
|
191
|
+
for (let e = 0; e < k.length; e++) {
|
|
192
|
+
let b = k[e];
|
|
193
|
+
C[T][b] = !0;
|
|
201
194
|
}
|
|
202
195
|
}
|
|
203
196
|
} else {
|
|
204
|
-
let
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
197
|
+
let b = possiblePathsFrom(O, e + 1, D);
|
|
198
|
+
w[T] = w[T].concat(b), b.forEach((e) => {
|
|
199
|
+
pathToHashKeys(e.partialPath).forEach((e) => {
|
|
200
|
+
C[T][e] = !0;
|
|
208
201
|
});
|
|
209
202
|
});
|
|
210
203
|
}
|
|
211
204
|
}
|
|
212
205
|
}
|
|
213
206
|
}
|
|
214
|
-
return
|
|
207
|
+
return S;
|
|
215
208
|
}
|
|
216
|
-
function getLookaheadPathsForOr(
|
|
217
|
-
let
|
|
218
|
-
return
|
|
209
|
+
function getLookaheadPathsForOr(e, b, x, S) {
|
|
210
|
+
let C = new InsideDefinitionFinderVisitor(e, PROD_TYPE.ALTERNATION, S);
|
|
211
|
+
return b.accept(C), lookAheadSequenceFromAlternatives(C.result, x);
|
|
219
212
|
}
|
|
220
|
-
function getLookaheadPathsForOptionalProd(
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
let
|
|
224
|
-
return lookAheadSequenceFromAlternatives([new Alternative({ definition:
|
|
213
|
+
function getLookaheadPathsForOptionalProd(e, x, S, C) {
|
|
214
|
+
let w = new InsideDefinitionFinderVisitor(e, S);
|
|
215
|
+
x.accept(w);
|
|
216
|
+
let T = w.result, E = new RestDefinitionFinderWalker(x, e, S).startWalking();
|
|
217
|
+
return lookAheadSequenceFromAlternatives([new Alternative({ definition: T }), new Alternative({ definition: E })], C);
|
|
225
218
|
}
|
|
226
|
-
function containsPath(
|
|
227
|
-
compareOtherPath: for (let
|
|
228
|
-
let
|
|
229
|
-
if (
|
|
230
|
-
for (let
|
|
231
|
-
let
|
|
232
|
-
if (!(
|
|
219
|
+
function containsPath(e, b) {
|
|
220
|
+
compareOtherPath: for (let x = 0; x < e.length; x++) {
|
|
221
|
+
let S = e[x];
|
|
222
|
+
if (S.length === b.length) {
|
|
223
|
+
for (let e = 0; e < S.length; e++) {
|
|
224
|
+
let x = b[e], C = S[e];
|
|
225
|
+
if (!(x === C || C.categoryMatchesMap[x.tokenTypeIdx] !== void 0)) continue compareOtherPath;
|
|
233
226
|
}
|
|
234
227
|
return !0;
|
|
235
228
|
}
|
|
236
229
|
}
|
|
237
230
|
return !1;
|
|
238
231
|
}
|
|
239
|
-
function isStrictPrefixOfPath(
|
|
240
|
-
return
|
|
241
|
-
let
|
|
242
|
-
return
|
|
232
|
+
function isStrictPrefixOfPath(e, b) {
|
|
233
|
+
return e.length < b.length && e.every((e, x) => {
|
|
234
|
+
let S = b[x];
|
|
235
|
+
return e === S || S.categoryMatchesMap[e.tokenTypeIdx];
|
|
243
236
|
});
|
|
244
237
|
}
|
|
245
|
-
function areTokenCategoriesNotUsed(
|
|
246
|
-
return
|
|
238
|
+
function areTokenCategoriesNotUsed(e) {
|
|
239
|
+
return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
|
|
247
240
|
}
|
|
248
241
|
export { PROD_TYPE, buildAlternativesLookAheadFunc, buildLookaheadFuncForOptionalProd, buildLookaheadFuncForOr, buildSingleAlternativeLookaheadFunction, containsPath, getLookaheadPaths, getLookaheadPathsForOptionalProd, getLookaheadPathsForOr, getProdType, isStrictPrefixOfPath };
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import forEach_default from "../../../../../lodash-es/forEach.js";
|
|
2
|
-
import values_default from "../../../../../lodash-es/values.js";
|
|
3
1
|
import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
|
|
4
2
|
import { ParserDefinitionErrorType } from "../parser/parser.js";
|
|
5
|
-
function resolveGrammar(e,
|
|
6
|
-
let
|
|
7
|
-
return
|
|
3
|
+
function resolveGrammar(e, n) {
|
|
4
|
+
let r = new GastRefResolverVisitor(e, n);
|
|
5
|
+
return r.resolveRefs(), r.errors;
|
|
8
6
|
}
|
|
9
7
|
var GastRefResolverVisitor = class extends GAstVisitor {
|
|
10
|
-
constructor(e,
|
|
11
|
-
super(), this.nameToTopRule = e, this.errMsgProvider =
|
|
8
|
+
constructor(e, n) {
|
|
9
|
+
super(), this.nameToTopRule = e, this.errMsgProvider = n, this.errors = [];
|
|
12
10
|
}
|
|
13
11
|
resolveRefs() {
|
|
14
|
-
|
|
12
|
+
Object.values(this.nameToTopRule).forEach((e) => {
|
|
15
13
|
this.currTopLevel = e, e.accept(this);
|
|
16
14
|
});
|
|
17
15
|
}
|
|
18
16
|
visitNonTerminal(e) {
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
17
|
+
let r = this.nameToTopRule[e.nonTerminalName];
|
|
18
|
+
if (r) e.referencedRule = r;
|
|
21
19
|
else {
|
|
22
|
-
let
|
|
20
|
+
let r = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, e);
|
|
23
21
|
this.errors.push({
|
|
24
|
-
message:
|
|
22
|
+
message: r,
|
|
25
23
|
type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,
|
|
26
24
|
ruleName: this.currTopLevel.name,
|
|
27
25
|
unresolvedRefName: e.nonTerminalName
|
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
import drop_default from "../../../../../lodash-es/drop.js";
|
|
2
|
-
import forEach_default from "../../../../../lodash-es/forEach.js";
|
|
3
1
|
import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
|
|
4
2
|
var RestWalker = class {
|
|
5
|
-
walk(
|
|
6
|
-
|
|
7
|
-
let
|
|
3
|
+
walk(l, u = []) {
|
|
4
|
+
l.definition.forEach((d, f) => {
|
|
5
|
+
let p = l.definition.slice(f + 1);
|
|
8
6
|
/* istanbul ignore else */
|
|
9
|
-
if (
|
|
10
|
-
else if (
|
|
11
|
-
else if (
|
|
12
|
-
else if (
|
|
13
|
-
else if (
|
|
14
|
-
else if (
|
|
15
|
-
else if (
|
|
16
|
-
else if (
|
|
17
|
-
else if (
|
|
7
|
+
if (d instanceof NonTerminal) this.walkProdRef(d, p, u);
|
|
8
|
+
else if (d instanceof Terminal) this.walkTerminal(d, p, u);
|
|
9
|
+
else if (d instanceof Alternative) this.walkFlat(d, p, u);
|
|
10
|
+
else if (d instanceof Option) this.walkOption(d, p, u);
|
|
11
|
+
else if (d instanceof RepetitionMandatory) this.walkAtLeastOne(d, p, u);
|
|
12
|
+
else if (d instanceof RepetitionMandatoryWithSeparator) this.walkAtLeastOneSep(d, p, u);
|
|
13
|
+
else if (d instanceof RepetitionWithSeparator) this.walkManySep(d, p, u);
|
|
14
|
+
else if (d instanceof Repetition) this.walkMany(d, p, u);
|
|
15
|
+
else if (d instanceof Alternation) this.walkOr(d, p, u);
|
|
18
16
|
else throw Error("non exhaustive match");
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
|
-
walkTerminal(e,
|
|
22
|
-
walkProdRef(e,
|
|
23
|
-
walkFlat(e,
|
|
24
|
-
let
|
|
25
|
-
this.walk(e,
|
|
19
|
+
walkTerminal(e, a, o) {}
|
|
20
|
+
walkProdRef(e, a, o) {}
|
|
21
|
+
walkFlat(e, a, o) {
|
|
22
|
+
let s = a.concat(o);
|
|
23
|
+
this.walk(e, s);
|
|
26
24
|
}
|
|
27
|
-
walkOption(e,
|
|
28
|
-
let
|
|
29
|
-
this.walk(e,
|
|
25
|
+
walkOption(e, a, o) {
|
|
26
|
+
let s = a.concat(o);
|
|
27
|
+
this.walk(e, s);
|
|
30
28
|
}
|
|
31
|
-
walkAtLeastOne(e,
|
|
32
|
-
let c = [new Option({ definition: e.definition })].concat(
|
|
29
|
+
walkAtLeastOne(e, a, o) {
|
|
30
|
+
let c = [new Option({ definition: e.definition })].concat(a, o);
|
|
33
31
|
this.walk(e, c);
|
|
34
32
|
}
|
|
35
|
-
walkAtLeastOneSep(e,
|
|
36
|
-
let
|
|
37
|
-
this.walk(e,
|
|
33
|
+
walkAtLeastOneSep(e, a, o) {
|
|
34
|
+
let s = restForRepetitionWithSeparator(e, a, o);
|
|
35
|
+
this.walk(e, s);
|
|
38
36
|
}
|
|
39
|
-
walkMany(e,
|
|
40
|
-
let c = [new Option({ definition: e.definition })].concat(
|
|
37
|
+
walkMany(e, a, o) {
|
|
38
|
+
let c = [new Option({ definition: e.definition })].concat(a, o);
|
|
41
39
|
this.walk(e, c);
|
|
42
40
|
}
|
|
43
|
-
walkManySep(e,
|
|
44
|
-
let
|
|
45
|
-
this.walk(e,
|
|
41
|
+
walkManySep(e, a, o) {
|
|
42
|
+
let s = restForRepetitionWithSeparator(e, a, o);
|
|
43
|
+
this.walk(e, s);
|
|
46
44
|
}
|
|
47
|
-
walkOr(e,
|
|
48
|
-
let
|
|
49
|
-
|
|
45
|
+
walkOr(e, o, s) {
|
|
46
|
+
let c = o.concat(s);
|
|
47
|
+
e.definition.forEach((e) => {
|
|
50
48
|
let o = new Alternative({ definition: [e] });
|
|
51
|
-
this.walk(o,
|
|
49
|
+
this.walk(o, c);
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
52
|
};
|
|
55
|
-
function restForRepetitionWithSeparator(e,
|
|
56
|
-
return [new Option({ definition: [new Terminal({ terminalType: e.separator })].concat(e.definition) })].concat(
|
|
53
|
+
function restForRepetitionWithSeparator(e, a, o) {
|
|
54
|
+
return [new Option({ definition: [new Terminal({ terminalType: e.separator })].concat(e.definition) })].concat(a, o);
|
|
57
55
|
}
|
|
58
56
|
export { RestWalker };
|