@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,14 +0,0 @@
|
|
|
1
|
-
import { defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider } from "../../errors_public.js";
|
|
2
|
-
import { resolveGrammar } from "../resolver.js";
|
|
3
|
-
import { validateGrammar } from "../checks.js";
|
|
4
|
-
function resolveGrammar$1(n) {
|
|
5
|
-
let i = Object.assign({ errMsgProvider: defaultGrammarResolverErrorProvider }, n), a = {};
|
|
6
|
-
return n.rules.forEach((e) => {
|
|
7
|
-
a[e.name] = e;
|
|
8
|
-
}), resolveGrammar(a, i.errMsgProvider);
|
|
9
|
-
}
|
|
10
|
-
function validateGrammar$1(e) {
|
|
11
|
-
let r = e.errMsgProvider ?? defaultGrammarValidatorErrorProvider;
|
|
12
|
-
return validateGrammar(e.rules, e.tokenTypes, r, e.grammarName);
|
|
13
|
-
}
|
|
14
|
-
export { resolveGrammar$1 as resolveGrammar, validateGrammar$1 as validateGrammar };
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Rule, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
|
|
2
|
-
import { RestWalker } from "./rest.js";
|
|
3
|
-
import { first } from "./first.js";
|
|
4
|
-
var AbstractNextPossibleTokensWalker = class extends RestWalker {
|
|
5
|
-
constructor(e, a) {
|
|
6
|
-
super(), this.topProd = e, this.path = a, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
|
|
7
|
-
}
|
|
8
|
-
startWalking() {
|
|
9
|
-
if (this.found = !1, this.path.ruleStack[0] !== this.topProd.name) throw Error("The path does not start with the walker's top Rule!");
|
|
10
|
-
return this.ruleStack = [...this.path.ruleStack].reverse(), this.occurrenceStack = [...this.path.occurrenceStack].reverse(), this.ruleStack.pop(), this.occurrenceStack.pop(), this.updateExpectedNext(), this.walk(this.topProd), this.possibleTokTypes;
|
|
11
|
-
}
|
|
12
|
-
walk(e, a = []) {
|
|
13
|
-
this.found || super.walk(e, a);
|
|
14
|
-
}
|
|
15
|
-
walkProdRef(e, a, o) {
|
|
16
|
-
if (e.referencedRule.name === this.nextProductionName && e.idx === this.nextProductionOccurrence) {
|
|
17
|
-
let s = a.concat(o);
|
|
18
|
-
this.updateExpectedNext(), this.walk(e.referencedRule, s);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
updateExpectedNext() {
|
|
22
|
-
this.ruleStack.length === 0 ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
|
|
23
|
-
}
|
|
24
|
-
}, NextAfterTokenWalker = class extends AbstractNextPossibleTokensWalker {
|
|
25
|
-
constructor(e, a) {
|
|
26
|
-
super(e, a), this.path = a, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
|
|
27
|
-
}
|
|
28
|
-
walkTerminal(e, o, s) {
|
|
29
|
-
this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found && (this.possibleTokTypes = first(new Alternative({ definition: o.concat(s) })), this.found = !0);
|
|
30
|
-
}
|
|
31
|
-
}, AbstractNextTerminalAfterProductionWalker = class extends RestWalker {
|
|
32
|
-
constructor(e, a) {
|
|
33
|
-
super(), this.topRule = e, this.occurrence = a, this.result = {
|
|
34
|
-
token: void 0,
|
|
35
|
-
occurrence: void 0,
|
|
36
|
-
isEndOfRule: void 0
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
startWalking() {
|
|
40
|
-
return this.walk(this.topRule), this.result;
|
|
41
|
-
}
|
|
42
|
-
}, NextTerminalAfterManyWalker = class extends AbstractNextTerminalAfterProductionWalker {
|
|
43
|
-
walkMany(e, a, o) {
|
|
44
|
-
if (e.idx === this.occurrence) {
|
|
45
|
-
let e = a.concat(o)[0];
|
|
46
|
-
this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
47
|
-
} else super.walkMany(e, a, o);
|
|
48
|
-
}
|
|
49
|
-
}, NextTerminalAfterManySepWalker = class extends AbstractNextTerminalAfterProductionWalker {
|
|
50
|
-
walkManySep(e, a, o) {
|
|
51
|
-
if (e.idx === this.occurrence) {
|
|
52
|
-
let e = a.concat(o)[0];
|
|
53
|
-
this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
54
|
-
} else super.walkManySep(e, a, o);
|
|
55
|
-
}
|
|
56
|
-
}, NextTerminalAfterAtLeastOneWalker = class extends AbstractNextTerminalAfterProductionWalker {
|
|
57
|
-
walkAtLeastOne(e, a, o) {
|
|
58
|
-
if (e.idx === this.occurrence) {
|
|
59
|
-
let e = a.concat(o)[0];
|
|
60
|
-
this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
61
|
-
} else super.walkAtLeastOne(e, a, o);
|
|
62
|
-
}
|
|
63
|
-
}, NextTerminalAfterAtLeastOneSepWalker = class extends AbstractNextTerminalAfterProductionWalker {
|
|
64
|
-
walkAtLeastOneSep(e, a, o) {
|
|
65
|
-
if (e.idx === this.occurrence) {
|
|
66
|
-
let e = a.concat(o)[0];
|
|
67
|
-
this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
68
|
-
} else super.walkAtLeastOneSep(e, a, o);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
function possiblePathsFrom(u, d, f = []) {
|
|
72
|
-
f = [...f];
|
|
73
|
-
let p = [], m = 0;
|
|
74
|
-
function h(e) {
|
|
75
|
-
return e.concat(u.slice(m + 1));
|
|
76
|
-
}
|
|
77
|
-
function g(e) {
|
|
78
|
-
let a = possiblePathsFrom(h(e), d, f);
|
|
79
|
-
return p.concat(a);
|
|
80
|
-
}
|
|
81
|
-
for (; f.length < d && m < u.length;) {
|
|
82
|
-
let d = u[m];
|
|
83
|
-
if (d instanceof Alternative || d instanceof NonTerminal) return g(d.definition);
|
|
84
|
-
if (d instanceof Option) p = g(d.definition);
|
|
85
|
-
else if (d instanceof RepetitionMandatory) return g(d.definition.concat([new Repetition({ definition: d.definition })]));
|
|
86
|
-
else if (d instanceof RepetitionMandatoryWithSeparator) return g([new Alternative({ definition: d.definition }), new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]);
|
|
87
|
-
else if (d instanceof RepetitionWithSeparator) p = g(d.definition.concat([new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]));
|
|
88
|
-
else if (d instanceof Repetition) p = g(d.definition.concat([new Repetition({ definition: d.definition })]));
|
|
89
|
-
else if (d instanceof Alternation) return d.definition.forEach((e) => {
|
|
90
|
-
e.definition.length !== 0 && (p = g(e.definition));
|
|
91
|
-
}), p;
|
|
92
|
-
else if (d instanceof Terminal) f.push(d.terminalType);
|
|
93
|
-
else throw Error("non exhaustive match");
|
|
94
|
-
m++;
|
|
95
|
-
}
|
|
96
|
-
return p.push({
|
|
97
|
-
partialPath: f,
|
|
98
|
-
suffixDef: u.slice(m)
|
|
99
|
-
}), p;
|
|
100
|
-
}
|
|
101
|
-
function nextPossibleTokensAfter(d, f, p, m) {
|
|
102
|
-
let h = "EXIT_NONE_TERMINAL", g = [h], _ = "EXIT_ALTERNATIVE", v = !1, y = f.length, b = y - m - 1, x = [], S = [];
|
|
103
|
-
for (S.push({
|
|
104
|
-
idx: -1,
|
|
105
|
-
def: d,
|
|
106
|
-
ruleStack: [],
|
|
107
|
-
occurrenceStack: []
|
|
108
|
-
}); S.length !== 0;) {
|
|
109
|
-
let d = S.pop();
|
|
110
|
-
if (d === _) {
|
|
111
|
-
v && S.at(-1).idx <= b && S.pop();
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
let m = d.def, C = d.idx, w = d.ruleStack, T = d.occurrenceStack;
|
|
115
|
-
if (m.length === 0) continue;
|
|
116
|
-
let E = m[0];
|
|
117
|
-
/* istanbul ignore else */
|
|
118
|
-
if (E === h) {
|
|
119
|
-
let e = {
|
|
120
|
-
idx: C,
|
|
121
|
-
def: m.slice(1),
|
|
122
|
-
ruleStack: w.slice(0, -1),
|
|
123
|
-
occurrenceStack: T.slice(0, -1)
|
|
124
|
-
};
|
|
125
|
-
S.push(e);
|
|
126
|
-
} else if (E instanceof Terminal)
|
|
127
|
-
/* istanbul ignore else */
|
|
128
|
-
if (C < y - 1) {
|
|
129
|
-
let e = C + 1, a = f[e];
|
|
130
|
-
if (p(a, E.terminalType)) {
|
|
131
|
-
let a = {
|
|
132
|
-
idx: e,
|
|
133
|
-
def: m.slice(1),
|
|
134
|
-
ruleStack: w,
|
|
135
|
-
occurrenceStack: T
|
|
136
|
-
};
|
|
137
|
-
S.push(a);
|
|
138
|
-
}
|
|
139
|
-
} else if (C === y - 1) x.push({
|
|
140
|
-
nextTokenType: E.terminalType,
|
|
141
|
-
nextTokenOccurrence: E.idx,
|
|
142
|
-
ruleStack: w,
|
|
143
|
-
occurrenceStack: T
|
|
144
|
-
}), v = !0;
|
|
145
|
-
else throw Error("non exhaustive match");
|
|
146
|
-
else if (E instanceof NonTerminal) {
|
|
147
|
-
let e = [...w];
|
|
148
|
-
e.push(E.nonTerminalName);
|
|
149
|
-
let a = [...T];
|
|
150
|
-
a.push(E.idx);
|
|
151
|
-
let o = {
|
|
152
|
-
idx: C,
|
|
153
|
-
def: E.definition.concat(g, m.slice(1)),
|
|
154
|
-
ruleStack: e,
|
|
155
|
-
occurrenceStack: a
|
|
156
|
-
};
|
|
157
|
-
S.push(o);
|
|
158
|
-
} else if (E instanceof Option) {
|
|
159
|
-
let e = {
|
|
160
|
-
idx: C,
|
|
161
|
-
def: m.slice(1),
|
|
162
|
-
ruleStack: w,
|
|
163
|
-
occurrenceStack: T
|
|
164
|
-
};
|
|
165
|
-
S.push(e), S.push(_);
|
|
166
|
-
let a = {
|
|
167
|
-
idx: C,
|
|
168
|
-
def: E.definition.concat(m.slice(1)),
|
|
169
|
-
ruleStack: w,
|
|
170
|
-
occurrenceStack: T
|
|
171
|
-
};
|
|
172
|
-
S.push(a);
|
|
173
|
-
} else if (E instanceof RepetitionMandatory) {
|
|
174
|
-
let e = new Repetition({
|
|
175
|
-
definition: E.definition,
|
|
176
|
-
idx: E.idx
|
|
177
|
-
}), a = {
|
|
178
|
-
idx: C,
|
|
179
|
-
def: E.definition.concat([e], m.slice(1)),
|
|
180
|
-
ruleStack: w,
|
|
181
|
-
occurrenceStack: T
|
|
182
|
-
};
|
|
183
|
-
S.push(a);
|
|
184
|
-
} else if (E instanceof RepetitionMandatoryWithSeparator) {
|
|
185
|
-
let e = new Repetition({
|
|
186
|
-
definition: [new Terminal({ terminalType: E.separator })].concat(E.definition),
|
|
187
|
-
idx: E.idx
|
|
188
|
-
}), a = {
|
|
189
|
-
idx: C,
|
|
190
|
-
def: E.definition.concat([e], m.slice(1)),
|
|
191
|
-
ruleStack: w,
|
|
192
|
-
occurrenceStack: T
|
|
193
|
-
};
|
|
194
|
-
S.push(a);
|
|
195
|
-
} else if (E instanceof RepetitionWithSeparator) {
|
|
196
|
-
let e = {
|
|
197
|
-
idx: C,
|
|
198
|
-
def: m.slice(1),
|
|
199
|
-
ruleStack: w,
|
|
200
|
-
occurrenceStack: T
|
|
201
|
-
};
|
|
202
|
-
S.push(e), S.push(_);
|
|
203
|
-
let a = new Repetition({
|
|
204
|
-
definition: [new Terminal({ terminalType: E.separator })].concat(E.definition),
|
|
205
|
-
idx: E.idx
|
|
206
|
-
}), o = {
|
|
207
|
-
idx: C,
|
|
208
|
-
def: E.definition.concat([a], m.slice(1)),
|
|
209
|
-
ruleStack: w,
|
|
210
|
-
occurrenceStack: T
|
|
211
|
-
};
|
|
212
|
-
S.push(o);
|
|
213
|
-
} else if (E instanceof Repetition) {
|
|
214
|
-
let e = {
|
|
215
|
-
idx: C,
|
|
216
|
-
def: m.slice(1),
|
|
217
|
-
ruleStack: w,
|
|
218
|
-
occurrenceStack: T
|
|
219
|
-
};
|
|
220
|
-
S.push(e), S.push(_);
|
|
221
|
-
let a = new Repetition({
|
|
222
|
-
definition: E.definition,
|
|
223
|
-
idx: E.idx
|
|
224
|
-
}), o = {
|
|
225
|
-
idx: C,
|
|
226
|
-
def: E.definition.concat([a], m.slice(1)),
|
|
227
|
-
ruleStack: w,
|
|
228
|
-
occurrenceStack: T
|
|
229
|
-
};
|
|
230
|
-
S.push(o);
|
|
231
|
-
} else if (E instanceof Alternation) for (let e = E.definition.length - 1; e >= 0; e--) {
|
|
232
|
-
let a = {
|
|
233
|
-
idx: C,
|
|
234
|
-
def: E.definition[e].definition.concat(m.slice(1)),
|
|
235
|
-
ruleStack: w,
|
|
236
|
-
occurrenceStack: T
|
|
237
|
-
};
|
|
238
|
-
S.push(a), S.push(_);
|
|
239
|
-
}
|
|
240
|
-
else if (E instanceof Alternative) S.push({
|
|
241
|
-
idx: C,
|
|
242
|
-
def: E.definition.concat(m.slice(1)),
|
|
243
|
-
ruleStack: w,
|
|
244
|
-
occurrenceStack: T
|
|
245
|
-
});
|
|
246
|
-
else if (E instanceof Rule) S.push(expandTopLevelRule(E, C, w, T));
|
|
247
|
-
else throw Error("non exhaustive match");
|
|
248
|
-
}
|
|
249
|
-
return x;
|
|
250
|
-
}
|
|
251
|
-
function expandTopLevelRule(e, a, o, s) {
|
|
252
|
-
let c = [...o];
|
|
253
|
-
c.push(e.name);
|
|
254
|
-
let l = [...s];
|
|
255
|
-
return l.push(1), {
|
|
256
|
-
idx: a,
|
|
257
|
-
def: e.definition,
|
|
258
|
-
ruleStack: c,
|
|
259
|
-
occurrenceStack: l
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
export { NextAfterTokenWalker, NextTerminalAfterAtLeastOneSepWalker, NextTerminalAfterAtLeastOneWalker, NextTerminalAfterManySepWalker, NextTerminalAfterManyWalker, nextPossibleTokensAfter, possiblePathsFrom };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const BITS_FOR_METHOD_TYPE = 4, BITS_FOR_OCCURRENCE_IDX = 8, OR_IDX = 256, OPTION_IDX = 512, MANY_IDX = 768, AT_LEAST_ONE_IDX = 1024, MANY_SEP_IDX = 1280, AT_LEAST_ONE_SEP_IDX = 1536;
|
|
2
|
-
function getKeyForAutomaticLookahead(e, s, c) {
|
|
3
|
-
return c | s | e;
|
|
4
|
-
}
|
|
5
|
-
export { AT_LEAST_ONE_IDX, AT_LEAST_ONE_SEP_IDX, BITS_FOR_METHOD_TYPE, BITS_FOR_OCCURRENCE_IDX, MANY_IDX, MANY_SEP_IDX, OPTION_IDX, OR_IDX, getKeyForAutomaticLookahead };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defaultGrammarValidatorErrorProvider } from "../errors_public.js";
|
|
2
|
-
import { buildAlternativesLookAheadFunc, buildLookaheadFuncForOptionalProd, buildLookaheadFuncForOr, buildSingleAlternativeLookaheadFunction, getProdType } from "./lookahead.js";
|
|
3
|
-
import { validateAmbiguousAlternationAlternatives, validateEmptyOrAlternative, validateNoLeftRecursion, validateSomeNonEmptyLookaheadPath } from "./checks.js";
|
|
4
|
-
import { DEFAULT_PARSER_CONFIG } from "../parser/parser.js";
|
|
5
|
-
var LLkLookaheadStrategy = class {
|
|
6
|
-
constructor(e) {
|
|
7
|
-
this.maxLookahead = e?.maxLookahead ?? DEFAULT_PARSER_CONFIG.maxLookahead;
|
|
8
|
-
}
|
|
9
|
-
validate(e) {
|
|
10
|
-
let c = this.validateNoLeftRecursion(e.rules);
|
|
11
|
-
if (c.length === 0) {
|
|
12
|
-
let l = this.validateEmptyOrAlternatives(e.rules), u = this.validateAmbiguousAlternationAlternatives(e.rules, this.maxLookahead), d = this.validateSomeNonEmptyLookaheadPath(e.rules, this.maxLookahead);
|
|
13
|
-
return [
|
|
14
|
-
...c,
|
|
15
|
-
...l,
|
|
16
|
-
...u,
|
|
17
|
-
...d
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
|
-
return c;
|
|
21
|
-
}
|
|
22
|
-
validateNoLeftRecursion(c) {
|
|
23
|
-
return c.flatMap((c) => validateNoLeftRecursion(c, c, defaultGrammarValidatorErrorProvider));
|
|
24
|
-
}
|
|
25
|
-
validateEmptyOrAlternatives(c) {
|
|
26
|
-
return c.flatMap((c) => validateEmptyOrAlternative(c, defaultGrammarValidatorErrorProvider));
|
|
27
|
-
}
|
|
28
|
-
validateAmbiguousAlternationAlternatives(c, l) {
|
|
29
|
-
return c.flatMap((c) => validateAmbiguousAlternationAlternatives(c, l, defaultGrammarValidatorErrorProvider));
|
|
30
|
-
}
|
|
31
|
-
validateSomeNonEmptyLookaheadPath(c, l) {
|
|
32
|
-
return validateSomeNonEmptyLookaheadPath(c, l, defaultGrammarValidatorErrorProvider);
|
|
33
|
-
}
|
|
34
|
-
buildLookaheadForAlternation(e) {
|
|
35
|
-
return buildLookaheadFuncForOr(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, buildAlternativesLookAheadFunc);
|
|
36
|
-
}
|
|
37
|
-
buildLookaheadForOptional(e) {
|
|
38
|
-
return buildLookaheadFuncForOptionalProd(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled, getProdType(e.prodType), buildSingleAlternativeLookaheadFunction);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
export { LLkLookaheadStrategy };
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { Alternation, Alternative, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator } from "../../../../../@chevrotain/gast/lib/src/model.js";
|
|
2
|
-
import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
|
|
3
|
-
import { RestWalker } from "./rest.js";
|
|
4
|
-
import { tokenStructuredMatcher, tokenStructuredMatcherNoCategories } from "../../scan/tokens.js";
|
|
5
|
-
import { possiblePathsFrom } from "./interpreter.js";
|
|
6
|
-
var PROD_TYPE;
|
|
7
|
-
(function(e) {
|
|
8
|
-
e[e.OPTION = 0] = "OPTION", e[e.REPETITION = 1] = "REPETITION", e[e.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", e[e.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", e[e.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", e[e.ALTERNATION = 5] = "ALTERNATION";
|
|
9
|
-
})(PROD_TYPE ||= {});
|
|
10
|
-
function getProdType(b) {
|
|
11
|
-
/* istanbul ignore else */
|
|
12
|
-
if (b instanceof Option || b === "Option") return PROD_TYPE.OPTION;
|
|
13
|
-
if (b instanceof Repetition || b === "Repetition") return PROD_TYPE.REPETITION;
|
|
14
|
-
if (b instanceof RepetitionMandatory || b === "RepetitionMandatory") return PROD_TYPE.REPETITION_MANDATORY;
|
|
15
|
-
if (b instanceof RepetitionMandatoryWithSeparator || b === "RepetitionMandatoryWithSeparator") return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR;
|
|
16
|
-
if (b instanceof RepetitionWithSeparator || b === "RepetitionWithSeparator") return PROD_TYPE.REPETITION_WITH_SEPARATOR;
|
|
17
|
-
if (b instanceof Alternation || b === "Alternation") return PROD_TYPE.ALTERNATION;
|
|
18
|
-
throw Error("non exhaustive match");
|
|
19
|
-
}
|
|
20
|
-
function getLookaheadPaths(e) {
|
|
21
|
-
let { occurrence: b, rule: x, prodType: S, maxLookahead: C } = e, w = getProdType(S);
|
|
22
|
-
return w === PROD_TYPE.ALTERNATION ? getLookaheadPathsForOr(b, x, C) : getLookaheadPathsForOptionalProd(b, x, w, C);
|
|
23
|
-
}
|
|
24
|
-
function buildLookaheadFuncForOr(e, b, x, S, C, w) {
|
|
25
|
-
let T = getLookaheadPathsForOr(e, b, x);
|
|
26
|
-
return w(T, S, areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, C);
|
|
27
|
-
}
|
|
28
|
-
function buildLookaheadFuncForOptionalProd(e, b, x, S, C, w) {
|
|
29
|
-
let T = getLookaheadPathsForOptionalProd(e, b, C, x), E = areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
|
|
30
|
-
return w(T[0], E, S);
|
|
31
|
-
}
|
|
32
|
-
function buildAlternativesLookAheadFunc(e, b, x, S) {
|
|
33
|
-
let C = e.length, w = e.every((e) => e.every((e) => e.length === 1));
|
|
34
|
-
if (b) return function(b) {
|
|
35
|
-
let S = b.map((e) => e.GATE);
|
|
36
|
-
for (let b = 0; b < C; b++) {
|
|
37
|
-
let C = e[b], w = C.length, T = S[b];
|
|
38
|
-
if (!(T !== void 0 && T.call(this) === !1)) nextPath: for (let e = 0; e < w; e++) {
|
|
39
|
-
let S = C[e], w = S.length;
|
|
40
|
-
for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
|
|
41
|
-
return b;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
if (w && !S) {
|
|
46
|
-
let b = e.map((e) => e.flat()).reduce((e, b, x) => (b.forEach((b) => {
|
|
47
|
-
b.tokenTypeIdx in e || (e[b.tokenTypeIdx] = x), b.categoryMatches.forEach((b) => {
|
|
48
|
-
Object.hasOwn(e, b) || (e[b] = x);
|
|
49
|
-
});
|
|
50
|
-
}), e), {});
|
|
51
|
-
return function() {
|
|
52
|
-
return b[this.LA_FAST(1).tokenTypeIdx];
|
|
53
|
-
};
|
|
54
|
-
} else return function() {
|
|
55
|
-
for (let b = 0; b < C; b++) {
|
|
56
|
-
let S = e[b], C = S.length;
|
|
57
|
-
nextPath: for (let e = 0; e < C; e++) {
|
|
58
|
-
let C = S[e], w = C.length;
|
|
59
|
-
for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), C[e]) === !1) continue nextPath;
|
|
60
|
-
return b;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function buildSingleAlternativeLookaheadFunction(e, b, x) {
|
|
66
|
-
let S = e.every((e) => e.length === 1), C = e.length;
|
|
67
|
-
if (S && !x) {
|
|
68
|
-
let b = e.flat();
|
|
69
|
-
if (b.length === 1 && b[0].categoryMatches.length === 0) {
|
|
70
|
-
let e = b[0].tokenTypeIdx;
|
|
71
|
-
return function() {
|
|
72
|
-
return this.LA_FAST(1).tokenTypeIdx === e;
|
|
73
|
-
};
|
|
74
|
-
} else {
|
|
75
|
-
let e = b.reduce((e, b, x) => (e[b.tokenTypeIdx] = !0, b.categoryMatches.forEach((b) => {
|
|
76
|
-
e[b] = !0;
|
|
77
|
-
}), e), []);
|
|
78
|
-
return function() {
|
|
79
|
-
return e[this.LA_FAST(1).tokenTypeIdx] === !0;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
} else return function() {
|
|
83
|
-
nextPath: for (let x = 0; x < C; x++) {
|
|
84
|
-
let S = e[x], C = S.length;
|
|
85
|
-
for (let e = 0; e < C; e++) if (b(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
|
|
86
|
-
return !0;
|
|
87
|
-
}
|
|
88
|
-
return !1;
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
var RestDefinitionFinderWalker = class extends RestWalker {
|
|
92
|
-
constructor(e, b, x) {
|
|
93
|
-
super(), this.topProd = e, this.targetOccurrence = b, this.targetProdType = x;
|
|
94
|
-
}
|
|
95
|
-
startWalking() {
|
|
96
|
-
return this.walk(this.topProd), this.restDef;
|
|
97
|
-
}
|
|
98
|
-
checkIsTarget(e, b, x, S) {
|
|
99
|
-
return e.idx === this.targetOccurrence && this.targetProdType === b ? (this.restDef = x.concat(S), !0) : !1;
|
|
100
|
-
}
|
|
101
|
-
walkOption(e, b, x) {
|
|
102
|
-
this.checkIsTarget(e, PROD_TYPE.OPTION, b, x) || super.walkOption(e, b, x);
|
|
103
|
-
}
|
|
104
|
-
walkAtLeastOne(e, b, x) {
|
|
105
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY, b, x) || super.walkOption(e, b, x);
|
|
106
|
-
}
|
|
107
|
-
walkAtLeastOneSep(e, b, x) {
|
|
108
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
|
|
109
|
-
}
|
|
110
|
-
walkMany(e, b, x) {
|
|
111
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION, b, x) || super.walkOption(e, b, x);
|
|
112
|
-
}
|
|
113
|
-
walkManySep(e, b, x) {
|
|
114
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
|
|
115
|
-
}
|
|
116
|
-
}, InsideDefinitionFinderVisitor = class extends GAstVisitor {
|
|
117
|
-
constructor(e, b, x) {
|
|
118
|
-
super(), this.targetOccurrence = e, this.targetProdType = b, this.targetRef = x, this.result = [];
|
|
119
|
-
}
|
|
120
|
-
checkIsTarget(e, b) {
|
|
121
|
-
e.idx === this.targetOccurrence && this.targetProdType === b && (this.targetRef === void 0 || e === this.targetRef) && (this.result = e.definition);
|
|
122
|
-
}
|
|
123
|
-
visitOption(e) {
|
|
124
|
-
this.checkIsTarget(e, PROD_TYPE.OPTION);
|
|
125
|
-
}
|
|
126
|
-
visitRepetition(e) {
|
|
127
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION);
|
|
128
|
-
}
|
|
129
|
-
visitRepetitionMandatory(e) {
|
|
130
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY);
|
|
131
|
-
}
|
|
132
|
-
visitRepetitionMandatoryWithSeparator(e) {
|
|
133
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR);
|
|
134
|
-
}
|
|
135
|
-
visitRepetitionWithSeparator(e) {
|
|
136
|
-
this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR);
|
|
137
|
-
}
|
|
138
|
-
visitAlternation(e) {
|
|
139
|
-
this.checkIsTarget(e, PROD_TYPE.ALTERNATION);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
function initializeArrayOfArrays(e) {
|
|
143
|
-
let b = Array(e);
|
|
144
|
-
for (let x = 0; x < e; x++) b[x] = [];
|
|
145
|
-
return b;
|
|
146
|
-
}
|
|
147
|
-
function pathToHashKeys(e) {
|
|
148
|
-
let b = [""];
|
|
149
|
-
for (let x = 0; x < e.length; x++) {
|
|
150
|
-
let S = e[x], C = [];
|
|
151
|
-
for (let e = 0; e < b.length; e++) {
|
|
152
|
-
let x = b[e];
|
|
153
|
-
C.push(x + "_" + S.tokenTypeIdx);
|
|
154
|
-
for (let e = 0; e < S.categoryMatches.length; e++) {
|
|
155
|
-
let b = "_" + S.categoryMatches[e];
|
|
156
|
-
C.push(x + b);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
b = C;
|
|
160
|
-
}
|
|
161
|
-
return b;
|
|
162
|
-
}
|
|
163
|
-
function isUniquePrefixHash(e, b, x) {
|
|
164
|
-
for (let S = 0; S < e.length; S++) {
|
|
165
|
-
if (S === x) continue;
|
|
166
|
-
let C = e[S];
|
|
167
|
-
for (let e = 0; e < b.length; e++) if (C[b[e]] === !0) return !1;
|
|
168
|
-
}
|
|
169
|
-
return !0;
|
|
170
|
-
}
|
|
171
|
-
function lookAheadSequenceFromAlternatives(e, b) {
|
|
172
|
-
let x = e.map((e) => possiblePathsFrom([e], 1)), S = initializeArrayOfArrays(x.length), C = x.map((e) => {
|
|
173
|
-
let b = {};
|
|
174
|
-
return e.forEach((e) => {
|
|
175
|
-
pathToHashKeys(e.partialPath).forEach((e) => {
|
|
176
|
-
b[e] = !0;
|
|
177
|
-
});
|
|
178
|
-
}), b;
|
|
179
|
-
}), w = x;
|
|
180
|
-
for (let e = 1; e <= b; e++) {
|
|
181
|
-
let x = w;
|
|
182
|
-
w = initializeArrayOfArrays(x.length);
|
|
183
|
-
for (let T = 0; T < x.length; T++) {
|
|
184
|
-
let E = x[T];
|
|
185
|
-
for (let x = 0; x < E.length; x++) {
|
|
186
|
-
let D = E[x].partialPath, O = E[x].suffixDef, k = pathToHashKeys(D);
|
|
187
|
-
if (isUniquePrefixHash(C, k, T) || O.length === 0 || D.length === b) {
|
|
188
|
-
let e = S[T];
|
|
189
|
-
if (containsPath(e, D) === !1) {
|
|
190
|
-
e.push(D);
|
|
191
|
-
for (let e = 0; e < k.length; e++) {
|
|
192
|
-
let b = k[e];
|
|
193
|
-
C[T][b] = !0;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
let b = possiblePathsFrom(O, e + 1, D);
|
|
198
|
-
w[T] = w[T].concat(b), b.forEach((e) => {
|
|
199
|
-
pathToHashKeys(e.partialPath).forEach((e) => {
|
|
200
|
-
C[T][e] = !0;
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return S;
|
|
208
|
-
}
|
|
209
|
-
function getLookaheadPathsForOr(e, b, x, S) {
|
|
210
|
-
let C = new InsideDefinitionFinderVisitor(e, PROD_TYPE.ALTERNATION, S);
|
|
211
|
-
return b.accept(C), lookAheadSequenceFromAlternatives(C.result, x);
|
|
212
|
-
}
|
|
213
|
-
function getLookaheadPathsForOptionalProd(e, x, S, C) {
|
|
214
|
-
let w = new InsideDefinitionFinderVisitor(e, S);
|
|
215
|
-
x.accept(w);
|
|
216
|
-
let T = w.result, E = new RestDefinitionFinderWalker(x, e, S).startWalking();
|
|
217
|
-
return lookAheadSequenceFromAlternatives([new Alternative({ definition: T }), new Alternative({ definition: E })], C);
|
|
218
|
-
}
|
|
219
|
-
function containsPath(e, b) {
|
|
220
|
-
compareOtherPath: for (let x = 0; x < e.length; x++) {
|
|
221
|
-
let S = e[x];
|
|
222
|
-
if (S.length === b.length) {
|
|
223
|
-
for (let e = 0; e < S.length; e++) {
|
|
224
|
-
let x = b[e], C = S[e];
|
|
225
|
-
if (!(x === C || C.categoryMatchesMap[x.tokenTypeIdx] !== void 0)) continue compareOtherPath;
|
|
226
|
-
}
|
|
227
|
-
return !0;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return !1;
|
|
231
|
-
}
|
|
232
|
-
function isStrictPrefixOfPath(e, b) {
|
|
233
|
-
return e.length < b.length && e.every((e, x) => {
|
|
234
|
-
let S = b[x];
|
|
235
|
-
return e === S || S.categoryMatchesMap[e.tokenTypeIdx];
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
function areTokenCategoriesNotUsed(e) {
|
|
239
|
-
return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
|
|
240
|
-
}
|
|
241
|
-
export { PROD_TYPE, buildAlternativesLookAheadFunc, buildLookaheadFuncForOptionalProd, buildLookaheadFuncForOr, buildSingleAlternativeLookaheadFunction, containsPath, getLookaheadPaths, getLookaheadPathsForOptionalProd, getLookaheadPathsForOr, getProdType, isStrictPrefixOfPath };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
|
|
2
|
-
import { ParserDefinitionErrorType } from "../parser/parser.js";
|
|
3
|
-
function resolveGrammar(e, n) {
|
|
4
|
-
let r = new GastRefResolverVisitor(e, n);
|
|
5
|
-
return r.resolveRefs(), r.errors;
|
|
6
|
-
}
|
|
7
|
-
var GastRefResolverVisitor = class extends GAstVisitor {
|
|
8
|
-
constructor(e, n) {
|
|
9
|
-
super(), this.nameToTopRule = e, this.errMsgProvider = n, this.errors = [];
|
|
10
|
-
}
|
|
11
|
-
resolveRefs() {
|
|
12
|
-
Object.values(this.nameToTopRule).forEach((e) => {
|
|
13
|
-
this.currTopLevel = e, e.accept(this);
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
visitNonTerminal(e) {
|
|
17
|
-
let r = this.nameToTopRule[e.nonTerminalName];
|
|
18
|
-
if (r) e.referencedRule = r;
|
|
19
|
-
else {
|
|
20
|
-
let r = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, e);
|
|
21
|
-
this.errors.push({
|
|
22
|
-
message: r,
|
|
23
|
-
type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,
|
|
24
|
-
ruleName: this.currTopLevel.name,
|
|
25
|
-
unresolvedRefName: e.nonTerminalName
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export { resolveGrammar };
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
|
|
2
|
-
var RestWalker = class {
|
|
3
|
-
walk(l, u = []) {
|
|
4
|
-
l.definition.forEach((d, f) => {
|
|
5
|
-
let p = l.definition.slice(f + 1);
|
|
6
|
-
/* istanbul ignore else */
|
|
7
|
-
if (d instanceof NonTerminal) this.walkProdRef(d, p, u);
|
|
8
|
-
else if (d instanceof Terminal) this.walkTerminal(d, p, u);
|
|
9
|
-
else if (d instanceof Alternative) this.walkFlat(d, p, u);
|
|
10
|
-
else if (d instanceof Option) this.walkOption(d, p, u);
|
|
11
|
-
else if (d instanceof RepetitionMandatory) this.walkAtLeastOne(d, p, u);
|
|
12
|
-
else if (d instanceof RepetitionMandatoryWithSeparator) this.walkAtLeastOneSep(d, p, u);
|
|
13
|
-
else if (d instanceof RepetitionWithSeparator) this.walkManySep(d, p, u);
|
|
14
|
-
else if (d instanceof Repetition) this.walkMany(d, p, u);
|
|
15
|
-
else if (d instanceof Alternation) this.walkOr(d, p, u);
|
|
16
|
-
else throw Error("non exhaustive match");
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
walkTerminal(e, a, o) {}
|
|
20
|
-
walkProdRef(e, a, o) {}
|
|
21
|
-
walkFlat(e, a, o) {
|
|
22
|
-
let s = a.concat(o);
|
|
23
|
-
this.walk(e, s);
|
|
24
|
-
}
|
|
25
|
-
walkOption(e, a, o) {
|
|
26
|
-
let s = a.concat(o);
|
|
27
|
-
this.walk(e, s);
|
|
28
|
-
}
|
|
29
|
-
walkAtLeastOne(e, a, o) {
|
|
30
|
-
let c = [new Option({ definition: e.definition })].concat(a, o);
|
|
31
|
-
this.walk(e, c);
|
|
32
|
-
}
|
|
33
|
-
walkAtLeastOneSep(e, a, o) {
|
|
34
|
-
let s = restForRepetitionWithSeparator(e, a, o);
|
|
35
|
-
this.walk(e, s);
|
|
36
|
-
}
|
|
37
|
-
walkMany(e, a, o) {
|
|
38
|
-
let c = [new Option({ definition: e.definition })].concat(a, o);
|
|
39
|
-
this.walk(e, c);
|
|
40
|
-
}
|
|
41
|
-
walkManySep(e, a, o) {
|
|
42
|
-
let s = restForRepetitionWithSeparator(e, a, o);
|
|
43
|
-
this.walk(e, s);
|
|
44
|
-
}
|
|
45
|
-
walkOr(e, o, s) {
|
|
46
|
-
let c = o.concat(s);
|
|
47
|
-
e.definition.forEach((e) => {
|
|
48
|
-
let o = new Alternative({ definition: [e] });
|
|
49
|
-
this.walk(o, c);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function restForRepetitionWithSeparator(e, a, o) {
|
|
54
|
-
return [new Option({ definition: [new Terminal({ terminalType: e.separator })].concat(e.definition) })].concat(a, o);
|
|
55
|
-
}
|
|
56
|
-
export { RestWalker };
|