@loopstack/loopstack-studio 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +13 -15
- package/dist/components/dynamic-form/Form.js +49 -52
- package/dist/config.js +6 -0
- package/dist/features/debug/components/WorkflowFlowViewer.js +94 -81
- package/dist/features/debug/components/workflow-flow/StateNode.js +154 -79
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +43 -31
- package/dist/features/debug/components/workflow-flow/WorkflowTransitionEdge.js +52 -51
- package/dist/features/debug/lib/edge-paths.js +45 -30
- package/dist/features/debug/lib/flow-types.js +2 -0
- package/dist/features/debug/lib/flow-utils.js +66 -64
- package/dist/features/documents/components/DocumentList.js +19 -18
- package/dist/features/workbench/WorkflowItem.js +4 -3
- package/dist/features/workbench/components/EmbedLogsContent.js +5 -0
- package/dist/features/workbench/components/PreviewEmptyState.js +10 -0
- package/dist/features/workbench/components/PreviewWorkbench.js +14 -0
- package/dist/features/workbench/components/RecentRunItem.js +48 -0
- package/dist/features/workbench/components/WorkflowForms.js +4 -3
- package/dist/features/workbench/hooks/useEmbedBridge.js +3 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +9 -9
- package/dist/features/workbench/index.js +4 -0
- package/dist/features/workspaces/components/ExecutionTimeline.js +9 -8
- package/dist/loopstack-studio.css +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-YZFGNWBL.js → architecture-7EHR7CIX.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-7N4EOEYR.js → chunk-4EGX6M5U.js} +9 -13
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-KGLVRYIC.js → chunk-5DO6E6H7.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BR22UD5L.js +56 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-2KRD3SAO.js → chunk-FHYWG6QK.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FOC6F5B3.js → chunk-MPE355IW.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MZUSXYTE.js +24 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-N66VUXT2.js +48 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-NNHCCRGN.js +20219 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-PUPMXCY4.js +19 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-67CJDMHE.js → chunk-UIBZB4QT.js} +3 -7
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WCWK7LTN.js +25 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-FCH6USID.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-7Q5UKJZL.js → gitGraph-WXDBUCRP.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-J43DQDTF.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-YPE3B663.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-LRSECV5Y.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-GUYGQ44K.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{treeView-SZITEDCU.js → treeView-BLDUP644.js} +2 -2
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-LRROVOQU.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-L42UT6IY.js +3 -0
- package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +24 -19
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +36 -26
- package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +257 -254
- 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 +72 -72
- 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 +293 -205
- package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +4 -0
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +2 -0
- package/dist/node_modules/es-toolkit/dist/compat/function/memoize.js +12 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +97 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +29 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +6 -0
- package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +49 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +5 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +6 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js +16 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +4 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +12 -0
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +5 -0
- package/dist/node_modules/es-toolkit/dist/function/noop.js +2 -0
- package/dist/node_modules/es-toolkit/dist/object/clone.js +29 -0
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +114 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +5 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +4 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +4 -0
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +4 -0
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +2 -2
- package/dist/node_modules/internmap/src/index.js +1 -1
- package/dist/node_modules/katex/dist/katex.js +379 -417
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +3 -3
- package/dist/node_modules/lodash-es/_assignMergeValue.js +1 -1
- package/dist/node_modules/lodash-es/_assignValue.js +1 -1
- package/dist/node_modules/lodash-es/_baseClone.js +9 -9
- package/dist/node_modules/lodash-es/_baseForOwn.js +1 -1
- package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +1 -1
- package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
- package/dist/node_modules/lodash-es/_baseMerge.js +2 -2
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +7 -7
- package/dist/node_modules/lodash-es/_baseOrderBy.js +12 -12
- package/dist/node_modules/lodash-es/_baseRest.js +1 -1
- package/dist/node_modules/lodash-es/_baseSet.js +1 -1
- package/dist/node_modules/lodash-es/_baseSetToString.js +3 -3
- package/dist/node_modules/lodash-es/_baseToString.js +2 -2
- package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
- package/dist/node_modules/lodash-es/_createRange.js +1 -1
- package/dist/node_modules/lodash-es/_createSet.js +3 -3
- package/dist/node_modules/lodash-es/_flatRest.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/_getSymbolsIn.js +1 -1
- package/dist/node_modules/lodash-es/_getTag.js +1 -1
- package/dist/node_modules/lodash-es/_hasPath.js +2 -2
- package/dist/node_modules/lodash-es/_initCloneByTag.js +1 -1
- package/dist/node_modules/lodash-es/_initCloneObject.js +1 -1
- package/dist/node_modules/lodash-es/_isFlattenable.js +1 -1
- package/dist/node_modules/lodash-es/_isIterateeCall.js +1 -1
- package/dist/node_modules/lodash-es/_isKey.js +1 -1
- package/dist/node_modules/lodash-es/_setToString.js +1 -1
- package/dist/node_modules/lodash-es/defaults.js +1 -1
- package/dist/node_modules/lodash-es/findIndex.js +2 -2
- package/dist/node_modules/lodash-es/forEach.js +1 -1
- package/dist/node_modules/lodash-es/forIn.js +1 -1
- package/dist/node_modules/lodash-es/isEmpty.js +2 -2
- package/dist/node_modules/lodash-es/isPlainObject.js +1 -1
- package/dist/node_modules/lodash-es/map.js +1 -1
- package/dist/node_modules/lodash-es/max.js +1 -1
- package/dist/node_modules/lodash-es/merge.js +3 -3
- 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/lodash-es/toNumber.js +1 -1
- package/dist/node_modules/lodash-es/union.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{architectureDiagram-Q4EWVU46.js → architectureDiagram-3BPJPVTR.js} +310 -308
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-DXYQGD6D.js → blockDiagram-GPEHLZMM.js} +215 -190
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-AHTNJAMY.js → c4Diagram-AAUBKEIU.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EDXVE4YY.js → chunk-2J33WTMH.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5FUZZQ4R.js → chunk-3OPIFGDE.js} +48 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5PVQY5BW.js → chunk-5ZQYHXKU.js} +8 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-4TB4RGXK.js → chunk-727SXJPM.js} +555 -459
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-OYMX7WX6.js → chunk-AQP2D5EJ.js} +155 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ICPOFSXX.js → chunk-CSCIHK7Q.js} +106 -12
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ENJZ2VHE.js → chunk-KSCS5N6A.js} +12 -12
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ZZ45TVLE.js → chunk-L5ZTLDWV.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-336JU56O.js → chunk-LZXEDZCA.js} +5 -5
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-YZCP3GAM.js → chunk-ND2GUHAM.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-X2U36JSP.js → chunk-NZK2D7GU.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-U2HBQHQK.js → chunk-O5CBEL6O.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-426QAEUC.js → chunk-WU5MYG2G.js} +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-6PBFFD2Q.js → classDiagram-4FO5ZUOK.js} +11 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-HSJHXN6E.js → classDiagram-v2-Q7XG4LA2.js} +11 -11
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-KV5264BT.js → dagre-BM42HDAG.js} +8 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-MMDJMWI5.js → diagram-2AECGRRQ.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-5BDNPKRD.js → diagram-5GNKFQAL.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +433 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-TYMM5635.js → diagram-LMA3HP47.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-G4DWMVQ6.js → diagram-OG6HWLK6.js} +5 -5
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-SMLLAGMA.js → erDiagram-TEJ5UH35.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-DWJPFMVM.js → flowDiagram-I6XJVG4X.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-T4ZO3ILL.js → ganttDiagram-6RSMTGT7.js} +7 -4
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{gitGraphDiagram-UUTBAWPF.js → gitGraphDiagram-PVQCEYII.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{infoDiagram-42DDH7IO.js → infoDiagram-5YYISTIA.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ishikawaDiagram-UXIWVN3A.js → ishikawaDiagram-YF4QCWOH.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-VCZTEJTY.js → journeyDiagram-JHISSGLW.js} +2 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-6JOO6SKY.js → kanban-definition-UN3LZRKU.js} +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-QFDTVHPH.js → mindmap-definition-RKZ34NQL.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{pieDiagram-DEJITSTG.js → pieDiagram-4H26LBE5.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-34T5L4WZ.js → quadrantDiagram-W4KKPZXB.js} +364 -337
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-MS252O5E.js → requirementDiagram-4Y6WPE33.js} +9 -9
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-XADWPNL6.js → sankeyDiagram-5OEKKPKP.js} +187 -138
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sequenceDiagram-FGHM5R23.js → sequenceDiagram-3UESZ5HK.js} +15 -8
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FHFEXIEX.js → stateDiagram-AJRCARHV.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-QKLJ7IA2.js → stateDiagram-v2-BHNVJYJU.js} +10 -10
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{timeline-definition-GMOUNBTQ.js → timeline-definition-PNZ67QCA.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{vennDiagram-DHZGUBPP.js → vennDiagram-CIIHVFJN.js} +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.js +640 -0
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-5P7HB3ND.js → xychartDiagram-2RQKCTM6.js} +4 -4
- package/dist/node_modules/mermaid/dist/mermaid.core.js +96 -70
- package/dist/node_modules/stylis/src/Enum.js +2 -2
- package/dist/node_modules/stylis/src/Middleware.js +9 -0
- package/dist/node_modules/stylis/src/Parser.js +55 -44
- package/dist/node_modules/stylis/src/Utility.js +9 -12
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/packages/contracts/dist/enums/index.js +4 -24
- package/dist/packages/contracts/dist/enums/registry.enum.js +9 -20
- package/dist/packages/contracts/dist/enums/sort-order.enum.js +5 -10
- package/dist/packages/contracts/dist/enums/user-type.enum.js +5 -10
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +5 -10
- package/dist/pages/EmbedWorkbenchPage.js +4 -3
- package/dist/pages/PreviewWorkbenchPage.js +126 -124
- package/dist/pages/StudioLandingPage.js +28 -72
- package/package.json +2 -2
- package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +0 -23
- package/dist/node_modules/@chevrotain/gast/lib/src/model.js +0 -151
- package/dist/node_modules/@chevrotain/gast/lib/src/visitor.js +0 -40
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js +0 -2
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js +0 -85
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js +0 -35
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js +0 -570
- package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js +0 -25
- package/dist/node_modules/@chevrotain/utils/lib/src/print.js +0 -9
- package/dist/node_modules/@chevrotain/utils/lib/src/timer.js +0 -8
- package/dist/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js +0 -10
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-AA7GKIK3.js +0 -28
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +0 -23
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +0 -1197
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LIHQZDEY.js +0 -60
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +0 -29
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +0 -3
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +0 -3
- package/dist/node_modules/chevrotain/lib/src/api.js +0 -10
- package/dist/node_modules/chevrotain/lib/src/lang/lang_extensions.js +0 -10
- package/dist/node_modules/chevrotain/lib/src/parse/constants.js +0 -2
- package/dist/node_modules/chevrotain/lib/src/parse/cst/cst.js +0 -13
- package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +0 -49
- package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +0 -77
- package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +0 -33
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +0 -275
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +0 -23
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +0 -28
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +0 -14
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +0 -262
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/keys.js +0 -5
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +0 -41
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +0 -241
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +0 -30
- package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +0 -56
- package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +0 -114
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +0 -46
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +0 -166
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +0 -43
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +0 -107
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +0 -21
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +0 -312
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +0 -285
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +0 -144
- package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +0 -92
- package/dist/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js +0 -11
- package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +0 -437
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +0 -9
- package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +0 -253
- package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +0 -152
- package/dist/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +0 -15
- package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +0 -65
- package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +0 -39
- package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +0 -346
- package/dist/node_modules/chevrotain-allstar/lib/atn.js +0 -194
- package/dist/node_modules/chevrotain-allstar/lib/dfa.js +0 -32
- package/dist/node_modules/chevrotain-allstar/lib/index.js +0 -1
- package/dist/node_modules/langium/lib/default-module.js +0 -85
- package/dist/node_modules/langium/lib/dependency-injection.js +0 -62
- package/dist/node_modules/langium/lib/documentation/comment-provider.js +0 -11
- package/dist/node_modules/langium/lib/documentation/documentation-provider.js +0 -36
- package/dist/node_modules/langium/lib/documentation/jsdoc.js +0 -303
- package/dist/node_modules/langium/lib/index.js +0 -182
- package/dist/node_modules/langium/lib/languages/generated/ast.js +0 -1089
- package/dist/node_modules/langium/lib/languages/grammar-config.js +0 -13
- package/dist/node_modules/langium/lib/parser/async-parser.js +0 -83
- package/dist/node_modules/langium/lib/parser/completion-parser-builder.js +0 -7
- package/dist/node_modules/langium/lib/parser/cst-node-builder.js +0 -160
- package/dist/node_modules/langium/lib/parser/indentation-aware.js +0 -141
- package/dist/node_modules/langium/lib/parser/langium-parser-builder.js +0 -11
- package/dist/node_modules/langium/lib/parser/langium-parser.js +0 -388
- package/dist/node_modules/langium/lib/parser/lexer.js +0 -50
- package/dist/node_modules/langium/lib/parser/parser-builder-base.js +0 -275
- package/dist/node_modules/langium/lib/parser/token-builder.js +0 -61
- package/dist/node_modules/langium/lib/parser/value-converter.js +0 -78
- package/dist/node_modules/langium/lib/references/linker.js +0 -190
- package/dist/node_modules/langium/lib/references/name-provider.js +0 -13
- package/dist/node_modules/langium/lib/references/references.js +0 -76
- package/dist/node_modules/langium/lib/references/scope-computation.js +0 -35
- package/dist/node_modules/langium/lib/references/scope-provider.js +0 -34
- package/dist/node_modules/langium/lib/references/scope.js +0 -73
- package/dist/node_modules/langium/lib/serializer/hydrator.js +0 -125
- package/dist/node_modules/langium/lib/serializer/json-serializer.js +0 -145
- package/dist/node_modules/langium/lib/service-registry.js +0 -37
- package/dist/node_modules/langium/lib/syntax-tree.js +0 -70
- package/dist/node_modules/langium/lib/utils/ast-utils.js +0 -157
- package/dist/node_modules/langium/lib/utils/caching.js +0 -91
- package/dist/node_modules/langium/lib/utils/cancellation.js +0 -5
- package/dist/node_modules/langium/lib/utils/collections.js +0 -85
- package/dist/node_modules/langium/lib/utils/cst-utils.js +0 -190
- package/dist/node_modules/langium/lib/utils/disposable.js +0 -8
- package/dist/node_modules/langium/lib/utils/errors.js +0 -12
- package/dist/node_modules/langium/lib/utils/event.js +0 -5
- package/dist/node_modules/langium/lib/utils/grammar-loader.js +0 -22
- package/dist/node_modules/langium/lib/utils/grammar-utils.js +0 -296
- package/dist/node_modules/langium/lib/utils/index.js +0 -53
- package/dist/node_modules/langium/lib/utils/promise-utils.js +0 -30
- package/dist/node_modules/langium/lib/utils/regexp-utils.js +0 -167
- package/dist/node_modules/langium/lib/utils/stream.js +0 -327
- package/dist/node_modules/langium/lib/utils/uri-utils.js +0 -107
- package/dist/node_modules/langium/lib/validation/document-validator.js +0 -210
- package/dist/node_modules/langium/lib/validation/validation-registry.js +0 -87
- package/dist/node_modules/langium/lib/workspace/ast-descriptions.js +0 -57
- package/dist/node_modules/langium/lib/workspace/ast-node-locator.js +0 -28
- package/dist/node_modules/langium/lib/workspace/configuration.js +0 -51
- package/dist/node_modules/langium/lib/workspace/document-builder.js +0 -201
- package/dist/node_modules/langium/lib/workspace/documents.js +0 -142
- package/dist/node_modules/langium/lib/workspace/file-system-provider.js +0 -34
- package/dist/node_modules/langium/lib/workspace/index-manager.js +0 -49
- package/dist/node_modules/langium/lib/workspace/profiler.js +0 -89
- package/dist/node_modules/langium/lib/workspace/workspace-lock.js +0 -42
- package/dist/node_modules/langium/lib/workspace/workspace-manager.js +0 -66
- package/dist/node_modules/lodash-es/flatMap.js +0 -7
- package/dist/node_modules/lodash-es/uniqBy.js +0 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +0 -574
- package/dist/node_modules/vscode-jsonrpc/browser.js +0 -7
- package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -52
- package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -120
- package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +0 -337
- package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -57
- package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -647
- package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -13
- package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +0 -64
- package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +0 -34
- package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -235
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -93
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -129
- package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -85
- package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -161
- package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -18
- package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -44
- package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -58
- package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -28
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -36
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -12
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -31
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -33
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -35
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -674
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -126
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -24
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -31
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -11
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -19
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -15
- package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -42
- package/dist/node_modules/vscode-languageserver-textdocument/lib/esm/main.js +0 -138
- package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -1084
- package/dist/node_modules/vscode-uri/lib/esm/index.js +0 -373
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode-codepoint.js +0 -0
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode.js +0 -0
- /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/generated/decode-data-html.js +0 -0
- /package/dist/node_modules/{unified/node_modules/is-plain-obj → is-plain-obj}/index.js +0 -0
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const defaultLexerErrorProvider = {
|
|
2
|
-
buildUnableToPopLexerModeMessage(e) {
|
|
3
|
-
return `Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`;
|
|
4
|
-
},
|
|
5
|
-
buildUnexpectedCharactersMessage(e, t, n, r, i, a) {
|
|
6
|
-
return `unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`;
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
export { defaultLexerErrorProvider };
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { PRINT_WARNING } from "../../../../@chevrotain/utils/lib/src/print.js";
|
|
2
|
-
import { timer } from "../../../../@chevrotain/utils/lib/src/timer.js";
|
|
3
|
-
import { toFastProperties } from "../../../../@chevrotain/utils/lib/src/to-fast-properties.js";
|
|
4
|
-
import { clearRegExpParserCache } from "./reg_exp_parser.js";
|
|
5
|
-
import { DEFAULT_MODE, LineTerminatorOptimizedTester, analyzeTokenTypes, charCodeToOptimizedIndex, cloneEmptyGroups, performRuntimeChecks, performWarningRuntimeChecks, validatePatterns } from "./lexer.js";
|
|
6
|
-
import { augmentTokenTypes } from "./tokens.js";
|
|
7
|
-
import { defaultLexerErrorProvider } from "./lexer_errors_public.js";
|
|
8
|
-
var LexerDefinitionErrorType;
|
|
9
|
-
(function(e) {
|
|
10
|
-
e[e.MISSING_PATTERN = 0] = "MISSING_PATTERN", e[e.INVALID_PATTERN = 1] = "INVALID_PATTERN", e[e.EOI_ANCHOR_FOUND = 2] = "EOI_ANCHOR_FOUND", e[e.UNSUPPORTED_FLAGS_FOUND = 3] = "UNSUPPORTED_FLAGS_FOUND", e[e.DUPLICATE_PATTERNS_FOUND = 4] = "DUPLICATE_PATTERNS_FOUND", e[e.INVALID_GROUP_TYPE_FOUND = 5] = "INVALID_GROUP_TYPE_FOUND", e[e.PUSH_MODE_DOES_NOT_EXIST = 6] = "PUSH_MODE_DOES_NOT_EXIST", e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE", e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY", e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST", e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED", e[e.SOI_ANCHOR_FOUND = 11] = "SOI_ANCHOR_FOUND", e[e.EMPTY_MATCH_PATTERN = 12] = "EMPTY_MATCH_PATTERN", e[e.NO_LINE_BREAKS_FLAGS = 13] = "NO_LINE_BREAKS_FLAGS", e[e.UNREACHABLE_PATTERN = 14] = "UNREACHABLE_PATTERN", e[e.IDENTIFY_TERMINATOR = 15] = "IDENTIFY_TERMINATOR", e[e.CUSTOM_LINE_BREAK = 16] = "CUSTOM_LINE_BREAK", e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE = 17] = "MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";
|
|
11
|
-
})(LexerDefinitionErrorType ||= {});
|
|
12
|
-
var DEFAULT_LEXER_CONFIG = {
|
|
13
|
-
deferDefinitionErrorsHandling: !1,
|
|
14
|
-
positionTracking: "full",
|
|
15
|
-
lineTerminatorsPattern: /\n|\r\n?/g,
|
|
16
|
-
lineTerminatorCharacters: ["\n", "\r"],
|
|
17
|
-
ensureOptimizations: !1,
|
|
18
|
-
safeMode: !1,
|
|
19
|
-
errorMessageProvider: defaultLexerErrorProvider,
|
|
20
|
-
traceInitPerf: !1,
|
|
21
|
-
skipValidations: !1,
|
|
22
|
-
recoveryEnabled: !0
|
|
23
|
-
};
|
|
24
|
-
Object.freeze(DEFAULT_LEXER_CONFIG);
|
|
25
|
-
var Lexer = class {
|
|
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) => {
|
|
28
|
-
if (this.traceInitPerf === !0) {
|
|
29
|
-
this.traceInitIndent++;
|
|
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;
|
|
40
|
-
this.TRACE_INIT("Lexer Config handling", () => {
|
|
41
|
-
if (this.config.lineTerminatorsPattern === DEFAULT_LEXER_CONFIG.lineTerminatorsPattern) this.config.lineTerminatorsPattern = LineTerminatorOptimizedTester;
|
|
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");
|
|
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] },
|
|
46
|
-
defaultMode: DEFAULT_MODE
|
|
47
|
-
} : (p = !1, t = Object.assign({}, s));
|
|
48
|
-
}), this.config.skipValidations === !1 && (this.TRACE_INIT("performRuntimeChecks", () => {
|
|
49
|
-
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(performRuntimeChecks(t, this.trackStartLines, this.config.lineTerminatorCharacters));
|
|
50
|
-
}), this.TRACE_INIT("performWarningRuntimeChecks", () => {
|
|
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);
|
|
54
|
-
});
|
|
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);
|
|
62
|
-
let n;
|
|
63
|
-
this.TRACE_INIT("analyzeTokenTypes", () => {
|
|
64
|
-
n = analyzeTokenTypes(t, {
|
|
65
|
-
lineTerminatorCharacters: this.config.lineTerminatorCharacters,
|
|
66
|
-
positionTracking: c.positionTracking,
|
|
67
|
-
ensureOptimizations: c.ensureOptimizations,
|
|
68
|
-
safeMode: c.safeMode,
|
|
69
|
-
tracer: this.TRACE_INIT
|
|
70
|
-
});
|
|
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;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}), this.defaultMode = t.defaultMode, this.lexerDefinitionErrors.length > 0 && !this.config.deferDefinitionErrorsHandling) {
|
|
75
|
-
let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
|
|
76
|
-
throw Error("Errors detected in definition of Lexer:\n" + e);
|
|
77
|
-
}
|
|
78
|
-
this.lexerDefinitionWarning.forEach((t) => {
|
|
79
|
-
PRINT_WARNING(t.message);
|
|
80
|
-
}), this.TRACE_INIT("Choosing sub-methods implementations", () => {
|
|
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;
|
|
82
|
-
else if (/onlyStart/i.test(this.config.positionTracking)) this.createTokenInstance = this.createStartOnlyToken;
|
|
83
|
-
else if (/onlyOffset/i.test(this.config.positionTracking)) this.createTokenInstance = this.createOffsetOnlyToken;
|
|
84
|
-
else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);
|
|
85
|
-
this.hasCustom ? (this.addToken = this.addTokenUsingPush, this.handlePayload = this.handlePayloadWithCustom) : (this.addToken = this.addTokenUsingMemberAccess, this.handlePayload = this.handlePayloadNoCustom);
|
|
86
|
-
}), this.TRACE_INIT("Failed Optimization Warnings", () => {
|
|
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.
|
|
89
|
-
Or inspect the console log for details on how to resolve these issues.`);
|
|
90
|
-
}), this.TRACE_INIT("clearRegExpParserCache", () => {
|
|
91
|
-
clearRegExpParserCache();
|
|
92
|
-
}), this.TRACE_INIT("toFastProperties", () => {
|
|
93
|
-
toFastProperties(this);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
tokenize(e, t = this.defaultMode) {
|
|
98
|
-
if (this.lexerDefinitionErrors.length > 0) {
|
|
99
|
-
let e = this.lexerDefinitionErrors.map((e) => e.message).join("-----------------------\n");
|
|
100
|
-
throw Error("Unable to Tokenize because Errors detected in definition of Lexer:\n" + e);
|
|
101
|
-
}
|
|
102
|
-
return this.tokenizeInternal(e, t);
|
|
103
|
-
}
|
|
104
|
-
tokenizeInternal(e, t) {
|
|
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) {
|
|
109
|
-
let t = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);
|
|
110
|
-
T.push({
|
|
111
|
-
offset: e.startOffset,
|
|
112
|
-
line: e.startLine,
|
|
113
|
-
column: e.startColumn,
|
|
114
|
-
length: e.image.length,
|
|
115
|
-
message: t
|
|
116
|
-
});
|
|
117
|
-
} else {
|
|
118
|
-
P.pop();
|
|
119
|
-
let e = P.at(-1);
|
|
120
|
-
M = this.patternIdxToConfig[e], N = this.charCodeToPatternIdxToConfig[e], j = M.length;
|
|
121
|
-
let t = this.canModeBeOptimized[e] && this.config.safeMode === !1;
|
|
122
|
-
I = !!(N && t);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
function R(e) {
|
|
126
|
-
P.push(e), N = this.charCodeToPatternIdxToConfig[e], M = this.patternIdxToConfig[e], j = M.length, j = M.length;
|
|
127
|
-
let t = this.canModeBeOptimized[e] && this.config.safeMode === !1;
|
|
128
|
-
I = !!(N && t);
|
|
129
|
-
}
|
|
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);
|
|
148
|
-
let t = o.length;
|
|
149
|
-
for (i = 0; i < t; i++) {
|
|
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;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
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) {
|
|
162
|
-
let t = 0, n, r;
|
|
163
|
-
A.lastIndex = 0;
|
|
164
|
-
do
|
|
165
|
-
l = l === null ? e.substring(x, x + f) : l, n = A.test(l), n === !0 && (r = A.lastIndex - 1, t++);
|
|
166
|
-
while (n === !0);
|
|
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);
|
|
170
|
-
} else {
|
|
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;
|
|
175
|
-
}
|
|
176
|
-
if (g = x - t, D = this.computeNewColumn(D, g), _ = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(y, t, g, n, i, P.at(-1)), T.push({
|
|
177
|
-
offset: t,
|
|
178
|
-
line: n,
|
|
179
|
-
column: i,
|
|
180
|
-
length: g,
|
|
181
|
-
message: _
|
|
182
|
-
}), B === !1) break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return this.hasCustom || (w.length = S), {
|
|
186
|
-
tokens: w,
|
|
187
|
-
groups: O,
|
|
188
|
-
errors: T
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
handleModes(e, t, n, r) {
|
|
192
|
-
if (e.pop === !0) {
|
|
193
|
-
let i = e.push;
|
|
194
|
-
t(r), i !== void 0 && n.call(this, i);
|
|
195
|
-
} else e.push !== void 0 && n.call(this, e.push);
|
|
196
|
-
}
|
|
197
|
-
updateTokenEndLineColumnLocation(e, t, n, r, i, a, o) {
|
|
198
|
-
let s, c;
|
|
199
|
-
t !== void 0 && (s = n === o - 1, c = s ? -1 : 0, r === 1 && s === !0 || (e.endLine = i + c, e.endColumn = a - 1 + -c));
|
|
200
|
-
}
|
|
201
|
-
computeNewColumn(e, t) {
|
|
202
|
-
return e + t;
|
|
203
|
-
}
|
|
204
|
-
createOffsetOnlyToken(e, t, n, r) {
|
|
205
|
-
return {
|
|
206
|
-
image: e,
|
|
207
|
-
startOffset: t,
|
|
208
|
-
tokenTypeIdx: n,
|
|
209
|
-
tokenType: r
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
createStartOnlyToken(e, t, n, r, i, a) {
|
|
213
|
-
return {
|
|
214
|
-
image: e,
|
|
215
|
-
startOffset: t,
|
|
216
|
-
startLine: i,
|
|
217
|
-
startColumn: a,
|
|
218
|
-
tokenTypeIdx: n,
|
|
219
|
-
tokenType: r
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
createFullToken(e, t, n, r, i, a, o) {
|
|
223
|
-
return {
|
|
224
|
-
image: e,
|
|
225
|
-
startOffset: t,
|
|
226
|
-
endOffset: t + o - 1,
|
|
227
|
-
startLine: i,
|
|
228
|
-
endLine: i,
|
|
229
|
-
startColumn: a,
|
|
230
|
-
endColumn: a + o - 1,
|
|
231
|
-
tokenTypeIdx: n,
|
|
232
|
-
tokenType: r
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
addTokenUsingPush(e, t, n) {
|
|
236
|
-
return e.push(n), t;
|
|
237
|
-
}
|
|
238
|
-
addTokenUsingMemberAccess(e, t, n) {
|
|
239
|
-
return e[t] = n, t++, t;
|
|
240
|
-
}
|
|
241
|
-
handlePayloadNoCustom(e, t) {}
|
|
242
|
-
handlePayloadWithCustom(e, t) {
|
|
243
|
-
t !== null && (e.payload = t);
|
|
244
|
-
}
|
|
245
|
-
match(e, t, n) {
|
|
246
|
-
return e.test(t) === !0 ? t.substring(n, e.lastIndex) : null;
|
|
247
|
-
}
|
|
248
|
-
matchLength(e, t, n) {
|
|
249
|
-
return e.test(t) === !0 ? e.lastIndex - n : -1;
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
Lexer.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.", Lexer.NA = /NOT_APPLICABLE/;
|
|
253
|
-
export { Lexer, LexerDefinitionErrorType };
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { BaseRegExpVisitor } from "../../../../@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js";
|
|
2
|
-
import "../../../../@chevrotain/regexp-to-ast/lib/src/api.js";
|
|
3
|
-
import { PRINT_ERROR, PRINT_WARNING } from "../../../../@chevrotain/utils/lib/src/print.js";
|
|
4
|
-
import { getRegExpAst } from "./reg_exp_parser.js";
|
|
5
|
-
import { charCodeToOptimizedIndex, minOptimizationVal } from "./lexer.js";
|
|
6
|
-
var complementErrorMessage = "Complement Sets are not supported for first char optimization";
|
|
7
|
-
const failedOptimizationPrefixMsg = "Unable to use \"first char\" lexer optimizations:\n";
|
|
8
|
-
function getOptimizedStartCodesIndices(e, d = !1) {
|
|
9
|
-
try {
|
|
10
|
-
let c = getRegExpAst(e);
|
|
11
|
-
return firstCharOptimizedIndices(c.value, {}, c.flags.ignoreCase);
|
|
12
|
-
} catch (u) {
|
|
13
|
-
/* istanbul ignore next */
|
|
14
|
-
if (u.message === complementErrorMessage) d && PRINT_WARNING(`${failedOptimizationPrefixMsg}\tUnable to optimize: < ${e.toString()} >\n Complement Sets cannot be automatically optimized.
|
|
15
|
-
This will disable the lexer's first char optimizations.
|
|
16
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);
|
|
17
|
-
else {
|
|
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);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
function firstCharOptimizedIndices(e, c, l) {
|
|
25
|
-
switch (e.type) {
|
|
26
|
-
case "Disjunction":
|
|
27
|
-
for (let u = 0; u < e.value.length; u++) firstCharOptimizedIndices(e.value[u], c, l);
|
|
28
|
-
break;
|
|
29
|
-
case "Alternative":
|
|
30
|
-
let u = e.value;
|
|
31
|
-
for (let e = 0; e < u.length; e++) {
|
|
32
|
-
let f = u[e];
|
|
33
|
-
switch (f.type) {
|
|
34
|
-
case "EndAnchor":
|
|
35
|
-
case "GroupBackReference":
|
|
36
|
-
case "Lookahead":
|
|
37
|
-
case "NegativeLookahead":
|
|
38
|
-
case "Lookbehind":
|
|
39
|
-
case "NegativeLookbehind":
|
|
40
|
-
case "StartAnchor":
|
|
41
|
-
case "WordBoundary":
|
|
42
|
-
case "NonWordBoundary": continue;
|
|
43
|
-
}
|
|
44
|
-
let m = f;
|
|
45
|
-
switch (m.type) {
|
|
46
|
-
case "Character":
|
|
47
|
-
addOptimizedIdxToResult(m.value, c, l);
|
|
48
|
-
break;
|
|
49
|
-
case "Set":
|
|
50
|
-
if (m.complement === !0) throw Error(complementErrorMessage);
|
|
51
|
-
m.value.forEach((e) => {
|
|
52
|
-
if (typeof e == "number") addOptimizedIdxToResult(e, c, l);
|
|
53
|
-
else {
|
|
54
|
-
let u = e;
|
|
55
|
-
if (l === !0) for (let e = u.from; e <= u.to; e++) addOptimizedIdxToResult(e, c, l);
|
|
56
|
-
else {
|
|
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;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
break;
|
|
66
|
-
case "Group":
|
|
67
|
-
firstCharOptimizedIndices(m.value, c, l);
|
|
68
|
-
break;
|
|
69
|
-
default: throw Error("Non Exhaustive Match");
|
|
70
|
-
}
|
|
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;
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
default: throw Error("non exhaustive match!");
|
|
76
|
-
}
|
|
77
|
-
return Object.values(c);
|
|
78
|
-
}
|
|
79
|
-
function addOptimizedIdxToResult(e, c, l) {
|
|
80
|
-
let u = charCodeToOptimizedIndex(e);
|
|
81
|
-
c[u] = u, l === !0 && handleIgnoreCase(e, c);
|
|
82
|
-
}
|
|
83
|
-
function handleIgnoreCase(e, c) {
|
|
84
|
-
let l = String.fromCharCode(e), u = l.toUpperCase();
|
|
85
|
-
/* istanbul ignore else */
|
|
86
|
-
if (u !== l) {
|
|
87
|
-
let e = charCodeToOptimizedIndex(u.charCodeAt(0));
|
|
88
|
-
c[e] = e;
|
|
89
|
-
} else {
|
|
90
|
-
let e = l.toLowerCase();
|
|
91
|
-
if (e !== l) {
|
|
92
|
-
let l = charCodeToOptimizedIndex(e.charCodeAt(0));
|
|
93
|
-
c[l] = l;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
function findCode(e, c) {
|
|
98
|
-
return e.value.find((e) => {
|
|
99
|
-
if (typeof e == "number") return c.includes(e);
|
|
100
|
-
{
|
|
101
|
-
let l = e;
|
|
102
|
-
return c.find((e) => l.from <= e && e <= l.to) !== void 0;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
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;
|
|
109
|
-
}
|
|
110
|
-
var CharCodeFinder = class extends BaseRegExpVisitor {
|
|
111
|
-
constructor(e) {
|
|
112
|
-
super(), this.targetCharCodes = e, this.found = !1;
|
|
113
|
-
}
|
|
114
|
-
visitChildren(e) {
|
|
115
|
-
if (this.found !== !0) {
|
|
116
|
-
switch (e.type) {
|
|
117
|
-
case "Lookahead":
|
|
118
|
-
this.visitLookahead(e);
|
|
119
|
-
return;
|
|
120
|
-
case "NegativeLookahead":
|
|
121
|
-
this.visitNegativeLookahead(e);
|
|
122
|
-
return;
|
|
123
|
-
case "Lookbehind":
|
|
124
|
-
this.visitLookbehind(e);
|
|
125
|
-
return;
|
|
126
|
-
case "NegativeLookbehind":
|
|
127
|
-
this.visitNegativeLookbehind(e);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
super.visitChildren(e);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
visitCharacter(e) {
|
|
134
|
-
this.targetCharCodes.includes(e.value) && (this.found = !0);
|
|
135
|
-
}
|
|
136
|
-
visitSet(e) {
|
|
137
|
-
e.complement ? findCode(e, this.targetCharCodes) === void 0 && (this.found = !0) : findCode(e, this.targetCharCodes) !== void 0 && (this.found = !0);
|
|
138
|
-
}
|
|
139
|
-
};
|
|
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
|
-
}
|
|
152
|
-
export { canMatchCharCode, failedOptimizationPrefixMsg, getOptimizedStartCodesIndices };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RegExpParser } from "../../../../@chevrotain/regexp-to-ast/lib/src/regexp-parser.js";
|
|
2
|
-
import "../../../../@chevrotain/regexp-to-ast/lib/src/api.js";
|
|
3
|
-
var regExpAstCache = {}, regExpParser = new RegExpParser();
|
|
4
|
-
function getRegExpAst(e) {
|
|
5
|
-
let i = e.toString();
|
|
6
|
-
if (regExpAstCache.hasOwnProperty(i)) return regExpAstCache[i];
|
|
7
|
-
{
|
|
8
|
-
let e = regExpParser.pattern(i);
|
|
9
|
-
return regExpAstCache[i] = e, e;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function clearRegExpParserCache() {
|
|
13
|
-
regExpAstCache = {};
|
|
14
|
-
}
|
|
15
|
-
export { clearRegExpParserCache, getRegExpAst };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
function tokenStructuredMatcher(e, f) {
|
|
2
|
-
let p = e.tokenTypeIdx;
|
|
3
|
-
return p === f.tokenTypeIdx ? !0 : f.isParent === !0 && f.categoryMatchesMap[p] === !0;
|
|
4
|
-
}
|
|
5
|
-
function tokenStructuredMatcherNoCategories(e, f) {
|
|
6
|
-
return e.tokenTypeIdx === f.tokenTypeIdx;
|
|
7
|
-
}
|
|
8
|
-
let tokenShortNameIdx = 1;
|
|
9
|
-
const tokenIdxToClass = {};
|
|
10
|
-
function augmentTokenTypes(e) {
|
|
11
|
-
let f = expandCategories(e);
|
|
12
|
-
assignTokenDefaultProps(f), assignCategoriesMapProp(f), assignCategoriesTokensProp(f), f.forEach((e) => {
|
|
13
|
-
e.isParent = e.categoryMatches.length > 0;
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function expandCategories(e) {
|
|
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;
|
|
22
|
-
}
|
|
23
|
-
return f;
|
|
24
|
-
}
|
|
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 = {});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function assignCategoriesTokensProp(e) {
|
|
31
|
-
e.forEach((e) => {
|
|
32
|
-
e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((f) => {
|
|
33
|
-
e.categoryMatches.push(tokenIdxToClass[f].tokenTypeIdx);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function assignCategoriesMapProp(e) {
|
|
38
|
-
e.forEach((e) => {
|
|
39
|
-
singleAssignCategoriesToksMap([], e);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
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);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function hasShortKeyProperty(e) {
|
|
51
|
-
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
52
|
-
}
|
|
53
|
-
function hasCategoriesProperty(e) {
|
|
54
|
-
return Object.hasOwn(e ?? {}, "CATEGORIES");
|
|
55
|
-
}
|
|
56
|
-
function hasExtendingTokensTypesProperty(e) {
|
|
57
|
-
return Object.hasOwn(e ?? {}, "categoryMatches");
|
|
58
|
-
}
|
|
59
|
-
function hasExtendingTokensTypesMapProperty(e) {
|
|
60
|
-
return Object.hasOwn(e ?? {}, "categoryMatchesMap");
|
|
61
|
-
}
|
|
62
|
-
function isTokenType(e) {
|
|
63
|
-
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
64
|
-
}
|
|
65
|
-
export { augmentTokenTypes, hasShortKeyProperty, isTokenType, tokenStructuredMatcher, tokenStructuredMatcherNoCategories };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { augmentTokenTypes, tokenStructuredMatcher } from "./tokens.js";
|
|
2
|
-
import { Lexer } from "./lexer_public.js";
|
|
3
|
-
function tokenLabel(e) {
|
|
4
|
-
return hasTokenLabel(e) ? e.LABEL : e.name;
|
|
5
|
-
}
|
|
6
|
-
function hasTokenLabel(e) {
|
|
7
|
-
return typeof e.LABEL == "string" && e.LABEL !== "";
|
|
8
|
-
}
|
|
9
|
-
var PARENT = "parent", CATEGORIES = "categories", LABEL = "label", GROUP = "group", PUSH_MODE = "push_mode", POP_MODE = "pop_mode", LONGER_ALT = "longer_alt", LINE_BREAKS = "line_breaks", START_CHARS_HINT = "start_chars_hint";
|
|
10
|
-
function createToken(e) {
|
|
11
|
-
return createTokenInternal(e);
|
|
12
|
-
}
|
|
13
|
-
function createTokenInternal(f) {
|
|
14
|
-
let p = f.pattern, m = {};
|
|
15
|
-
if (m.name = f.name, p !== void 0 && (m.PATTERN = p), Object.hasOwn(f, PARENT)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
|
|
16
|
-
return Object.hasOwn(f, CATEGORIES) && (m.CATEGORIES = f[CATEGORIES]), augmentTokenTypes([m]), Object.hasOwn(f, LABEL) && (m.LABEL = f[LABEL]), Object.hasOwn(f, GROUP) && (m.GROUP = f[GROUP]), Object.hasOwn(f, POP_MODE) && (m.POP_MODE = f[POP_MODE]), Object.hasOwn(f, PUSH_MODE) && (m.PUSH_MODE = f[PUSH_MODE]), Object.hasOwn(f, LONGER_ALT) && (m.LONGER_ALT = f[LONGER_ALT]), Object.hasOwn(f, LINE_BREAKS) && (m.LINE_BREAKS = f[LINE_BREAKS]), Object.hasOwn(f, START_CHARS_HINT) && (m.START_CHARS_HINT = f[START_CHARS_HINT]), m;
|
|
17
|
-
}
|
|
18
|
-
const EOF = createToken({
|
|
19
|
-
name: "EOF",
|
|
20
|
-
pattern: Lexer.NA
|
|
21
|
-
});
|
|
22
|
-
augmentTokenTypes([EOF]);
|
|
23
|
-
function createTokenInstance(e, f, p, m, h, g, _, v) {
|
|
24
|
-
return {
|
|
25
|
-
image: f,
|
|
26
|
-
startOffset: p,
|
|
27
|
-
endOffset: m,
|
|
28
|
-
startLine: h,
|
|
29
|
-
endLine: g,
|
|
30
|
-
startColumn: _,
|
|
31
|
-
endColumn: v,
|
|
32
|
-
tokenTypeIdx: e.tokenTypeIdx,
|
|
33
|
-
tokenType: e
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function tokenMatcher(e, p) {
|
|
37
|
-
return tokenStructuredMatcher(e, p);
|
|
38
|
-
}
|
|
39
|
-
export { EOF, createToken, createTokenInstance, hasTokenLabel, tokenLabel, tokenMatcher };
|