@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,16 +1,3 @@
|
|
|
1
|
-
import isArray_default from "../../../../lodash-es/isArray.js";
|
|
2
|
-
import identity_default from "../../../../lodash-es/identity.js";
|
|
3
|
-
import isEmpty_default from "../../../../lodash-es/isEmpty.js";
|
|
4
|
-
import noop_default from "../../../../lodash-es/noop.js";
|
|
5
|
-
import keys_default from "../../../../lodash-es/keys.js";
|
|
6
|
-
import assign_default from "../../../../lodash-es/assign.js";
|
|
7
|
-
import clone_default from "../../../../lodash-es/clone.js";
|
|
8
|
-
import last_default from "../../../../lodash-es/last.js";
|
|
9
|
-
import forEach_default from "../../../../lodash-es/forEach.js";
|
|
10
|
-
import map_default from "../../../../lodash-es/map.js";
|
|
11
|
-
import isUndefined_default from "../../../../lodash-es/isUndefined.js";
|
|
12
|
-
import reduce_default from "../../../../lodash-es/reduce.js";
|
|
13
|
-
import reject_default from "../../../../lodash-es/reject.js";
|
|
14
1
|
import { PRINT_WARNING } from "../../../../@chevrotain/utils/lib/src/print.js";
|
|
15
2
|
import { timer } from "../../../../@chevrotain/utils/lib/src/timer.js";
|
|
16
3
|
import { toFastProperties } from "../../../../@chevrotain/utils/lib/src/to-fast-properties.js";
|
|
@@ -36,69 +23,69 @@ var DEFAULT_LEXER_CONFIG = {
|
|
|
36
23
|
};
|
|
37
24
|
Object.freeze(DEFAULT_LEXER_CONFIG);
|
|
38
25
|
var Lexer = class {
|
|
39
|
-
constructor(s,
|
|
40
|
-
if (this.lexerDefinition = s, this.lexerDefinitionErrors = [], this.lexerDefinitionWarning = [], this.patternIdxToConfig = {}, this.charCodeToPatternIdxToConfig = {}, this.modes = [], this.emptyGroups = {}, this.trackStartLines = !0, this.trackEndLines = !0, this.hasCustom = !1, this.canModeBeOptimized = {}, this.TRACE_INIT = (e,
|
|
26
|
+
constructor(s, c = DEFAULT_LEXER_CONFIG) {
|
|
27
|
+
if (this.lexerDefinition = s, this.lexerDefinitionErrors = [], this.lexerDefinitionWarning = [], this.patternIdxToConfig = {}, this.charCodeToPatternIdxToConfig = {}, this.modes = [], this.emptyGroups = {}, this.trackStartLines = !0, this.trackEndLines = !0, this.hasCustom = !1, this.canModeBeOptimized = {}, this.TRACE_INIT = (e, n) => {
|
|
41
28
|
if (this.traceInitPerf === !0) {
|
|
42
29
|
this.traceInitIndent++;
|
|
43
|
-
let
|
|
44
|
-
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${
|
|
45
|
-
let { time:
|
|
46
|
-
return this.traceInitIndent < this.traceInitMaxIdent &&
|
|
47
|
-
} else return
|
|
48
|
-
}, typeof
|
|
49
|
-
this.config =
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
let
|
|
30
|
+
let r = Array(this.traceInitIndent + 1).join(" ");
|
|
31
|
+
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${e}>`);
|
|
32
|
+
let { time: i, value: a } = timer(n), o = i > 10 ? console.warn : console.log;
|
|
33
|
+
return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${e}> time: ${i}ms`), this.traceInitIndent--, a;
|
|
34
|
+
} else return n();
|
|
35
|
+
}, typeof c == "boolean") throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");
|
|
36
|
+
this.config = Object.assign({}, DEFAULT_LEXER_CONFIG, c);
|
|
37
|
+
let p = this.config.traceInitPerf;
|
|
38
|
+
p === !0 ? (this.traceInitMaxIdent = Infinity, this.traceInitPerf = !0) : typeof p == "number" && (this.traceInitMaxIdent = p, this.traceInitPerf = !0), this.traceInitIndent = -1, this.TRACE_INIT("Lexer Constructor", () => {
|
|
39
|
+
let t, p = !0;
|
|
53
40
|
this.TRACE_INIT("Lexer Config handling", () => {
|
|
54
41
|
if (this.config.lineTerminatorsPattern === DEFAULT_LEXER_CONFIG.lineTerminatorsPattern) this.config.lineTerminatorsPattern = LineTerminatorOptimizedTester;
|
|
55
42
|
else if (this.config.lineTerminatorCharacters === DEFAULT_LEXER_CONFIG.lineTerminatorCharacters) throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
|
|
56
|
-
if (
|
|
57
|
-
this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking), this.trackEndLines = /full/i.test(this.config.positionTracking),
|
|
58
|
-
modes: { defaultMode:
|
|
43
|
+
if (c.safeMode && c.ensureOptimizations) throw Error("\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.");
|
|
44
|
+
this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking), this.trackEndLines = /full/i.test(this.config.positionTracking), Array.isArray(s) ? t = {
|
|
45
|
+
modes: { defaultMode: [...s] },
|
|
59
46
|
defaultMode: DEFAULT_MODE
|
|
60
|
-
} : (
|
|
47
|
+
} : (p = !1, t = Object.assign({}, s));
|
|
61
48
|
}), this.config.skipValidations === !1 && (this.TRACE_INIT("performRuntimeChecks", () => {
|
|
62
|
-
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(performRuntimeChecks(
|
|
49
|
+
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(performRuntimeChecks(t, this.trackStartLines, this.config.lineTerminatorCharacters));
|
|
63
50
|
}), this.TRACE_INIT("performWarningRuntimeChecks", () => {
|
|
64
|
-
this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(performWarningRuntimeChecks(
|
|
65
|
-
})),
|
|
66
|
-
|
|
51
|
+
this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(performWarningRuntimeChecks(t, this.trackStartLines, this.config.lineTerminatorCharacters));
|
|
52
|
+
})), t.modes = t.modes ? t.modes : {}, Object.entries(t.modes).forEach(([e, n]) => {
|
|
53
|
+
t.modes[e] = n.filter((e) => e !== void 0);
|
|
67
54
|
});
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
this.TRACE_INIT(`Mode: <${
|
|
71
|
-
if (this.modes.push(
|
|
72
|
-
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(validatePatterns(
|
|
73
|
-
}),
|
|
74
|
-
augmentTokenTypes(
|
|
55
|
+
let m = Object.keys(t.modes);
|
|
56
|
+
if (Object.entries(t.modes).forEach(([e, t]) => {
|
|
57
|
+
this.TRACE_INIT(`Mode: <${e}> processing`, () => {
|
|
58
|
+
if (this.modes.push(e), this.config.skipValidations === !1 && this.TRACE_INIT("validatePatterns", () => {
|
|
59
|
+
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(validatePatterns(t, m));
|
|
60
|
+
}), this.lexerDefinitionErrors.length === 0) {
|
|
61
|
+
augmentTokenTypes(t);
|
|
75
62
|
let n;
|
|
76
63
|
this.TRACE_INIT("analyzeTokenTypes", () => {
|
|
77
|
-
n = analyzeTokenTypes(
|
|
64
|
+
n = analyzeTokenTypes(t, {
|
|
78
65
|
lineTerminatorCharacters: this.config.lineTerminatorCharacters,
|
|
79
|
-
positionTracking:
|
|
80
|
-
ensureOptimizations:
|
|
81
|
-
safeMode:
|
|
66
|
+
positionTracking: c.positionTracking,
|
|
67
|
+
ensureOptimizations: c.ensureOptimizations,
|
|
68
|
+
safeMode: c.safeMode,
|
|
82
69
|
tracer: this.TRACE_INIT
|
|
83
70
|
});
|
|
84
|
-
}), this.patternIdxToConfig[
|
|
71
|
+
}), this.patternIdxToConfig[e] = n.patternIdxToConfig, this.charCodeToPatternIdxToConfig[e] = n.charCodeToPatternIdxToConfig, this.emptyGroups = Object.assign({}, this.emptyGroups, n.emptyGroups), this.hasCustom = n.hasCustom || this.hasCustom, this.canModeBeOptimized[e] = n.canBeOptimized;
|
|
85
72
|
}
|
|
86
73
|
});
|
|
87
|
-
}), this.defaultMode =
|
|
88
|
-
let e =
|
|
74
|
+
}), this.defaultMode = t.defaultMode, this.lexerDefinitionErrors.length > 0 && !this.config.deferDefinitionErrorsHandling) {
|
|
75
|
+
let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
|
|
89
76
|
throw Error("Errors detected in definition of Lexer:\n" + e);
|
|
90
77
|
}
|
|
91
|
-
|
|
92
|
-
PRINT_WARNING(
|
|
78
|
+
this.lexerDefinitionWarning.forEach((t) => {
|
|
79
|
+
PRINT_WARNING(t.message);
|
|
93
80
|
}), this.TRACE_INIT("Choosing sub-methods implementations", () => {
|
|
94
|
-
if (
|
|
81
|
+
if (p && (this.handleModes = () => {}), this.trackStartLines === !1 && (this.computeNewColumn = (e) => e), this.trackEndLines === !1 && (this.updateTokenEndLineColumnLocation = () => {}), /full/i.test(this.config.positionTracking)) this.createTokenInstance = this.createFullToken;
|
|
95
82
|
else if (/onlyStart/i.test(this.config.positionTracking)) this.createTokenInstance = this.createStartOnlyToken;
|
|
96
83
|
else if (/onlyOffset/i.test(this.config.positionTracking)) this.createTokenInstance = this.createOffsetOnlyToken;
|
|
97
84
|
else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);
|
|
98
85
|
this.hasCustom ? (this.addToken = this.addTokenUsingPush, this.handlePayload = this.handlePayloadWithCustom) : (this.addToken = this.addTokenUsingMemberAccess, this.handlePayload = this.handlePayloadNoCustom);
|
|
99
86
|
}), this.TRACE_INIT("Failed Optimization Warnings", () => {
|
|
100
|
-
let e =
|
|
101
|
-
if (
|
|
87
|
+
let e = Object.entries(this.canModeBeOptimized).reduce((e, [t, n]) => (n === !1 && e.push(t), e), []);
|
|
88
|
+
if (c.ensureOptimizations && e.length > 0) throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
102
89
|
Or inspect the console log for details on how to resolve these issues.`);
|
|
103
90
|
}), this.TRACE_INIT("clearRegExpParserCache", () => {
|
|
104
91
|
clearRegExpParserCache();
|
|
@@ -108,19 +95,19 @@ var Lexer = class {
|
|
|
108
95
|
});
|
|
109
96
|
}
|
|
110
97
|
tokenize(e, t = this.defaultMode) {
|
|
111
|
-
if (
|
|
112
|
-
let e =
|
|
98
|
+
if (this.lexerDefinitionErrors.length > 0) {
|
|
99
|
+
let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
|
|
113
100
|
throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + e);
|
|
114
101
|
}
|
|
115
102
|
return this.tokenizeInternal(e, t);
|
|
116
103
|
}
|
|
117
104
|
tokenizeInternal(e, t) {
|
|
118
|
-
let n, r, i, a, o,
|
|
119
|
-
Object.freeze(
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
105
|
+
let n, r, i, a, o, l, u, d, f, p, m, h, g, _, v, y = e, b = y.length, x = 0, S = 0, C = this.hasCustom ? 0 : Math.floor(e.length / 10), w = Array(C), T = [], E = this.trackStartLines ? 1 : void 0, D = this.trackStartLines ? 1 : void 0, O = cloneEmptyGroups(this.emptyGroups), k = this.trackStartLines, A = this.config.lineTerminatorsPattern, j = 0, M = [], N = [], P = [], F = [];
|
|
106
|
+
Object.freeze(F);
|
|
107
|
+
let I = !1, L = (e) => {
|
|
108
|
+
if (P.length === 1 && e.tokenType.PUSH_MODE === void 0) {
|
|
122
109
|
let t = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);
|
|
123
|
-
|
|
110
|
+
T.push({
|
|
124
111
|
offset: e.startOffset,
|
|
125
112
|
line: e.startLine,
|
|
126
113
|
column: e.startColumn,
|
|
@@ -128,41 +115,41 @@ var Lexer = class {
|
|
|
128
115
|
message: t
|
|
129
116
|
});
|
|
130
117
|
} else {
|
|
131
|
-
|
|
132
|
-
let e =
|
|
133
|
-
|
|
118
|
+
P.pop();
|
|
119
|
+
let e = P.at(-1);
|
|
120
|
+
M = this.patternIdxToConfig[e], N = this.charCodeToPatternIdxToConfig[e], j = M.length;
|
|
134
121
|
let t = this.canModeBeOptimized[e] && this.config.safeMode === !1;
|
|
135
|
-
|
|
122
|
+
I = !!(N && t);
|
|
136
123
|
}
|
|
137
124
|
};
|
|
138
|
-
function
|
|
139
|
-
|
|
125
|
+
function R(e) {
|
|
126
|
+
P.push(e), N = this.charCodeToPatternIdxToConfig[e], M = this.patternIdxToConfig[e], j = M.length, j = M.length;
|
|
140
127
|
let t = this.canModeBeOptimized[e] && this.config.safeMode === !1;
|
|
141
|
-
|
|
128
|
+
I = !!(N && t);
|
|
142
129
|
}
|
|
143
|
-
|
|
144
|
-
let
|
|
145
|
-
for (;
|
|
146
|
-
|
|
147
|
-
let t =
|
|
148
|
-
if (
|
|
149
|
-
let e = charCodeToOptimizedIndex(t), n =
|
|
150
|
-
|
|
151
|
-
} else
|
|
152
|
-
let
|
|
153
|
-
for (n = 0; n <
|
|
154
|
-
|
|
155
|
-
let r =
|
|
156
|
-
|
|
157
|
-
let s =
|
|
158
|
-
if (s === !1 ?
|
|
159
|
-
if (o =
|
|
160
|
-
|
|
130
|
+
R.call(this, t);
|
|
131
|
+
let z, B = this.config.recoveryEnabled;
|
|
132
|
+
for (; x < b;) {
|
|
133
|
+
l = null, f = -1;
|
|
134
|
+
let t = y.charCodeAt(x), c;
|
|
135
|
+
if (I) {
|
|
136
|
+
let e = charCodeToOptimizedIndex(t), n = N[e];
|
|
137
|
+
c = n === void 0 ? F : n;
|
|
138
|
+
} else c = M;
|
|
139
|
+
let C = c.length;
|
|
140
|
+
for (n = 0; n < C; n++) {
|
|
141
|
+
z = c[n];
|
|
142
|
+
let r = z.pattern;
|
|
143
|
+
u = null;
|
|
144
|
+
let s = z.short;
|
|
145
|
+
if (s === !1 ? z.isCustom === !0 ? (v = r.exec(y, x, w, O), v === null ? l = null : (l = v[0], f = l.length, v.payload !== void 0 && (u = v.payload))) : (r.lastIndex = x, f = this.matchLength(r, e, x)) : t === s && (f = 1, l = r), f !== -1) {
|
|
146
|
+
if (o = z.longerAlt, o !== void 0) {
|
|
147
|
+
l = e.substring(x, x + f);
|
|
161
148
|
let t = o.length;
|
|
162
149
|
for (i = 0; i < t; i++) {
|
|
163
|
-
let t =
|
|
164
|
-
if (
|
|
165
|
-
|
|
150
|
+
let t = M[o[i]], n = t.pattern;
|
|
151
|
+
if (d = null, t.isCustom === !0 ? (v = n.exec(y, x, w, O), v === null ? a = null : (a = v[0], v.payload !== void 0 && (d = v.payload))) : (n.lastIndex = x, a = this.match(n, e, x)), a && a.length > l.length) {
|
|
152
|
+
l = a, f = a.length, u = d, z = t;
|
|
166
153
|
break;
|
|
167
154
|
}
|
|
168
155
|
}
|
|
@@ -170,35 +157,35 @@ var Lexer = class {
|
|
|
170
157
|
break;
|
|
171
158
|
}
|
|
172
159
|
}
|
|
173
|
-
if (
|
|
174
|
-
if (
|
|
160
|
+
if (f !== -1) {
|
|
161
|
+
if (p = z.group, p !== void 0 && (l = l === null ? e.substring(x, x + f) : l, m = z.tokenTypeIdx, h = this.createTokenInstance(l, x, m, z.tokenType, E, D, f), this.handlePayload(h, u), p === !1 ? S = this.addToken(w, S, h) : O[p].push(h)), k === !0 && z.canLineTerminator === !0) {
|
|
175
162
|
let t = 0, n, r;
|
|
176
|
-
|
|
163
|
+
A.lastIndex = 0;
|
|
177
164
|
do
|
|
178
|
-
|
|
165
|
+
l = l === null ? e.substring(x, x + f) : l, n = A.test(l), n === !0 && (r = A.lastIndex - 1, t++);
|
|
179
166
|
while (n === !0);
|
|
180
|
-
t === 0 ?
|
|
181
|
-
} else
|
|
182
|
-
|
|
167
|
+
t === 0 ? D = this.computeNewColumn(D, f) : (E += t, D = f - r, this.updateTokenEndLineColumnLocation(h, p, r, t, E, D, f));
|
|
168
|
+
} else D = this.computeNewColumn(D, f);
|
|
169
|
+
x += f, this.handleModes(z, L, R, h);
|
|
183
170
|
} else {
|
|
184
|
-
let t =
|
|
185
|
-
for (; a === !1 &&
|
|
186
|
-
let t =
|
|
187
|
-
if (i === !1 ? t.isCustom === !0 ? a = n.exec(
|
|
171
|
+
let t = x, n = E, i = D, a = B === !1;
|
|
172
|
+
for (; a === !1 && x < b;) for (x++, r = 0; r < j; r++) {
|
|
173
|
+
let t = M[r], n = t.pattern, i = t.short;
|
|
174
|
+
if (i === !1 ? t.isCustom === !0 ? a = n.exec(y, x, w, O) !== null : (n.lastIndex = x, a = n.exec(e) !== null) : y.charCodeAt(x) === i && (a = !0), a === !0) break;
|
|
188
175
|
}
|
|
189
|
-
if (
|
|
176
|
+
if (g = x - t, D = this.computeNewColumn(D, g), _ = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(y, t, g, n, i, P.at(-1)), T.push({
|
|
190
177
|
offset: t,
|
|
191
178
|
line: n,
|
|
192
179
|
column: i,
|
|
193
|
-
length:
|
|
194
|
-
message:
|
|
195
|
-
}),
|
|
180
|
+
length: g,
|
|
181
|
+
message: _
|
|
182
|
+
}), B === !1) break;
|
|
196
183
|
}
|
|
197
184
|
}
|
|
198
|
-
return this.hasCustom || (
|
|
199
|
-
tokens:
|
|
200
|
-
groups:
|
|
201
|
-
errors:
|
|
185
|
+
return this.hasCustom || (w.length = S), {
|
|
186
|
+
tokens: w,
|
|
187
|
+
groups: O,
|
|
188
|
+
errors: T
|
|
202
189
|
};
|
|
203
190
|
}
|
|
204
191
|
handleModes(e, t, n, r) {
|
|
@@ -1,42 +1,36 @@
|
|
|
1
|
-
import isArray_default from "../../../../lodash-es/isArray.js";
|
|
2
1
|
import { BaseRegExpVisitor } from "../../../../@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js";
|
|
3
2
|
import "../../../../@chevrotain/regexp-to-ast/lib/src/api.js";
|
|
4
|
-
import forEach_default from "../../../../lodash-es/forEach.js";
|
|
5
|
-
import every_default from "../../../../lodash-es/every.js";
|
|
6
|
-
import find_default from "../../../../lodash-es/find.js";
|
|
7
|
-
import values_default from "../../../../lodash-es/values.js";
|
|
8
|
-
import includes_default from "../../../../lodash-es/includes.js";
|
|
9
3
|
import { PRINT_ERROR, PRINT_WARNING } from "../../../../@chevrotain/utils/lib/src/print.js";
|
|
10
4
|
import { getRegExpAst } from "./reg_exp_parser.js";
|
|
11
5
|
import { charCodeToOptimizedIndex, minOptimizationVal } from "./lexer.js";
|
|
12
6
|
var complementErrorMessage = "Complement Sets are not supported for first char optimization";
|
|
13
7
|
const failedOptimizationPrefixMsg = "Unable to use \"first char\" lexer optimizations:\n";
|
|
14
|
-
function getOptimizedStartCodesIndices(e,
|
|
8
|
+
function getOptimizedStartCodesIndices(e, d = !1) {
|
|
15
9
|
try {
|
|
16
|
-
let
|
|
17
|
-
return firstCharOptimizedIndices(
|
|
18
|
-
} catch (
|
|
10
|
+
let c = getRegExpAst(e);
|
|
11
|
+
return firstCharOptimizedIndices(c.value, {}, c.flags.ignoreCase);
|
|
12
|
+
} catch (u) {
|
|
19
13
|
/* istanbul ignore next */
|
|
20
|
-
if (
|
|
14
|
+
if (u.message === complementErrorMessage) d && PRINT_WARNING(`${failedOptimizationPrefixMsg}\tUnable to optimize: < ${e.toString()} >\n Complement Sets cannot be automatically optimized.
|
|
21
15
|
This will disable the lexer's first char optimizations.
|
|
22
16
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);
|
|
23
17
|
else {
|
|
24
|
-
let
|
|
25
|
-
|
|
18
|
+
let l = "";
|
|
19
|
+
d && (l = "\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."), PRINT_ERROR(`${failedOptimizationPrefixMsg}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n Please open an issue at: https://github.com/chevrotain/chevrotain/issues` + l);
|
|
26
20
|
}
|
|
27
21
|
}
|
|
28
22
|
return [];
|
|
29
23
|
}
|
|
30
|
-
function firstCharOptimizedIndices(e,
|
|
24
|
+
function firstCharOptimizedIndices(e, c, l) {
|
|
31
25
|
switch (e.type) {
|
|
32
26
|
case "Disjunction":
|
|
33
|
-
for (let
|
|
27
|
+
for (let u = 0; u < e.value.length; u++) firstCharOptimizedIndices(e.value[u], c, l);
|
|
34
28
|
break;
|
|
35
29
|
case "Alternative":
|
|
36
|
-
let
|
|
37
|
-
for (let e = 0; e <
|
|
38
|
-
let
|
|
39
|
-
switch (
|
|
30
|
+
let u = e.value;
|
|
31
|
+
for (let e = 0; e < u.length; e++) {
|
|
32
|
+
let f = u[e];
|
|
33
|
+
switch (f.type) {
|
|
40
34
|
case "EndAnchor":
|
|
41
35
|
case "GroupBackReference":
|
|
42
36
|
case "Lookahead":
|
|
@@ -47,71 +41,71 @@ function firstCharOptimizedIndices(e, h, _) {
|
|
|
47
41
|
case "WordBoundary":
|
|
48
42
|
case "NonWordBoundary": continue;
|
|
49
43
|
}
|
|
50
|
-
let
|
|
51
|
-
switch (
|
|
44
|
+
let m = f;
|
|
45
|
+
switch (m.type) {
|
|
52
46
|
case "Character":
|
|
53
|
-
addOptimizedIdxToResult(
|
|
47
|
+
addOptimizedIdxToResult(m.value, c, l);
|
|
54
48
|
break;
|
|
55
49
|
case "Set":
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
if (typeof e == "number") addOptimizedIdxToResult(e,
|
|
50
|
+
if (m.complement === !0) throw Error(complementErrorMessage);
|
|
51
|
+
m.value.forEach((e) => {
|
|
52
|
+
if (typeof e == "number") addOptimizedIdxToResult(e, c, l);
|
|
59
53
|
else {
|
|
60
|
-
let
|
|
61
|
-
if (
|
|
54
|
+
let u = e;
|
|
55
|
+
if (l === !0) for (let e = u.from; e <= u.to; e++) addOptimizedIdxToResult(e, c, l);
|
|
62
56
|
else {
|
|
63
|
-
for (let e =
|
|
64
|
-
if (
|
|
65
|
-
let e =
|
|
66
|
-
for (let e =
|
|
57
|
+
for (let e = u.from; e <= u.to && e < 256; e++) addOptimizedIdxToResult(e, c, l);
|
|
58
|
+
if (u.to >= 256) {
|
|
59
|
+
let e = u.from >= 256 ? u.from : 256, l = u.to, f = charCodeToOptimizedIndex(e), p = charCodeToOptimizedIndex(l);
|
|
60
|
+
for (let e = f; e <= p; e++) c[e] = e;
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
}
|
|
70
64
|
});
|
|
71
65
|
break;
|
|
72
66
|
case "Group":
|
|
73
|
-
firstCharOptimizedIndices(
|
|
67
|
+
firstCharOptimizedIndices(m.value, c, l);
|
|
74
68
|
break;
|
|
75
69
|
default: throw Error("Non Exhaustive Match");
|
|
76
70
|
}
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
71
|
+
let h = m.quantifier !== void 0 && m.quantifier.atLeast === 0;
|
|
72
|
+
if (m.type === "Group" && isWholeOptional(m) === !1 || m.type !== "Group" && h === !1) break;
|
|
79
73
|
}
|
|
80
74
|
break;
|
|
81
75
|
default: throw Error("non exhaustive match!");
|
|
82
76
|
}
|
|
83
|
-
return
|
|
77
|
+
return Object.values(c);
|
|
84
78
|
}
|
|
85
|
-
function addOptimizedIdxToResult(e,
|
|
86
|
-
let
|
|
87
|
-
|
|
79
|
+
function addOptimizedIdxToResult(e, c, l) {
|
|
80
|
+
let u = charCodeToOptimizedIndex(e);
|
|
81
|
+
c[u] = u, l === !0 && handleIgnoreCase(e, c);
|
|
88
82
|
}
|
|
89
|
-
function handleIgnoreCase(e,
|
|
90
|
-
let
|
|
83
|
+
function handleIgnoreCase(e, c) {
|
|
84
|
+
let l = String.fromCharCode(e), u = l.toUpperCase();
|
|
91
85
|
/* istanbul ignore else */
|
|
92
|
-
if (
|
|
93
|
-
let e = charCodeToOptimizedIndex(
|
|
94
|
-
|
|
86
|
+
if (u !== l) {
|
|
87
|
+
let e = charCodeToOptimizedIndex(u.charCodeAt(0));
|
|
88
|
+
c[e] = e;
|
|
95
89
|
} else {
|
|
96
|
-
let e =
|
|
97
|
-
if (e !==
|
|
98
|
-
let
|
|
99
|
-
|
|
90
|
+
let e = l.toLowerCase();
|
|
91
|
+
if (e !== l) {
|
|
92
|
+
let l = charCodeToOptimizedIndex(e.charCodeAt(0));
|
|
93
|
+
c[l] = l;
|
|
100
94
|
}
|
|
101
95
|
}
|
|
102
96
|
}
|
|
103
|
-
function findCode(e,
|
|
104
|
-
return
|
|
105
|
-
if (typeof e == "number") return
|
|
97
|
+
function findCode(e, c) {
|
|
98
|
+
return e.value.find((e) => {
|
|
99
|
+
if (typeof e == "number") return c.includes(e);
|
|
106
100
|
{
|
|
107
|
-
let
|
|
108
|
-
return
|
|
101
|
+
let l = e;
|
|
102
|
+
return c.find((e) => l.from <= e && e <= l.to) !== void 0;
|
|
109
103
|
}
|
|
110
104
|
});
|
|
111
105
|
}
|
|
112
|
-
function isWholeOptional(
|
|
113
|
-
let
|
|
114
|
-
return
|
|
106
|
+
function isWholeOptional(e) {
|
|
107
|
+
let c = e.quantifier;
|
|
108
|
+
return c && c.atLeast === 0 ? !0 : e.value ? Array.isArray(e.value) ? e.value.every(isWholeOptional) : isWholeOptional(e.value) : !1;
|
|
115
109
|
}
|
|
116
110
|
var CharCodeFinder = class extends BaseRegExpVisitor {
|
|
117
111
|
constructor(e) {
|
|
@@ -137,16 +131,22 @@ var CharCodeFinder = class extends BaseRegExpVisitor {
|
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
133
|
visitCharacter(e) {
|
|
140
|
-
|
|
134
|
+
this.targetCharCodes.includes(e.value) && (this.found = !0);
|
|
141
135
|
}
|
|
142
136
|
visitSet(e) {
|
|
143
137
|
e.complement ? findCode(e, this.targetCharCodes) === void 0 && (this.found = !0) : findCode(e, this.targetCharCodes) !== void 0 && (this.found = !0);
|
|
144
138
|
}
|
|
145
139
|
};
|
|
146
|
-
function canMatchCharCode(e,
|
|
147
|
-
if (
|
|
148
|
-
let
|
|
149
|
-
return
|
|
150
|
-
} else
|
|
140
|
+
function canMatchCharCode(e, c) {
|
|
141
|
+
if (c instanceof RegExp) {
|
|
142
|
+
let l = getRegExpAst(c), d = new CharCodeFinder(e);
|
|
143
|
+
return d.visit(l), d.found;
|
|
144
|
+
} else {
|
|
145
|
+
for (let l of c) {
|
|
146
|
+
let c = l.charCodeAt(0);
|
|
147
|
+
if (e.includes(c)) return !0;
|
|
148
|
+
}
|
|
149
|
+
return !1;
|
|
150
|
+
}
|
|
151
151
|
}
|
|
152
152
|
export { canMatchCharCode, failedOptimizationPrefixMsg, getOptimizedStartCodesIndices };
|
|
@@ -1,75 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import clone_default from "../../../../lodash-es/clone.js";
|
|
5
|
-
import compact_default from "../../../../lodash-es/compact.js";
|
|
6
|
-
import difference_default from "../../../../lodash-es/difference.js";
|
|
7
|
-
import forEach_default from "../../../../lodash-es/forEach.js";
|
|
8
|
-
import map_default from "../../../../lodash-es/map.js";
|
|
9
|
-
import has_default from "../../../../lodash-es/has.js";
|
|
10
|
-
import includes_default from "../../../../lodash-es/includes.js";
|
|
11
|
-
function tokenStructuredMatcher(e, y) {
|
|
12
|
-
let b = e.tokenTypeIdx;
|
|
13
|
-
return b === y.tokenTypeIdx ? !0 : y.isParent === !0 && y.categoryMatchesMap[b] === !0;
|
|
1
|
+
function tokenStructuredMatcher(e, f) {
|
|
2
|
+
let p = e.tokenTypeIdx;
|
|
3
|
+
return p === f.tokenTypeIdx ? !0 : f.isParent === !0 && f.categoryMatchesMap[p] === !0;
|
|
14
4
|
}
|
|
15
|
-
function tokenStructuredMatcherNoCategories(e,
|
|
16
|
-
return e.tokenTypeIdx ===
|
|
5
|
+
function tokenStructuredMatcherNoCategories(e, f) {
|
|
6
|
+
return e.tokenTypeIdx === f.tokenTypeIdx;
|
|
17
7
|
}
|
|
18
8
|
let tokenShortNameIdx = 1;
|
|
19
9
|
const tokenIdxToClass = {};
|
|
20
10
|
function augmentTokenTypes(e) {
|
|
21
|
-
let
|
|
22
|
-
assignTokenDefaultProps(
|
|
11
|
+
let f = expandCategories(e);
|
|
12
|
+
assignTokenDefaultProps(f), assignCategoriesMapProp(f), assignCategoriesTokensProp(f), f.forEach((e) => {
|
|
23
13
|
e.isParent = e.categoryMatches.length > 0;
|
|
24
14
|
});
|
|
25
15
|
}
|
|
26
16
|
function expandCategories(e) {
|
|
27
|
-
let
|
|
28
|
-
for (;
|
|
29
|
-
|
|
30
|
-
let e =
|
|
31
|
-
|
|
17
|
+
let f = [...e], p = e, m = !0;
|
|
18
|
+
for (; m;) {
|
|
19
|
+
p = p.map((e) => e.CATEGORIES).flat().filter(Boolean);
|
|
20
|
+
let e = p.filter((e) => !f.includes(e));
|
|
21
|
+
f = f.concat(e), e.length === 0 ? m = !1 : p = e;
|
|
32
22
|
}
|
|
33
|
-
return
|
|
23
|
+
return f;
|
|
34
24
|
}
|
|
35
|
-
function assignTokenDefaultProps(
|
|
36
|
-
|
|
37
|
-
hasShortKeyProperty(
|
|
25
|
+
function assignTokenDefaultProps(e) {
|
|
26
|
+
e.forEach((e) => {
|
|
27
|
+
hasShortKeyProperty(e) || (tokenIdxToClass[tokenShortNameIdx] = e, e.tokenTypeIdx = tokenShortNameIdx++), hasCategoriesProperty(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), hasCategoriesProperty(e) || (e.CATEGORIES = []), hasExtendingTokensTypesProperty(e) || (e.categoryMatches = []), hasExtendingTokensTypesMapProperty(e) || (e.categoryMatchesMap = {});
|
|
38
28
|
});
|
|
39
29
|
}
|
|
40
30
|
function assignCategoriesTokensProp(e) {
|
|
41
|
-
|
|
42
|
-
e.categoryMatches = [],
|
|
43
|
-
e.categoryMatches.push(tokenIdxToClass[
|
|
31
|
+
e.forEach((e) => {
|
|
32
|
+
e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((f) => {
|
|
33
|
+
e.categoryMatches.push(tokenIdxToClass[f].tokenTypeIdx);
|
|
44
34
|
});
|
|
45
35
|
});
|
|
46
36
|
}
|
|
47
37
|
function assignCategoriesMapProp(e) {
|
|
48
|
-
|
|
38
|
+
e.forEach((e) => {
|
|
49
39
|
singleAssignCategoriesToksMap([], e);
|
|
50
40
|
});
|
|
51
41
|
}
|
|
52
|
-
function singleAssignCategoriesToksMap(e,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
let
|
|
57
|
-
|
|
42
|
+
function singleAssignCategoriesToksMap(e, f) {
|
|
43
|
+
e.forEach((e) => {
|
|
44
|
+
f.categoryMatchesMap[e.tokenTypeIdx] = !0;
|
|
45
|
+
}), f.CATEGORIES.forEach((p) => {
|
|
46
|
+
let m = e.concat(f);
|
|
47
|
+
m.includes(p) || singleAssignCategoriesToksMap(m, p);
|
|
58
48
|
});
|
|
59
49
|
}
|
|
60
50
|
function hasShortKeyProperty(e) {
|
|
61
|
-
return
|
|
51
|
+
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
62
52
|
}
|
|
63
53
|
function hasCategoriesProperty(e) {
|
|
64
|
-
return
|
|
54
|
+
return Object.hasOwn(e ?? {}, "CATEGORIES");
|
|
65
55
|
}
|
|
66
56
|
function hasExtendingTokensTypesProperty(e) {
|
|
67
|
-
return
|
|
57
|
+
return Object.hasOwn(e ?? {}, "categoryMatches");
|
|
68
58
|
}
|
|
69
59
|
function hasExtendingTokensTypesMapProperty(e) {
|
|
70
|
-
return
|
|
60
|
+
return Object.hasOwn(e ?? {}, "categoryMatchesMap");
|
|
71
61
|
}
|
|
72
62
|
function isTokenType(e) {
|
|
73
|
-
return
|
|
63
|
+
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
74
64
|
}
|
|
75
65
|
export { augmentTokenTypes, hasShortKeyProperty, isTokenType, tokenStructuredMatcher, tokenStructuredMatcherNoCategories };
|