@loopstack/loopstack-studio 0.27.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/ai-elements/code-block.js +2 -2
- package/dist/components/dynamic-form/Form.js +49 -52
- package/dist/components/loopstack-elements/tool.js +18 -9
- 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/DocumentRenderer.js +2 -2
- package/dist/features/documents/components/DocumentList.js +19 -18
- package/dist/features/documents/renderers/LlmMessage.js +89 -0
- 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 +301 -209
- 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/features/documents/renderers/ClaudeMessage.js +0 -96
- 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,13 +0,0 @@
|
|
|
1
|
-
import { isTerminalRule } from "./generated/ast.js";
|
|
2
|
-
import { DefaultNameRegexp } from "../utils/cst-utils.js";
|
|
3
|
-
import { isMultilineComment } from "../utils/regexp-utils.js";
|
|
4
|
-
import { isCommentTerminal, terminalRegex } from "../utils/grammar-utils.js";
|
|
5
|
-
function createGrammarConfig(a) {
|
|
6
|
-
let o = [], s = a.Grammar;
|
|
7
|
-
for (let i of s.rules) isTerminalRule(i) && isCommentTerminal(i) && isMultilineComment(terminalRegex(i)) && o.push(i.name);
|
|
8
|
-
return {
|
|
9
|
-
multilineCommentRules: o,
|
|
10
|
-
nameRegexp: DefaultNameRegexp
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export { createGrammarConfig };
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Deferred, OperationCancelled } from "../utils/promise-utils.js";
|
|
2
|
-
import { event_exports } from "../utils/event.js";
|
|
3
|
-
var DefaultAsyncParser = class {
|
|
4
|
-
constructor(e) {
|
|
5
|
-
this.syncParser = e.parser.LangiumParser;
|
|
6
|
-
}
|
|
7
|
-
parse(e, t) {
|
|
8
|
-
return Promise.resolve(this.syncParser.parse(e));
|
|
9
|
-
}
|
|
10
|
-
}, AbstractThreadedAsyncParser = class {
|
|
11
|
-
constructor(e) {
|
|
12
|
-
this.threadCount = 8, this.terminationDelay = 200, this.workerPool = [], this.queue = [], this.hydrator = e.serializer.Hydrator;
|
|
13
|
-
}
|
|
14
|
-
initializeWorkers() {
|
|
15
|
-
for (; this.workerPool.length < this.threadCount;) {
|
|
16
|
-
let e = this.createWorker();
|
|
17
|
-
e.onReady(() => {
|
|
18
|
-
if (this.queue.length > 0) {
|
|
19
|
-
let t = this.queue.shift();
|
|
20
|
-
t && (e.lock(), t.resolve(e));
|
|
21
|
-
}
|
|
22
|
-
}), this.workerPool.push(e);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async parse(t, n) {
|
|
26
|
-
let r = await this.acquireParserWorker(n), i = new Deferred(), a, o = n.onCancellationRequested(() => {
|
|
27
|
-
a = setTimeout(() => {
|
|
28
|
-
this.terminateWorker(r);
|
|
29
|
-
}, this.terminationDelay);
|
|
30
|
-
});
|
|
31
|
-
return r.parse(t).then((e) => {
|
|
32
|
-
let t = this.hydrator.hydrate(e);
|
|
33
|
-
i.resolve(t);
|
|
34
|
-
}).catch((e) => {
|
|
35
|
-
i.reject(e);
|
|
36
|
-
}).finally(() => {
|
|
37
|
-
o.dispose(), clearTimeout(a);
|
|
38
|
-
}), i.promise;
|
|
39
|
-
}
|
|
40
|
-
terminateWorker(e) {
|
|
41
|
-
e.terminate();
|
|
42
|
-
let t = this.workerPool.indexOf(e);
|
|
43
|
-
t >= 0 && this.workerPool.splice(t, 1);
|
|
44
|
-
}
|
|
45
|
-
async acquireParserWorker(n) {
|
|
46
|
-
this.initializeWorkers();
|
|
47
|
-
for (let e of this.workerPool) if (e.ready) return e.lock(), e;
|
|
48
|
-
let r = new Deferred();
|
|
49
|
-
return n.onCancellationRequested(() => {
|
|
50
|
-
let e = this.queue.indexOf(r);
|
|
51
|
-
e >= 0 && this.queue.splice(e, 1), r.reject(OperationCancelled);
|
|
52
|
-
}), this.queue.push(r), r.promise;
|
|
53
|
-
}
|
|
54
|
-
}, ParserWorker = class {
|
|
55
|
-
get ready() {
|
|
56
|
-
return this._ready;
|
|
57
|
-
}
|
|
58
|
-
get onReady() {
|
|
59
|
-
return this.onReadyEmitter.event;
|
|
60
|
-
}
|
|
61
|
-
constructor(t, r, i, a) {
|
|
62
|
-
this.onReadyEmitter = new event_exports.Emitter(), this.deferred = new Deferred(), this._ready = !0, this._parsing = !1, this.sendMessage = t, this._terminate = a, r((e) => {
|
|
63
|
-
let t = e;
|
|
64
|
-
this.deferred.resolve(t), this.unlock();
|
|
65
|
-
}), i((e) => {
|
|
66
|
-
this.deferred.reject(e), this.unlock();
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
terminate() {
|
|
70
|
-
this.deferred.reject(OperationCancelled), this._terminate();
|
|
71
|
-
}
|
|
72
|
-
lock() {
|
|
73
|
-
this._ready = !1;
|
|
74
|
-
}
|
|
75
|
-
unlock() {
|
|
76
|
-
this._parsing = !1, this._ready = !0, this.onReadyEmitter.fire();
|
|
77
|
-
}
|
|
78
|
-
parse(t) {
|
|
79
|
-
if (this._parsing) throw Error("Parser worker is busy");
|
|
80
|
-
return this._parsing = !0, this.deferred = new Deferred(), this.sendMessage(t), this.deferred.promise;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
export { AbstractThreadedAsyncParser, DefaultAsyncParser, ParserWorker };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LangiumCompletionParser } from "./langium-parser.js";
|
|
2
|
-
import { createParser } from "./parser-builder-base.js";
|
|
3
|
-
function createCompletionParser(n) {
|
|
4
|
-
let r = n.Grammar, i = n.parser.Lexer, a = new LangiumCompletionParser(n);
|
|
5
|
-
return createParser(r, a, i.definition), a.finalize(), a;
|
|
6
|
-
}
|
|
7
|
-
export { createCompletionParser };
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { tokenToRange } from "../utils/cst-utils.js";
|
|
2
|
-
import { Position, init_main } from "../../../vscode-languageserver-types/lib/esm/main.js";
|
|
3
|
-
init_main();
|
|
4
|
-
var CstNodeBuilder = class {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.nodeStack = [];
|
|
7
|
-
}
|
|
8
|
-
get current() {
|
|
9
|
-
return this.nodeStack[this.nodeStack.length - 1] ?? this.rootNode;
|
|
10
|
-
}
|
|
11
|
-
buildRootNode(e) {
|
|
12
|
-
return this.rootNode = new RootCstNodeImpl(e), this.rootNode.root = this.rootNode, this.nodeStack = [this.rootNode], this.rootNode;
|
|
13
|
-
}
|
|
14
|
-
buildCompositeNode(e) {
|
|
15
|
-
let a = new CompositeCstNodeImpl();
|
|
16
|
-
return a.grammarSource = e, a.root = this.rootNode, this.current.content.push(a), this.nodeStack.push(a), a;
|
|
17
|
-
}
|
|
18
|
-
buildLeafNode(a, o) {
|
|
19
|
-
let s = new LeafCstNodeImpl(a.startOffset, a.image.length, tokenToRange(a), a.tokenType, !o);
|
|
20
|
-
return s.grammarSource = o, s.root = this.rootNode, this.current.content.push(s), s;
|
|
21
|
-
}
|
|
22
|
-
removeNode(e) {
|
|
23
|
-
let a = e.container;
|
|
24
|
-
if (a) {
|
|
25
|
-
let o = a.content.indexOf(e);
|
|
26
|
-
o >= 0 && a.content.splice(o, 1);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
addHiddenNodes(a) {
|
|
30
|
-
let o = [];
|
|
31
|
-
for (let s of a) {
|
|
32
|
-
let a = new LeafCstNodeImpl(s.startOffset, s.image.length, tokenToRange(s), s.tokenType, !0);
|
|
33
|
-
a.root = this.rootNode, o.push(a);
|
|
34
|
-
}
|
|
35
|
-
let s = this.current, c = !1;
|
|
36
|
-
if (s.content.length > 0) {
|
|
37
|
-
s.content.push(...o);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
for (; s.container;) {
|
|
41
|
-
let e = s.container.content.indexOf(s);
|
|
42
|
-
if (e > 0) {
|
|
43
|
-
s.container.content.splice(e, 0, ...o), c = !0;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
s = s.container;
|
|
47
|
-
}
|
|
48
|
-
c || this.rootNode.content.unshift(...o);
|
|
49
|
-
}
|
|
50
|
-
construct(e) {
|
|
51
|
-
let a = this.current;
|
|
52
|
-
typeof e.$type == "string" && !e.$infixName && (this.current.astNode = e), e.$cstNode = a;
|
|
53
|
-
let o = this.nodeStack.pop();
|
|
54
|
-
o?.content.length === 0 && this.removeNode(o);
|
|
55
|
-
}
|
|
56
|
-
}, AbstractCstNode = class {
|
|
57
|
-
get hidden() {
|
|
58
|
-
return !1;
|
|
59
|
-
}
|
|
60
|
-
get astNode() {
|
|
61
|
-
let e = typeof this._astNode?.$type == "string" ? this._astNode : this.container?.astNode;
|
|
62
|
-
if (!e) throw Error("This node has no associated AST element");
|
|
63
|
-
return e;
|
|
64
|
-
}
|
|
65
|
-
set astNode(e) {
|
|
66
|
-
this._astNode = e;
|
|
67
|
-
}
|
|
68
|
-
get text() {
|
|
69
|
-
return this.root.fullText.substring(this.offset, this.end);
|
|
70
|
-
}
|
|
71
|
-
}, LeafCstNodeImpl = class extends AbstractCstNode {
|
|
72
|
-
get offset() {
|
|
73
|
-
return this._offset;
|
|
74
|
-
}
|
|
75
|
-
get length() {
|
|
76
|
-
return this._length;
|
|
77
|
-
}
|
|
78
|
-
get end() {
|
|
79
|
-
return this._offset + this._length;
|
|
80
|
-
}
|
|
81
|
-
get hidden() {
|
|
82
|
-
return this._hidden;
|
|
83
|
-
}
|
|
84
|
-
get tokenType() {
|
|
85
|
-
return this._tokenType;
|
|
86
|
-
}
|
|
87
|
-
get range() {
|
|
88
|
-
return this._range;
|
|
89
|
-
}
|
|
90
|
-
constructor(e, a, o, s, c = !1) {
|
|
91
|
-
super(), this._hidden = c, this._offset = e, this._tokenType = s, this._length = a, this._range = o;
|
|
92
|
-
}
|
|
93
|
-
}, CompositeCstNodeImpl = class extends AbstractCstNode {
|
|
94
|
-
constructor() {
|
|
95
|
-
super(...arguments), this.content = new CstNodeContainer(this);
|
|
96
|
-
}
|
|
97
|
-
get offset() {
|
|
98
|
-
return this.firstNonHiddenNode?.offset ?? 0;
|
|
99
|
-
}
|
|
100
|
-
get length() {
|
|
101
|
-
return this.end - this.offset;
|
|
102
|
-
}
|
|
103
|
-
get end() {
|
|
104
|
-
return this.lastNonHiddenNode?.end ?? 0;
|
|
105
|
-
}
|
|
106
|
-
get range() {
|
|
107
|
-
let e = this.firstNonHiddenNode, o = this.lastNonHiddenNode;
|
|
108
|
-
if (e && o) {
|
|
109
|
-
if (this._rangeCache === void 0) {
|
|
110
|
-
let { range: a } = e, { range: s } = o;
|
|
111
|
-
this._rangeCache = {
|
|
112
|
-
start: a.start,
|
|
113
|
-
end: s.end.line < a.start.line ? a.start : s.end
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return this._rangeCache;
|
|
117
|
-
} else return {
|
|
118
|
-
start: Position.create(0, 0),
|
|
119
|
-
end: Position.create(0, 0)
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
get firstNonHiddenNode() {
|
|
123
|
-
for (let e of this.content) if (!e.hidden) return e;
|
|
124
|
-
return this.content[0];
|
|
125
|
-
}
|
|
126
|
-
get lastNonHiddenNode() {
|
|
127
|
-
for (let e = this.content.length - 1; e >= 0; e--) {
|
|
128
|
-
let a = this.content[e];
|
|
129
|
-
if (!a.hidden) return a;
|
|
130
|
-
}
|
|
131
|
-
return this.content[this.content.length - 1];
|
|
132
|
-
}
|
|
133
|
-
}, CstNodeContainer = class e extends Array {
|
|
134
|
-
constructor(a) {
|
|
135
|
-
super(), this.parent = a, Object.setPrototypeOf(this, e.prototype);
|
|
136
|
-
}
|
|
137
|
-
push(...e) {
|
|
138
|
-
return this.addParents(e), super.push(...e);
|
|
139
|
-
}
|
|
140
|
-
unshift(...e) {
|
|
141
|
-
return this.addParents(e), super.unshift(...e);
|
|
142
|
-
}
|
|
143
|
-
splice(e, a, ...o) {
|
|
144
|
-
return this.addParents(o), super.splice(e, a, ...o);
|
|
145
|
-
}
|
|
146
|
-
addParents(e) {
|
|
147
|
-
for (let a of e) a.container = this.parent;
|
|
148
|
-
}
|
|
149
|
-
}, RootCstNodeImpl = class extends CompositeCstNodeImpl {
|
|
150
|
-
get text() {
|
|
151
|
-
return this._text.substring(this.offset, this.end);
|
|
152
|
-
}
|
|
153
|
-
get fullText() {
|
|
154
|
-
return this._text;
|
|
155
|
-
}
|
|
156
|
-
constructor(e) {
|
|
157
|
-
super(), this._text = "", this._text = e ?? "";
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
export { AbstractCstNode, CompositeCstNodeImpl, CstNodeBuilder, LeafCstNodeImpl, RootCstNodeImpl };
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { Lexer } from "../../../chevrotain/lib/src/scan/lexer_public.js";
|
|
2
|
-
import { createToken, createTokenInstance } from "../../../chevrotain/lib/src/scan/tokens_public.js";
|
|
3
|
-
import "../../../chevrotain/lib/src/api.js";
|
|
4
|
-
import { DefaultTokenBuilder } from "./token-builder.js";
|
|
5
|
-
import { DEFAULT_TOKENIZE_OPTIONS, DefaultLexer, isTokenTypeArray } from "./lexer.js";
|
|
6
|
-
const indentationBuilderDefaultOptions = {
|
|
7
|
-
indentTokenName: "INDENT",
|
|
8
|
-
dedentTokenName: "DEDENT",
|
|
9
|
-
whitespaceTokenName: "WS",
|
|
10
|
-
ignoreIndentationDelimiters: []
|
|
11
|
-
};
|
|
12
|
-
var LexingMode;
|
|
13
|
-
(function(e) {
|
|
14
|
-
e.REGULAR = "indentation-sensitive", e.IGNORE_INDENTATION = "ignore-indentation";
|
|
15
|
-
})(LexingMode ||= {});
|
|
16
|
-
var IndentationAwareTokenBuilder = class extends DefaultTokenBuilder {
|
|
17
|
-
constructor(e = indentationBuilderDefaultOptions) {
|
|
18
|
-
super(), this.indentationStack = [0], this.whitespaceRegExp = /[ \t]+/y, this.options = {
|
|
19
|
-
...indentationBuilderDefaultOptions,
|
|
20
|
-
...e
|
|
21
|
-
}, this.indentTokenType = createToken({
|
|
22
|
-
name: this.options.indentTokenName,
|
|
23
|
-
pattern: this.indentMatcher.bind(this),
|
|
24
|
-
line_breaks: !1
|
|
25
|
-
}), this.dedentTokenType = createToken({
|
|
26
|
-
name: this.options.dedentTokenName,
|
|
27
|
-
pattern: this.dedentMatcher.bind(this),
|
|
28
|
-
line_breaks: !1
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
buildTokens(e, t) {
|
|
32
|
-
let n = super.buildTokens(e, t);
|
|
33
|
-
if (!isTokenTypeArray(n)) throw Error("Invalid tokens built by default builder");
|
|
34
|
-
let { indentTokenName: r, dedentTokenName: i, whitespaceTokenName: a, ignoreIndentationDelimiters: s } = this.options, l, u, d, f = [];
|
|
35
|
-
for (let e of n) {
|
|
36
|
-
for (let [t, n] of s) e.name === t ? e.PUSH_MODE = LexingMode.IGNORE_INDENTATION : e.name === n && (e.POP_MODE = !0);
|
|
37
|
-
e.name === i ? l = e : e.name === r ? u = e : e.name === a ? d = e : f.push(e);
|
|
38
|
-
}
|
|
39
|
-
if (!l || !u || !d) throw Error("Some indentation/whitespace tokens not found!");
|
|
40
|
-
return s.length > 0 ? {
|
|
41
|
-
modes: {
|
|
42
|
-
[LexingMode.REGULAR]: [
|
|
43
|
-
l,
|
|
44
|
-
u,
|
|
45
|
-
...f,
|
|
46
|
-
d
|
|
47
|
-
],
|
|
48
|
-
[LexingMode.IGNORE_INDENTATION]: [...f, d]
|
|
49
|
-
},
|
|
50
|
-
defaultMode: LexingMode.REGULAR
|
|
51
|
-
} : [
|
|
52
|
-
l,
|
|
53
|
-
u,
|
|
54
|
-
d,
|
|
55
|
-
...f
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
flushLexingReport(e) {
|
|
59
|
-
return {
|
|
60
|
-
...super.flushLexingReport(e),
|
|
61
|
-
remainingDedents: this.flushRemainingDedents(e)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
isStartOfLine(e, t) {
|
|
65
|
-
return t === 0 || "\r\n".includes(e[t - 1]);
|
|
66
|
-
}
|
|
67
|
-
matchWhitespace(e, t, n, r) {
|
|
68
|
-
this.whitespaceRegExp.lastIndex = t;
|
|
69
|
-
let i = this.whitespaceRegExp.exec(e);
|
|
70
|
-
return {
|
|
71
|
-
currIndentLevel: i?.[0].length ?? 0,
|
|
72
|
-
prevIndentLevel: this.indentationStack.at(-1),
|
|
73
|
-
match: i
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
createIndentationTokenInstance(e, t, r, i) {
|
|
77
|
-
let a = this.getLineNumber(t, i);
|
|
78
|
-
return createTokenInstance(e, r, i, i + r.length, a, a, 1, r.length);
|
|
79
|
-
}
|
|
80
|
-
getLineNumber(e, t) {
|
|
81
|
-
return e.substring(0, t).split(/\r\n|\r|\n/).length;
|
|
82
|
-
}
|
|
83
|
-
indentMatcher(e, t, n, r) {
|
|
84
|
-
if (!this.isStartOfLine(e, t)) return null;
|
|
85
|
-
let { currIndentLevel: i, prevIndentLevel: a, match: o } = this.matchWhitespace(e, t, n, r);
|
|
86
|
-
return i <= a ? null : (this.indentationStack.push(i), o);
|
|
87
|
-
}
|
|
88
|
-
dedentMatcher(e, t, n, r) {
|
|
89
|
-
if (!this.isStartOfLine(e, t)) return null;
|
|
90
|
-
let { currIndentLevel: i, prevIndentLevel: a, match: o } = this.matchWhitespace(e, t, n, r);
|
|
91
|
-
if (i >= a) return null;
|
|
92
|
-
let s = this.indentationStack.lastIndexOf(i);
|
|
93
|
-
if (s === -1) return this.diagnostics.push({
|
|
94
|
-
severity: "error",
|
|
95
|
-
message: `Invalid dedent level ${i} at offset: ${t}. Current indentation stack: ${this.indentationStack}`,
|
|
96
|
-
offset: t,
|
|
97
|
-
length: o?.[0]?.length ?? 0,
|
|
98
|
-
line: this.getLineNumber(e, t),
|
|
99
|
-
column: 1
|
|
100
|
-
}), null;
|
|
101
|
-
let c = this.indentationStack.length - s - 1, l = e.substring(0, t).match(/[\r\n]+$/)?.[0].length ?? 1;
|
|
102
|
-
for (let r = 0; r < c; r++) {
|
|
103
|
-
let r = this.createIndentationTokenInstance(this.dedentTokenType, e, "", t - (l - 1));
|
|
104
|
-
n.push(r), this.indentationStack.pop();
|
|
105
|
-
}
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
buildTerminalToken(n) {
|
|
109
|
-
let r = super.buildTerminalToken(n), { indentTokenName: i, dedentTokenName: a, whitespaceTokenName: o } = this.options;
|
|
110
|
-
return r.name === i ? this.indentTokenType : r.name === a ? this.dedentTokenType : r.name === o ? createToken({
|
|
111
|
-
name: o,
|
|
112
|
-
pattern: this.whitespaceRegExp,
|
|
113
|
-
group: Lexer.SKIPPED
|
|
114
|
-
}) : r;
|
|
115
|
-
}
|
|
116
|
-
flushRemainingDedents(e) {
|
|
117
|
-
let t = [];
|
|
118
|
-
for (; this.indentationStack.length > 1;) t.push(this.createIndentationTokenInstance(this.dedentTokenType, e, "", e.length)), this.indentationStack.pop();
|
|
119
|
-
return this.indentationStack = [0], t;
|
|
120
|
-
}
|
|
121
|
-
}, IndentationAwareLexer = class extends DefaultLexer {
|
|
122
|
-
constructor(e) {
|
|
123
|
-
if (super(e), e.parser.TokenBuilder instanceof IndentationAwareTokenBuilder) this.indentationTokenBuilder = e.parser.TokenBuilder;
|
|
124
|
-
else throw Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder");
|
|
125
|
-
}
|
|
126
|
-
tokenize(e, t = DEFAULT_TOKENIZE_OPTIONS) {
|
|
127
|
-
let n = super.tokenize(e), r = n.report;
|
|
128
|
-
t?.mode === "full" && n.tokens.push(...r.remainingDedents), r.remainingDedents = [];
|
|
129
|
-
let { indentTokenType: a, dedentTokenType: o } = this.indentationTokenBuilder, s = a.tokenTypeIdx, c = o.tokenTypeIdx, l = [], u = n.tokens.length - 1;
|
|
130
|
-
for (let e = 0; e < u; e++) {
|
|
131
|
-
let t = n.tokens[e], r = n.tokens[e + 1];
|
|
132
|
-
if (t.tokenTypeIdx === s && r.tokenTypeIdx === c) {
|
|
133
|
-
e++;
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
l.push(t);
|
|
137
|
-
}
|
|
138
|
-
return u >= 0 && l.push(n.tokens[u]), n.tokens = l, n;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
export { IndentationAwareLexer, IndentationAwareTokenBuilder, LexingMode, indentationBuilderDefaultOptions };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LangiumParser } from "./langium-parser.js";
|
|
2
|
-
import { createParser } from "./parser-builder-base.js";
|
|
3
|
-
function createLangiumParser(e) {
|
|
4
|
-
let t = prepareLangiumParser(e);
|
|
5
|
-
return t.finalize(), t;
|
|
6
|
-
}
|
|
7
|
-
function prepareLangiumParser(n) {
|
|
8
|
-
let r = n.Grammar, i = n.parser.Lexer;
|
|
9
|
-
return createParser(r, new LangiumParser(n), i.definition);
|
|
10
|
-
}
|
|
11
|
-
export { createLangiumParser, prepareLangiumParser };
|