@loopstack/loopstack-studio 0.28.0 → 0.29.1

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.
Files changed (377) hide show
  1. package/dist/_virtual/rolldown_runtime.js +13 -15
  2. package/dist/api/config.js +2 -2
  3. package/dist/components/dynamic-form/Form.js +49 -52
  4. package/dist/config.js +6 -0
  5. package/dist/features/debug/components/WorkflowFlowViewer.js +94 -81
  6. package/dist/features/debug/components/workflow-flow/StateNode.js +154 -79
  7. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +43 -31
  8. package/dist/features/debug/components/workflow-flow/WorkflowTransitionEdge.js +52 -51
  9. package/dist/features/debug/lib/edge-paths.js +45 -30
  10. package/dist/features/debug/lib/flow-types.js +2 -0
  11. package/dist/features/debug/lib/flow-utils.js +66 -64
  12. package/dist/features/documents/components/DocumentList.js +19 -18
  13. package/dist/features/workbench/WorkflowItem.js +4 -3
  14. package/dist/features/workbench/components/EmbedLogsContent.js +5 -0
  15. package/dist/features/workbench/components/NewRunDialog.js +2 -2
  16. package/dist/features/workbench/components/PreviewEmptyState.js +10 -0
  17. package/dist/features/workbench/components/PreviewWorkbench.js +14 -0
  18. package/dist/features/workbench/components/RecentRunItem.js +48 -0
  19. package/dist/features/workbench/components/WorkflowForms.js +4 -3
  20. package/dist/features/workbench/hooks/useEmbedBridge.js +3 -0
  21. package/dist/features/workbench/hooks/useWorkflowData.js +9 -9
  22. package/dist/features/workbench/index.js +4 -0
  23. package/dist/features/workspaces/Workspaces.js +2 -2
  24. package/dist/features/workspaces/components/ExecutionTimeline.js +9 -8
  25. package/dist/hooks/index.js +2 -2
  26. package/dist/hooks/query-keys.js +3 -3
  27. package/dist/hooks/useConfig.js +15 -15
  28. package/dist/index.d.ts +12 -12
  29. package/dist/index.js +3 -3
  30. package/dist/loopstack-studio.css +1 -1
  31. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-YZFGNWBL.js → architecture-7EHR7CIX.js} +2 -2
  32. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-7N4EOEYR.js → chunk-4EGX6M5U.js} +9 -13
  33. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-KGLVRYIC.js → chunk-5DO6E6H7.js} +3 -7
  34. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BR22UD5L.js +56 -0
  35. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-2KRD3SAO.js → chunk-FHYWG6QK.js} +3 -7
  36. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FOC6F5B3.js → chunk-MPE355IW.js} +3 -7
  37. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MZUSXYTE.js +24 -0
  38. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-N66VUXT2.js +48 -0
  39. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-NNHCCRGN.js +20219 -0
  40. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-PUPMXCY4.js +19 -0
  41. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-67CJDMHE.js → chunk-UIBZB4QT.js} +3 -7
  42. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WCWK7LTN.js +25 -0
  43. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-FCH6USID.js +3 -0
  44. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-7Q5UKJZL.js → gitGraph-WXDBUCRP.js} +2 -2
  45. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-J43DQDTF.js +3 -0
  46. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-YPE3B663.js +3 -0
  47. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-LRSECV5Y.js +3 -0
  48. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-GUYGQ44K.js +3 -0
  49. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{treeView-SZITEDCU.js → treeView-BLDUP644.js} +2 -2
  50. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-LRROVOQU.js +3 -0
  51. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-L42UT6IY.js +3 -0
  52. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +24 -19
  53. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +36 -26
  54. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  55. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +257 -254
  56. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  57. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  58. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  59. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  60. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  61. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  65. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +72 -72
  66. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  67. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  68. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  69. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  70. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  71. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  72. package/dist/node_modules/dompurify/dist/purify.es.js +293 -205
  73. package/dist/node_modules/es-toolkit/dist/_internal/globalThis.js +4 -0
  74. package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +4 -0
  75. package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +4 -0
  76. package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +4 -0
  77. package/dist/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js +5 -0
  78. package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +2 -0
  79. package/dist/node_modules/es-toolkit/dist/compat/function/memoize.js +12 -0
  80. package/dist/node_modules/es-toolkit/dist/compat/object/clone.js +97 -0
  81. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +5 -0
  82. package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +29 -0
  83. package/dist/node_modules/es-toolkit/dist/compat/object/merge.js +6 -0
  84. package/dist/node_modules/es-toolkit/dist/compat/object/mergeWith.js +49 -0
  85. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +5 -0
  86. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArray.js +4 -0
  87. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +5 -0
  88. package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +6 -0
  89. package/dist/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js +16 -0
  90. package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +4 -0
  91. package/dist/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.js +12 -0
  92. package/dist/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.js +5 -0
  93. package/dist/node_modules/es-toolkit/dist/function/noop.js +2 -0
  94. package/dist/node_modules/es-toolkit/dist/object/clone.js +29 -0
  95. package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +114 -0
  96. package/dist/node_modules/es-toolkit/dist/predicate/isBuffer.js +5 -0
  97. package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +4 -0
  98. package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +4 -0
  99. package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +4 -0
  100. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +2 -2
  101. package/dist/node_modules/internmap/src/index.js +1 -1
  102. package/dist/node_modules/katex/dist/katex.js +379 -417
  103. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +3 -3
  104. package/dist/node_modules/lodash-es/_assignMergeValue.js +1 -1
  105. package/dist/node_modules/lodash-es/_assignValue.js +1 -1
  106. package/dist/node_modules/lodash-es/_baseClone.js +9 -9
  107. package/dist/node_modules/lodash-es/_baseForOwn.js +1 -1
  108. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +1 -1
  109. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  110. package/dist/node_modules/lodash-es/_baseMerge.js +2 -2
  111. package/dist/node_modules/lodash-es/_baseMergeDeep.js +7 -7
  112. package/dist/node_modules/lodash-es/_baseOrderBy.js +12 -12
  113. package/dist/node_modules/lodash-es/_baseRest.js +1 -1
  114. package/dist/node_modules/lodash-es/_baseSet.js +1 -1
  115. package/dist/node_modules/lodash-es/_baseSetToString.js +3 -3
  116. package/dist/node_modules/lodash-es/_baseToString.js +2 -2
  117. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  118. package/dist/node_modules/lodash-es/_createRange.js +1 -1
  119. package/dist/node_modules/lodash-es/_createSet.js +3 -3
  120. package/dist/node_modules/lodash-es/_flatRest.js +1 -1
  121. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  122. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  123. package/dist/node_modules/lodash-es/_getSymbolsIn.js +1 -1
  124. package/dist/node_modules/lodash-es/_getTag.js +1 -1
  125. package/dist/node_modules/lodash-es/_hasPath.js +2 -2
  126. package/dist/node_modules/lodash-es/_initCloneByTag.js +1 -1
  127. package/dist/node_modules/lodash-es/_initCloneObject.js +1 -1
  128. package/dist/node_modules/lodash-es/_isFlattenable.js +1 -1
  129. package/dist/node_modules/lodash-es/_isIterateeCall.js +1 -1
  130. package/dist/node_modules/lodash-es/_isKey.js +1 -1
  131. package/dist/node_modules/lodash-es/_setToString.js +1 -1
  132. package/dist/node_modules/lodash-es/defaults.js +1 -1
  133. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  134. package/dist/node_modules/lodash-es/forEach.js +1 -1
  135. package/dist/node_modules/lodash-es/forIn.js +1 -1
  136. package/dist/node_modules/lodash-es/isEmpty.js +2 -2
  137. package/dist/node_modules/lodash-es/isPlainObject.js +1 -1
  138. package/dist/node_modules/lodash-es/map.js +1 -1
  139. package/dist/node_modules/lodash-es/max.js +1 -1
  140. package/dist/node_modules/lodash-es/merge.js +3 -3
  141. package/dist/node_modules/lodash-es/min.js +1 -1
  142. package/dist/node_modules/lodash-es/minBy.js +1 -1
  143. package/dist/node_modules/lodash-es/reduce.js +1 -1
  144. package/dist/node_modules/lodash-es/toNumber.js +1 -1
  145. package/dist/node_modules/lodash-es/union.js +3 -3
  146. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{architectureDiagram-Q4EWVU46.js → architectureDiagram-3BPJPVTR.js} +310 -308
  147. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-DXYQGD6D.js → blockDiagram-GPEHLZMM.js} +215 -190
  148. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-AHTNJAMY.js → c4Diagram-AAUBKEIU.js} +3 -3
  149. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EDXVE4YY.js → chunk-2J33WTMH.js} +1 -1
  150. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5FUZZQ4R.js → chunk-3OPIFGDE.js} +48 -20
  151. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-5PVQY5BW.js → chunk-5ZQYHXKU.js} +8 -8
  152. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-4TB4RGXK.js → chunk-727SXJPM.js} +555 -459
  153. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-OYMX7WX6.js → chunk-AQP2D5EJ.js} +155 -145
  154. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ICPOFSXX.js → chunk-CSCIHK7Q.js} +106 -12
  155. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ENJZ2VHE.js → chunk-KSCS5N6A.js} +12 -12
  156. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ZZ45TVLE.js → chunk-L5ZTLDWV.js} +2 -2
  157. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-336JU56O.js → chunk-LZXEDZCA.js} +5 -5
  158. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-YZCP3GAM.js → chunk-ND2GUHAM.js} +1 -1
  159. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-X2U36JSP.js → chunk-NZK2D7GU.js} +1 -1
  160. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-U2HBQHQK.js → chunk-O5CBEL6O.js} +2 -2
  161. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-426QAEUC.js → chunk-WU5MYG2G.js} +1 -1
  162. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-6PBFFD2Q.js → classDiagram-4FO5ZUOK.js} +11 -11
  163. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-HSJHXN6E.js → classDiagram-v2-Q7XG4LA2.js} +11 -11
  164. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-KV5264BT.js → dagre-BM42HDAG.js} +8 -8
  165. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-MMDJMWI5.js → diagram-2AECGRRQ.js} +3 -3
  166. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-5BDNPKRD.js → diagram-5GNKFQAL.js} +3 -3
  167. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +433 -0
  168. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-TYMM5635.js → diagram-LMA3HP47.js} +3 -3
  169. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-G4DWMVQ6.js → diagram-OG6HWLK6.js} +5 -5
  170. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-SMLLAGMA.js → erDiagram-TEJ5UH35.js} +9 -9
  171. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-DWJPFMVM.js → flowDiagram-I6XJVG4X.js} +10 -10
  172. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-T4ZO3ILL.js → ganttDiagram-6RSMTGT7.js} +7 -4
  173. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{gitGraphDiagram-UUTBAWPF.js → gitGraphDiagram-PVQCEYII.js} +2 -2
  174. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{infoDiagram-42DDH7IO.js → infoDiagram-5YYISTIA.js} +3 -3
  175. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ishikawaDiagram-UXIWVN3A.js → ishikawaDiagram-YF4QCWOH.js} +3 -3
  176. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-VCZTEJTY.js → journeyDiagram-JHISSGLW.js} +2 -2
  177. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-6JOO6SKY.js → kanban-definition-UN3LZRKU.js} +7 -7
  178. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-QFDTVHPH.js → mindmap-definition-RKZ34NQL.js} +9 -9
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{pieDiagram-DEJITSTG.js → pieDiagram-4H26LBE5.js} +3 -3
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-34T5L4WZ.js → quadrantDiagram-W4KKPZXB.js} +364 -337
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-MS252O5E.js → requirementDiagram-4Y6WPE33.js} +9 -9
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-XADWPNL6.js → sankeyDiagram-5OEKKPKP.js} +187 -138
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sequenceDiagram-FGHM5R23.js → sequenceDiagram-3UESZ5HK.js} +15 -8
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FHFEXIEX.js → stateDiagram-AJRCARHV.js} +10 -10
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-QKLJ7IA2.js → stateDiagram-v2-BHNVJYJU.js} +10 -10
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{timeline-definition-GMOUNBTQ.js → timeline-definition-PNZ67QCA.js} +3 -3
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{vennDiagram-DHZGUBPP.js → vennDiagram-CIIHVFJN.js} +3 -3
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-YWT4CUSO.js +640 -0
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-5P7HB3ND.js → xychartDiagram-2RQKCTM6.js} +4 -4
  190. package/dist/node_modules/mermaid/dist/mermaid.core.js +96 -70
  191. package/dist/node_modules/stylis/src/Enum.js +2 -2
  192. package/dist/node_modules/stylis/src/Middleware.js +9 -0
  193. package/dist/node_modules/stylis/src/Parser.js +55 -44
  194. package/dist/node_modules/stylis/src/Utility.js +9 -12
  195. package/dist/node_modules/unified/lib/index.js +1 -1
  196. package/dist/packages/contracts/dist/enums/index.js +4 -24
  197. package/dist/packages/contracts/dist/enums/registry.enum.js +9 -20
  198. package/dist/packages/contracts/dist/enums/sort-order.enum.js +5 -10
  199. package/dist/packages/contracts/dist/enums/user-type.enum.js +5 -10
  200. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +5 -10
  201. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  202. package/dist/pages/DebugWorkflowsPage.js +12 -12
  203. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  204. package/dist/pages/PreviewWorkbenchPage.js +126 -124
  205. package/dist/pages/StudioLandingPage.js +28 -72
  206. package/dist/pages/WorkspacePage.js +2 -2
  207. package/package.json +2 -2
  208. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +0 -23
  209. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +0 -151
  210. package/dist/node_modules/@chevrotain/gast/lib/src/visitor.js +0 -40
  211. package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js +0 -2
  212. package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js +0 -85
  213. package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js +0 -35
  214. package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js +0 -570
  215. package/dist/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js +0 -25
  216. package/dist/node_modules/@chevrotain/utils/lib/src/print.js +0 -9
  217. package/dist/node_modules/@chevrotain/utils/lib/src/timer.js +0 -8
  218. package/dist/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js +0 -10
  219. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-AA7GKIK3.js +0 -28
  220. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +0 -23
  221. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +0 -1197
  222. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LIHQZDEY.js +0 -60
  223. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +0 -29
  224. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +0 -3
  225. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +0 -3
  226. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +0 -3
  227. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +0 -3
  228. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +0 -3
  229. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +0 -3
  230. package/dist/node_modules/chevrotain/lib/src/api.js +0 -10
  231. package/dist/node_modules/chevrotain/lib/src/lang/lang_extensions.js +0 -10
  232. package/dist/node_modules/chevrotain/lib/src/parse/constants.js +0 -2
  233. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst.js +0 -13
  234. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +0 -49
  235. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +0 -77
  236. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +0 -33
  237. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +0 -275
  238. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +0 -23
  239. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +0 -28
  240. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +0 -14
  241. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +0 -262
  242. package/dist/node_modules/chevrotain/lib/src/parse/grammar/keys.js +0 -5
  243. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +0 -41
  244. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +0 -241
  245. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +0 -30
  246. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +0 -56
  247. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +0 -114
  248. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +0 -46
  249. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +0 -166
  250. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +0 -43
  251. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +0 -107
  252. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +0 -21
  253. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +0 -312
  254. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +0 -285
  255. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +0 -144
  256. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +0 -92
  257. package/dist/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js +0 -11
  258. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +0 -437
  259. package/dist/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +0 -9
  260. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +0 -253
  261. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +0 -152
  262. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +0 -15
  263. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +0 -65
  264. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +0 -39
  265. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +0 -346
  266. package/dist/node_modules/chevrotain-allstar/lib/atn.js +0 -194
  267. package/dist/node_modules/chevrotain-allstar/lib/dfa.js +0 -32
  268. package/dist/node_modules/chevrotain-allstar/lib/index.js +0 -1
  269. package/dist/node_modules/langium/lib/default-module.js +0 -85
  270. package/dist/node_modules/langium/lib/dependency-injection.js +0 -62
  271. package/dist/node_modules/langium/lib/documentation/comment-provider.js +0 -11
  272. package/dist/node_modules/langium/lib/documentation/documentation-provider.js +0 -36
  273. package/dist/node_modules/langium/lib/documentation/jsdoc.js +0 -303
  274. package/dist/node_modules/langium/lib/index.js +0 -182
  275. package/dist/node_modules/langium/lib/languages/generated/ast.js +0 -1089
  276. package/dist/node_modules/langium/lib/languages/grammar-config.js +0 -13
  277. package/dist/node_modules/langium/lib/parser/async-parser.js +0 -83
  278. package/dist/node_modules/langium/lib/parser/completion-parser-builder.js +0 -7
  279. package/dist/node_modules/langium/lib/parser/cst-node-builder.js +0 -160
  280. package/dist/node_modules/langium/lib/parser/indentation-aware.js +0 -141
  281. package/dist/node_modules/langium/lib/parser/langium-parser-builder.js +0 -11
  282. package/dist/node_modules/langium/lib/parser/langium-parser.js +0 -388
  283. package/dist/node_modules/langium/lib/parser/lexer.js +0 -50
  284. package/dist/node_modules/langium/lib/parser/parser-builder-base.js +0 -275
  285. package/dist/node_modules/langium/lib/parser/token-builder.js +0 -61
  286. package/dist/node_modules/langium/lib/parser/value-converter.js +0 -78
  287. package/dist/node_modules/langium/lib/references/linker.js +0 -190
  288. package/dist/node_modules/langium/lib/references/name-provider.js +0 -13
  289. package/dist/node_modules/langium/lib/references/references.js +0 -76
  290. package/dist/node_modules/langium/lib/references/scope-computation.js +0 -35
  291. package/dist/node_modules/langium/lib/references/scope-provider.js +0 -34
  292. package/dist/node_modules/langium/lib/references/scope.js +0 -73
  293. package/dist/node_modules/langium/lib/serializer/hydrator.js +0 -125
  294. package/dist/node_modules/langium/lib/serializer/json-serializer.js +0 -145
  295. package/dist/node_modules/langium/lib/service-registry.js +0 -37
  296. package/dist/node_modules/langium/lib/syntax-tree.js +0 -70
  297. package/dist/node_modules/langium/lib/utils/ast-utils.js +0 -157
  298. package/dist/node_modules/langium/lib/utils/caching.js +0 -91
  299. package/dist/node_modules/langium/lib/utils/cancellation.js +0 -5
  300. package/dist/node_modules/langium/lib/utils/collections.js +0 -85
  301. package/dist/node_modules/langium/lib/utils/cst-utils.js +0 -190
  302. package/dist/node_modules/langium/lib/utils/disposable.js +0 -8
  303. package/dist/node_modules/langium/lib/utils/errors.js +0 -12
  304. package/dist/node_modules/langium/lib/utils/event.js +0 -5
  305. package/dist/node_modules/langium/lib/utils/grammar-loader.js +0 -22
  306. package/dist/node_modules/langium/lib/utils/grammar-utils.js +0 -296
  307. package/dist/node_modules/langium/lib/utils/index.js +0 -53
  308. package/dist/node_modules/langium/lib/utils/promise-utils.js +0 -30
  309. package/dist/node_modules/langium/lib/utils/regexp-utils.js +0 -167
  310. package/dist/node_modules/langium/lib/utils/stream.js +0 -327
  311. package/dist/node_modules/langium/lib/utils/uri-utils.js +0 -107
  312. package/dist/node_modules/langium/lib/validation/document-validator.js +0 -210
  313. package/dist/node_modules/langium/lib/validation/validation-registry.js +0 -87
  314. package/dist/node_modules/langium/lib/workspace/ast-descriptions.js +0 -57
  315. package/dist/node_modules/langium/lib/workspace/ast-node-locator.js +0 -28
  316. package/dist/node_modules/langium/lib/workspace/configuration.js +0 -51
  317. package/dist/node_modules/langium/lib/workspace/document-builder.js +0 -201
  318. package/dist/node_modules/langium/lib/workspace/documents.js +0 -142
  319. package/dist/node_modules/langium/lib/workspace/file-system-provider.js +0 -34
  320. package/dist/node_modules/langium/lib/workspace/index-manager.js +0 -49
  321. package/dist/node_modules/langium/lib/workspace/profiler.js +0 -89
  322. package/dist/node_modules/langium/lib/workspace/workspace-lock.js +0 -42
  323. package/dist/node_modules/langium/lib/workspace/workspace-manager.js +0 -66
  324. package/dist/node_modules/lodash-es/flatMap.js +0 -7
  325. package/dist/node_modules/lodash-es/uniqBy.js +0 -7
  326. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +0 -574
  327. package/dist/node_modules/vscode-jsonrpc/browser.js +0 -7
  328. package/dist/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -52
  329. package/dist/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -120
  330. package/dist/node_modules/vscode-jsonrpc/lib/common/api.js +0 -337
  331. package/dist/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -57
  332. package/dist/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -647
  333. package/dist/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -13
  334. package/dist/node_modules/vscode-jsonrpc/lib/common/events.js +0 -64
  335. package/dist/node_modules/vscode-jsonrpc/lib/common/is.js +0 -34
  336. package/dist/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -235
  337. package/dist/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -93
  338. package/dist/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -129
  339. package/dist/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -85
  340. package/dist/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -161
  341. package/dist/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -18
  342. package/dist/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -44
  343. package/dist/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -58
  344. package/dist/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -28
  345. package/dist/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -36
  346. package/dist/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -12
  347. package/dist/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -31
  348. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -19
  349. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -15
  350. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -11
  351. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -11
  352. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -33
  353. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -35
  354. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -15
  355. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -11
  356. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -19
  357. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -11
  358. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -15
  359. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -674
  360. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -11
  361. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -19
  362. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -126
  363. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -24
  364. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -11
  365. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -31
  366. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -11
  367. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -11
  368. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -19
  369. package/dist/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -15
  370. package/dist/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -42
  371. package/dist/node_modules/vscode-languageserver-textdocument/lib/esm/main.js +0 -138
  372. package/dist/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -1084
  373. package/dist/node_modules/vscode-uri/lib/esm/index.js +0 -373
  374. /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode-codepoint.js +0 -0
  375. /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/decode.js +0 -0
  376. /package/dist/node_modules/{entities → hast-util-raw/node_modules/entities}/dist/esm/generated/decode-data-html.js +0 -0
  377. /package/dist/node_modules/{unified/node_modules/is-plain-obj → is-plain-obj}/index.js +0 -0
@@ -1,60 +0,0 @@
1
- import { createDefaultCoreModule, createDefaultSharedCoreModule } from "../../../../../langium/lib/default-module.js";
2
- import { inject } from "../../../../../langium/lib/dependency-injection.js";
3
- import { EmptyFileSystem } from "../../../../../langium/lib/workspace/file-system-provider.js";
4
- import "../../../../../langium/lib/index.js";
5
- import { AbstractMermaidTokenBuilder, AbstractMermaidValueConverter, MermaidGeneratedSharedModule, TreemapGrammarGeneratedModule, __name } from "./chunk-K5T4RW27.js";
6
- var TreemapTokenBuilder = class extends AbstractMermaidTokenBuilder {
7
- static #e = __name(this, "TreemapTokenBuilder");
8
- constructor() {
9
- super(["treemap"]);
10
- }
11
- }, classDefRegex = /classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/, TreemapValueConverter = class extends AbstractMermaidValueConverter {
12
- static #e = __name(this, "TreemapValueConverter");
13
- runCustomConverter(e, u, d) {
14
- if (e.name === "NUMBER2") return parseFloat(u.replace(/,/g, ""));
15
- if (e.name === "SEPARATOR" || e.name === "STRING2") return u.substring(1, u.length - 1);
16
- if (e.name === "INDENTATION") return u.length;
17
- if (e.name === "ClassDef") {
18
- if (typeof u != "string") return u;
19
- let e = classDefRegex.exec(u);
20
- if (e) return {
21
- $type: "ClassDefStatement",
22
- className: e[1],
23
- styleText: e[2] || void 0
24
- };
25
- }
26
- }
27
- };
28
- function registerValidationChecks(e) {
29
- let u = e.validation.TreemapValidator, d = e.validation.ValidationRegistry;
30
- if (d) {
31
- let e = { Treemap: u.checkSingleRoot.bind(u) };
32
- d.register(e, u);
33
- }
34
- }
35
- __name(registerValidationChecks, "registerValidationChecks");
36
- var TreemapValidator = class {
37
- static #e = __name(this, "TreemapValidator");
38
- checkSingleRoot(e, u) {
39
- let d;
40
- for (let f of e.TreemapRows) f.item && (d === void 0 && f.indent === void 0 ? d = 0 : (f.indent === void 0 || d !== void 0 && d >= parseInt(f.indent, 10)) && u("error", "Multiple root nodes are not allowed in a treemap.", {
41
- node: f,
42
- property: "item"
43
- }));
44
- }
45
- }, TreemapModule = {
46
- parser: {
47
- TokenBuilder: /* @__PURE__ */ __name(() => new TreemapTokenBuilder(), "TokenBuilder"),
48
- ValueConverter: /* @__PURE__ */ __name(() => new TreemapValueConverter(), "ValueConverter")
49
- },
50
- validation: { TreemapValidator: /* @__PURE__ */ __name(() => new TreemapValidator(), "TreemapValidator") }
51
- };
52
- function createTreemapServices(p = EmptyFileSystem) {
53
- let m = inject(createDefaultSharedCoreModule(p), MermaidGeneratedSharedModule), h = inject(createDefaultCoreModule({ shared: m }), TreemapGrammarGeneratedModule, TreemapModule);
54
- return m.ServiceRegistry.register(h), registerValidationChecks(h), {
55
- shared: m,
56
- Treemap: h
57
- };
58
- }
59
- __name(createTreemapServices, "createTreemapServices");
60
- export { TreemapModule, createTreemapServices };
@@ -1,29 +0,0 @@
1
- import { createDefaultCoreModule, createDefaultSharedCoreModule } from "../../../../../langium/lib/default-module.js";
2
- import { inject } from "../../../../../langium/lib/dependency-injection.js";
3
- import { EmptyFileSystem } from "../../../../../langium/lib/workspace/file-system-provider.js";
4
- import "../../../../../langium/lib/index.js";
5
- import { AbstractMermaidTokenBuilder, AbstractMermaidValueConverter, MermaidGeneratedSharedModule, TreeViewGrammarGeneratedModule, __name } from "./chunk-K5T4RW27.js";
6
- var TreeViewValueConverter = class extends AbstractMermaidValueConverter {
7
- static #e = __name(this, "TreeViewValueConverter");
8
- runCustomConverter(e, c, l) {
9
- if (e.name === "INDENTATION") return c?.length || 0;
10
- if (e.name === "STRING2") return c.substring(1, c.length - 1);
11
- }
12
- }, TreeViewTokenBuilder = class extends AbstractMermaidTokenBuilder {
13
- static #e = __name(this, "TreeViewTokenBuilder");
14
- constructor() {
15
- super(["treeView-beta"]);
16
- }
17
- }, TreeViewModule = { parser: {
18
- TokenBuilder: /* @__PURE__ */ __name(() => new TreeViewTokenBuilder(), "TokenBuilder"),
19
- ValueConverter: /* @__PURE__ */ __name(() => new TreeViewValueConverter(), "ValueConverter")
20
- } };
21
- function createTreeViewServices(u = EmptyFileSystem) {
22
- let d = inject(createDefaultSharedCoreModule(u), MermaidGeneratedSharedModule), f = inject(createDefaultCoreModule({ shared: d }), TreeViewGrammarGeneratedModule, TreeViewModule);
23
- return d.ServiceRegistry.register(f), {
24
- shared: d,
25
- TreeView: f
26
- };
27
- }
28
- __name(createTreeViewServices, "createTreeViewServices");
29
- export { TreeViewModule, createTreeViewServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { InfoModule, createInfoServices } from "./chunk-KGLVRYIC.js";
3
- export { createInfoServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { PacketModule, createPacketServices } from "./chunk-FOC6F5B3.js";
3
- export { createPacketServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { PieModule, createPieServices } from "./chunk-AA7GKIK3.js";
3
- export { createPieServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { RadarModule, createRadarServices } from "./chunk-2KRD3SAO.js";
3
- export { createRadarServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { TreemapModule, createTreemapServices } from "./chunk-LIHQZDEY.js";
3
- export { createTreemapServices };
@@ -1,3 +0,0 @@
1
- import "./chunk-K5T4RW27.js";
2
- import { WardleyModule, createWardleyServices } from "./chunk-CIAEETIT.js";
3
- export { createWardleyServices };
@@ -1,10 +0,0 @@
1
- import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Rule, Terminal, serializeGrammar, serializeProduction } from "../../../@chevrotain/gast/lib/src/model.js";
2
- import { GAstVisitor } from "../../../@chevrotain/gast/lib/src/visitor.js";
3
- import { defaultLexerErrorProvider } from "./scan/lexer_errors_public.js";
4
- import { Lexer, LexerDefinitionErrorType } from "./scan/lexer_public.js";
5
- import { EOF, createToken, createTokenInstance, tokenLabel, tokenMatcher } from "./scan/tokens_public.js";
6
- import { defaultParserErrorProvider } from "./parse/errors_public.js";
7
- import { getLookaheadPaths } from "./parse/grammar/lookahead.js";
8
- import { EarlyExitException, MismatchedTokenException, NoViableAltException, NotAllInputParsedException, isRecognitionException } from "./parse/exceptions_public.js";
9
- import { LLkLookaheadStrategy } from "./parse/grammar/llk_lookahead.js";
10
- import { EMPTY_ALT, EmbeddedActionsParser, ParserDefinitionErrorType } from "./parse/parser/parser.js";
@@ -1,10 +0,0 @@
1
- var NAME = "name";
2
- function defineNameProp(t, n) {
3
- Object.defineProperty(t, NAME, {
4
- enumerable: !1,
5
- configurable: !0,
6
- writable: !1,
7
- value: n
8
- });
9
- }
10
- export { defineNameProp };
@@ -1,2 +0,0 @@
1
- const IN = "_~IN~_";
2
- export { IN };
@@ -1,13 +0,0 @@
1
- function setNodeLocationOnlyOffset(e, n) {
2
- isNaN(e.startOffset) === !0 ? (e.startOffset = n.startOffset, e.endOffset = n.endOffset) : e.endOffset < n.endOffset && (e.endOffset = n.endOffset);
3
- }
4
- function setNodeLocationFull(e, n) {
5
- isNaN(e.startOffset) === !0 ? (e.startOffset = n.startOffset, e.startColumn = n.startColumn, e.startLine = n.startLine, e.endOffset = n.endOffset, e.endColumn = n.endColumn, e.endLine = n.endLine) : e.endOffset < n.endOffset && (e.endOffset = n.endOffset, e.endColumn = n.endColumn, e.endLine = n.endLine);
6
- }
7
- function addTerminalToCst(e, n, r) {
8
- e.children[r] === void 0 ? e.children[r] = [n] : e.children[r].push(n);
9
- }
10
- function addNoneTerminalToCst(e, n, r) {
11
- e.children[n] === void 0 ? e.children[n] = [r] : e.children[n].push(r);
12
- }
13
- export { addNoneTerminalToCst, addTerminalToCst, setNodeLocationFull, setNodeLocationOnlyOffset };
@@ -1,49 +0,0 @@
1
- import { defineNameProp } from "../../lang/lang_extensions.js";
2
- function defaultVisit(e, t) {
3
- let n = Object.keys(e), r = n.length;
4
- for (let i = 0; i < r; i++) {
5
- let r = e[n[i]], a = r.length;
6
- for (let e = 0; e < a; e++) {
7
- let n = r[e];
8
- n.tokenTypeIdx === void 0 && this[n.name](n.children, t);
9
- }
10
- }
11
- }
12
- function createBaseSemanticVisitorConstructor(t, n) {
13
- let r = function() {};
14
- return defineNameProp(r, t + "BaseSemantics"), r.prototype = {
15
- visit: function(e, t) {
16
- if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
17
- },
18
- validateVisitor: function() {
19
- let e = validateVisitor(this, n);
20
- if (e.length !== 0) {
21
- let t = e.map((e) => e.msg);
22
- throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g, "\n ")}`);
23
- }
24
- }
25
- }, r.prototype.constructor = r, r._RULE_NAMES = n, r;
26
- }
27
- function createBaseVisitorConstructorWithDefaults(n, r, i) {
28
- let a = function() {};
29
- defineNameProp(a, n + "BaseSemanticsWithDefaults");
30
- let o = Object.create(i.prototype);
31
- return r.forEach((e) => {
32
- o[e] = defaultVisit;
33
- }), a.prototype = o, a.prototype.constructor = a, a;
34
- }
35
- var CstVisitorDefinitionError;
36
- (function(e) {
37
- e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
38
- })(CstVisitorDefinitionError ||= {});
39
- function validateVisitor(e, t) {
40
- return validateMissingCstMethods(e, t);
41
- }
42
- function validateMissingCstMethods(e, t) {
43
- return t.filter((t) => typeof e[t] != "function").map((t) => ({
44
- msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
45
- type: CstVisitorDefinitionError.MISSING_METHOD,
46
- methodName: t
47
- })).filter(Boolean);
48
- }
49
- export { createBaseSemanticVisitorConstructor, createBaseVisitorConstructorWithDefaults };
@@ -1,77 +0,0 @@
1
- import { NonTerminal, Rule, Terminal } from "../../../../@chevrotain/gast/lib/src/model.js";
2
- import { getProductionDslName } from "../../../../@chevrotain/gast/lib/src/helpers.js";
3
- import { hasTokenLabel, tokenLabel } from "../scan/tokens_public.js";
4
- const defaultParserErrorProvider = {
5
- buildMismatchTokenMessage({ expected: e, actual: t, previous: n, ruleName: r }) {
6
- return `Expecting ${hasTokenLabel(e) ? `--> ${tokenLabel(e)} <--` : `token of type --> ${e.name} <--`} but found --> '${t.image}' <--`;
7
- },
8
- buildNotAllInputParsedMessage({ firstRedundant: e, ruleName: t }) {
9
- return "Redundant input, expecting EOF but found: " + e.image;
10
- },
11
- buildNoViableAltMessage({ expectedPathsPerAlt: e, actual: t, previous: n, customUserDescription: r, ruleName: i }) {
12
- let o = "\nbut found: '" + t[0].image + "'";
13
- return r ? "Expecting: " + r + o : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) => tokenLabel(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + o;
14
- },
15
- buildEarlyExitMessage({ expectedIterationPaths: e, actual: t, customUserDescription: n, ruleName: r }) {
16
- let i = "\nbut found: '" + t[0].image + "'";
17
- return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) => tokenLabel(e)).join(",")}]`).join(" ,")}>` + i;
18
- }
19
- };
20
- Object.freeze(defaultParserErrorProvider);
21
- const defaultGrammarResolverErrorProvider = { buildRuleNotFoundError(e, t) {
22
- return "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-";
23
- } }, defaultGrammarValidatorErrorProvider = {
24
- buildDuplicateFoundError(t, i) {
25
- function a(t) {
26
- return t instanceof Terminal ? t.terminalType.name : t instanceof NonTerminal ? t.nonTerminalName : "";
27
- }
28
- let o = t.name, s = i[0], c = s.idx, l = getProductionDslName(s), u = a(s), d = `->${l}${c > 0 ? c : ""}<- ${u ? `with argument: ->${u}<-` : ""}
29
- appears more than once (${i.length} times) in the top level rule: ->${o}<-.
30
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
31
- `;
32
- return d = d.replace(/[ \t]+/g, " "), d = d.replace(/\s\s+/g, "\n"), d;
33
- },
34
- buildNamespaceConflictError(e) {
35
- return `Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`;
36
- },
37
- buildAlternationPrefixAmbiguityError(e) {
38
- let t = e.prefixPath.map((e) => tokenLabel(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
39
- return `Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`;
40
- },
41
- buildAlternationAmbiguityError(e) {
42
- let t = e.alternation.idx === 0 ? "" : e.alternation.idx, n = e.prefixPath.length === 0, r = `Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;
43
- if (n) r += "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n";
44
- else {
45
- let t = e.prefixPath.map((e) => tokenLabel(e)).join(", ");
46
- r += `<${t}> may appears as a prefix path in all these alternatives.\n`;
47
- }
48
- return r += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", r;
49
- },
50
- buildEmptyRepetitionError(e) {
51
- let t = getProductionDslName(e.repetition);
52
- return e.repetition.idx !== 0 && (t += e.repetition.idx), `The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`;
53
- },
54
- buildTokenNameError(e) {
55
- /* istanbul ignore next */
56
- return "deprecated";
57
- },
58
- buildEmptyAlternationError(e) {
59
- return `Ambiguous empty alternative: <${e.emptyChoiceIdx + 1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`;
60
- },
61
- buildTooManyAlternativesError(e) {
62
- return `An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length + 1} alternatives.`;
63
- },
64
- buildLeftRecursionError(e) {
65
- let t = e.topLevelRule.name;
66
- return `Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${`${t} --> ${e.leftRecursionPath.map((e) => e.name).concat([t]).join(" --> ")}`}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`;
67
- },
68
- buildInvalidRuleNameError(e) {
69
- /* istanbul ignore next */
70
- return "deprecated";
71
- },
72
- buildDuplicateRuleNameError(e) {
73
- let n;
74
- return n = e.topLevelRule instanceof Rule ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${n}<- is already defined in the grammar: ->${e.grammarName}<-`;
75
- }
76
- };
77
- export { defaultGrammarResolverErrorProvider, defaultGrammarValidatorErrorProvider, defaultParserErrorProvider };
@@ -1,33 +0,0 @@
1
- var MISMATCHED_TOKEN_EXCEPTION = "MismatchedTokenException", NO_VIABLE_ALT_EXCEPTION = "NoViableAltException", EARLY_EXIT_EXCEPTION = "EarlyExitException", NOT_ALL_INPUT_PARSED_EXCEPTION = "NotAllInputParsedException", RECOGNITION_EXCEPTION_NAMES = [
2
- MISMATCHED_TOKEN_EXCEPTION,
3
- NO_VIABLE_ALT_EXCEPTION,
4
- EARLY_EXIT_EXCEPTION,
5
- NOT_ALL_INPUT_PARSED_EXCEPTION
6
- ];
7
- Object.freeze(RECOGNITION_EXCEPTION_NAMES);
8
- function isRecognitionException(e) {
9
- return RECOGNITION_EXCEPTION_NAMES.includes(e.name);
10
- }
11
- var RecognitionException = class extends Error {
12
- constructor(e, c) {
13
- /* istanbul ignore next - V8 workaround to remove constructor from stacktrace when typescript target is ES5 */
14
- super(e), this.token = c, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
15
- }
16
- }, MismatchedTokenException = class extends RecognitionException {
17
- constructor(c, l, u) {
18
- super(c, l), this.previousToken = u, this.name = MISMATCHED_TOKEN_EXCEPTION;
19
- }
20
- }, NoViableAltException = class extends RecognitionException {
21
- constructor(e, l, u) {
22
- super(e, l), this.previousToken = u, this.name = NO_VIABLE_ALT_EXCEPTION;
23
- }
24
- }, NotAllInputParsedException = class extends RecognitionException {
25
- constructor(e, c) {
26
- super(e, c), this.name = NOT_ALL_INPUT_PARSED_EXCEPTION;
27
- }
28
- }, EarlyExitException = class extends RecognitionException {
29
- constructor(e, c, u) {
30
- super(e, c), this.previousToken = u, this.name = EARLY_EXIT_EXCEPTION;
31
- }
32
- };
33
- export { EarlyExitException, MismatchedTokenException, NoViableAltException, NotAllInputParsedException, isRecognitionException };
@@ -1,275 +0,0 @@
1
- import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
2
- import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
3
- import { getProductionDslName, isOptionalProd } from "../../../../../@chevrotain/gast/lib/src/helpers.js";
4
- import { tokenStructuredMatcher } from "../../scan/tokens.js";
5
- import { nextPossibleTokensAfter } from "./interpreter.js";
6
- import { containsPath, getLookaheadPathsForOptionalProd, getLookaheadPathsForOr, getProdType, isStrictPrefixOfPath } from "./lookahead.js";
7
- import { ParserDefinitionErrorType } from "../parser/parser.js";
8
- function validateLookahead(a) {
9
- return a.lookaheadStrategy.validate({
10
- rules: a.rules,
11
- tokenTypes: a.tokenTypes,
12
- grammarName: a.grammarName
13
- }).map((a) => Object.assign({ type: ParserDefinitionErrorType.CUSTOM_LOOKAHEAD_VALIDATION }, a));
14
- }
15
- function validateGrammar(a, D, O, k) {
16
- let A = a.flatMap((a) => validateDuplicateProductions(a, O)), j = checkTerminalAndNoneTerminalsNameSpace(a, D, O), M = a.flatMap((a) => validateTooManyAlts(a, O)), N = a.flatMap((D) => validateRuleDoesNotAlreadyExist(D, a, k, O));
17
- return A.concat(j, M, N);
18
- }
19
- function validateDuplicateProductions(a, D) {
20
- let O = new OccurrenceValidationCollector();
21
- a.accept(O);
22
- let k = O.allProductions, A = Object.groupBy(k, identifyProductionForDuplicates), j = Object.fromEntries(Object.entries(A).filter(([a, D]) => D.length > 1));
23
- return Object.values(j).map((O) => {
24
- let k = O[0], A = D.buildDuplicateFoundError(a, O), j = getProductionDslName(k), M = {
25
- message: A,
26
- type: ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,
27
- ruleName: a.name,
28
- dslName: j,
29
- occurrence: k.idx
30
- }, N = getExtraProductionArgument(k);
31
- return N && (M.parameter = N), M;
32
- });
33
- }
34
- function identifyProductionForDuplicates(a) {
35
- return `${getProductionDslName(a)}_#_${a.idx}_#_${getExtraProductionArgument(a)}`;
36
- }
37
- function getExtraProductionArgument(a) {
38
- return a instanceof Terminal ? a.terminalType.name : a instanceof NonTerminal ? a.nonTerminalName : "";
39
- }
40
- var OccurrenceValidationCollector = class extends GAstVisitor {
41
- constructor() {
42
- super(...arguments), this.allProductions = [];
43
- }
44
- visitNonTerminal(a) {
45
- this.allProductions.push(a);
46
- }
47
- visitOption(a) {
48
- this.allProductions.push(a);
49
- }
50
- visitRepetitionWithSeparator(a) {
51
- this.allProductions.push(a);
52
- }
53
- visitRepetitionMandatory(a) {
54
- this.allProductions.push(a);
55
- }
56
- visitRepetitionMandatoryWithSeparator(a) {
57
- this.allProductions.push(a);
58
- }
59
- visitRepetition(a) {
60
- this.allProductions.push(a);
61
- }
62
- visitAlternation(a) {
63
- this.allProductions.push(a);
64
- }
65
- visitTerminal(a) {
66
- this.allProductions.push(a);
67
- }
68
- };
69
- function validateRuleDoesNotAlreadyExist(a, D, O, k) {
70
- let A = [];
71
- if (D.reduce((D, O) => O.name === a.name ? D + 1 : D, 0) > 1) {
72
- let D = k.buildDuplicateRuleNameError({
73
- topLevelRule: a,
74
- grammarName: O
75
- });
76
- A.push({
77
- message: D,
78
- type: ParserDefinitionErrorType.DUPLICATE_RULE_NAME,
79
- ruleName: a.name
80
- });
81
- }
82
- return A;
83
- }
84
- function validateRuleIsOverridden(a, D, O) {
85
- let k = [], A;
86
- return D.includes(a) || (A = `Invalid rule override, rule: ->${a}<- cannot be overridden in the grammar: ->${O}<-as it is not defined in any of the super grammars `, k.push({
87
- message: A,
88
- type: ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,
89
- ruleName: a
90
- })), k;
91
- }
92
- function validateNoLeftRecursion(a, D, O, k = []) {
93
- let A = [], j = getFirstNoneTerminal(D.definition);
94
- if (j.length === 0) return [];
95
- {
96
- let D = a.name;
97
- j.includes(a) && A.push({
98
- message: O.buildLeftRecursionError({
99
- topLevelRule: a,
100
- leftRecursionPath: k
101
- }),
102
- type: ParserDefinitionErrorType.LEFT_RECURSION,
103
- ruleName: D
104
- });
105
- let M = k.concat([a]), N = j.filter((a) => !M.includes(a)).flatMap((D) => {
106
- let A = [...k];
107
- return A.push(D), validateNoLeftRecursion(a, D, O, A);
108
- });
109
- return A.concat(N);
110
- }
111
- }
112
- function getFirstNoneTerminal(P) {
113
- let F = [];
114
- if (P.length === 0) return F;
115
- let I = P[0];
116
- /* istanbul ignore else */
117
- if (I instanceof NonTerminal) F.push(I.referencedRule);
118
- else if (I instanceof Alternative || I instanceof Option || I instanceof RepetitionMandatory || I instanceof RepetitionMandatoryWithSeparator || I instanceof RepetitionWithSeparator || I instanceof Repetition) F = F.concat(getFirstNoneTerminal(I.definition));
119
- else if (I instanceof Alternation) F = I.definition.map((a) => getFirstNoneTerminal(a.definition)).flat();
120
- else if (!(I instanceof Terminal)) throw Error("non exhaustive match");
121
- let L = isOptionalProd(I), R = P.length > 1;
122
- if (L && R) {
123
- let a = P.slice(1);
124
- return F.concat(getFirstNoneTerminal(a));
125
- } else return F;
126
- }
127
- var OrCollector = class extends GAstVisitor {
128
- constructor() {
129
- super(...arguments), this.alternations = [];
130
- }
131
- visitAlternation(a) {
132
- this.alternations.push(a);
133
- }
134
- };
135
- function validateEmptyOrAlternative(a, D) {
136
- let O = new OrCollector();
137
- return a.accept(O), O.alternations.flatMap((O) => O.definition.slice(0, -1).flatMap((k, A) => nextPossibleTokensAfter([k], [], tokenStructuredMatcher, 1).length === 0 ? [{
138
- message: D.buildEmptyAlternationError({
139
- topLevelRule: a,
140
- alternation: O,
141
- emptyChoiceIdx: A
142
- }),
143
- type: ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,
144
- ruleName: a.name,
145
- occurrence: O.idx,
146
- alternative: A + 1
147
- }] : []));
148
- }
149
- function validateAmbiguousAlternationAlternatives(a, D, O) {
150
- let k = new OrCollector();
151
- a.accept(k);
152
- let A = k.alternations;
153
- return A = A.filter((a) => a.ignoreAmbiguities !== !0), A.flatMap((k) => {
154
- let A = k.idx, j = getLookaheadPathsForOr(A, a, k.maxLookahead || D, k), M = checkAlternativesAmbiguities(j, k, a, O), N = checkPrefixAlternativesAmbiguities(j, k, a, O);
155
- return M.concat(N);
156
- });
157
- }
158
- var RepetitionCollector = class extends GAstVisitor {
159
- constructor() {
160
- super(...arguments), this.allProductions = [];
161
- }
162
- visitRepetitionWithSeparator(a) {
163
- this.allProductions.push(a);
164
- }
165
- visitRepetitionMandatory(a) {
166
- this.allProductions.push(a);
167
- }
168
- visitRepetitionMandatoryWithSeparator(a) {
169
- this.allProductions.push(a);
170
- }
171
- visitRepetition(a) {
172
- this.allProductions.push(a);
173
- }
174
- };
175
- function validateTooManyAlts(a, D) {
176
- let O = new OrCollector();
177
- return a.accept(O), O.alternations.flatMap((O) => O.definition.length > 255 ? [{
178
- message: D.buildTooManyAlternativesError({
179
- topLevelRule: a,
180
- alternation: O
181
- }),
182
- type: ParserDefinitionErrorType.TOO_MANY_ALTS,
183
- ruleName: a.name,
184
- occurrence: O.idx
185
- }] : []);
186
- }
187
- function validateSomeNonEmptyLookaheadPath(a, D, O) {
188
- let k = [];
189
- return a.forEach((a) => {
190
- let A = new RepetitionCollector();
191
- a.accept(A), A.allProductions.forEach((A) => {
192
- let j = getProdType(A), M = A.maxLookahead || D, N = A.idx;
193
- if (getLookaheadPathsForOptionalProd(N, a, j, M)[0].flat().length === 0) {
194
- let D = O.buildEmptyRepetitionError({
195
- topLevelRule: a,
196
- repetition: A
197
- });
198
- k.push({
199
- message: D,
200
- type: ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,
201
- ruleName: a.name
202
- });
203
- }
204
- });
205
- }), k;
206
- }
207
- function checkAlternativesAmbiguities(a, D, O, k) {
208
- let A = [];
209
- return a.reduce((O, k, j) => (D.definition[j].ignoreAmbiguities === !0 || k.forEach((k) => {
210
- let M = [j];
211
- a.forEach((a, O) => {
212
- j !== O && containsPath(a, k) && D.definition[O].ignoreAmbiguities !== !0 && M.push(O);
213
- }), M.length > 1 && !containsPath(A, k) && (A.push(k), O.push({
214
- alts: M,
215
- path: k
216
- }));
217
- }), O), []).map((a) => {
218
- let A = a.alts.map((a) => a + 1);
219
- return {
220
- message: k.buildAlternationAmbiguityError({
221
- topLevelRule: O,
222
- alternation: D,
223
- ambiguityIndices: A,
224
- prefixPath: a.path
225
- }),
226
- type: ParserDefinitionErrorType.AMBIGUOUS_ALTS,
227
- ruleName: O.name,
228
- occurrence: D.idx,
229
- alternatives: a.alts
230
- };
231
- });
232
- }
233
- function checkPrefixAlternativesAmbiguities(a, D, O, k) {
234
- let A = a.reduce((a, D, O) => {
235
- let k = D.map((a) => ({
236
- idx: O,
237
- path: a
238
- }));
239
- return a.concat(k);
240
- }, []);
241
- return A.flatMap((a) => {
242
- if (D.definition[a.idx].ignoreAmbiguities === !0) return [];
243
- let j = a.idx, M = a.path;
244
- return A.filter((a) => D.definition[a.idx].ignoreAmbiguities !== !0 && a.idx < j && isStrictPrefixOfPath(a.path, M)).map((a) => {
245
- let A = [a.idx + 1, j + 1], M = D.idx === 0 ? "" : D.idx;
246
- return {
247
- message: k.buildAlternationPrefixAmbiguityError({
248
- topLevelRule: O,
249
- alternation: D,
250
- ambiguityIndices: A,
251
- prefixPath: a.path
252
- }),
253
- type: ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,
254
- ruleName: O.name,
255
- occurrence: M,
256
- alternatives: A
257
- };
258
- });
259
- });
260
- }
261
- function checkTerminalAndNoneTerminalsNameSpace(a, D, O) {
262
- let k = [], A = D.map((a) => a.name);
263
- return a.forEach((a) => {
264
- let D = a.name;
265
- if (A.includes(D)) {
266
- let A = O.buildNamespaceConflictError(a);
267
- k.push({
268
- message: A,
269
- type: ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,
270
- ruleName: D
271
- });
272
- }
273
- }), k;
274
- }
275
- export { validateAmbiguousAlternationAlternatives, validateEmptyOrAlternative, validateGrammar, validateLookahead, validateNoLeftRecursion, validateRuleIsOverridden, validateSomeNonEmptyLookaheadPath };
@@ -1,23 +0,0 @@
1
- import { NonTerminal, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
2
- import { isBranchingProd, isOptionalProd, isSequenceProd } from "../../../../../@chevrotain/gast/lib/src/helpers.js";
3
- function first(i) {
4
- /* istanbul ignore else */
5
- if (i instanceof NonTerminal) return first(i.referencedRule);
6
- if (i instanceof Terminal) return firstForTerminal(i);
7
- if (isSequenceProd(i)) return firstForSequence(i);
8
- if (isBranchingProd(i)) return firstForBranching(i);
9
- throw Error("non exhaustive match");
10
- }
11
- function firstForSequence(e) {
12
- let n = [], r = e.definition, a = 0, o = r.length > a, s, c = !0;
13
- for (; o && c;) s = r[a], c = isOptionalProd(s), n = n.concat(first(s)), a += 1, o = r.length > a;
14
- return [...new Set(n)];
15
- }
16
- function firstForBranching(e) {
17
- let n = e.definition.map((e) => first(e));
18
- return [...new Set(n.flat())];
19
- }
20
- function firstForTerminal(e) {
21
- return [e.terminalType];
22
- }
23
- export { first };
@@ -1,28 +0,0 @@
1
- import { Alternative } from "../../../../../@chevrotain/gast/lib/src/model.js";
2
- import { RestWalker } from "./rest.js";
3
- import { first } from "./first.js";
4
- import { IN } from "../constants.js";
5
- var ResyncFollowsWalker = class extends RestWalker {
6
- constructor(e) {
7
- super(), this.topProd = e, this.follows = {};
8
- }
9
- startWalking() {
10
- return this.walk(this.topProd), this.follows;
11
- }
12
- walkTerminal(e, n, r) {}
13
- walkProdRef(n, i, a) {
14
- let o = buildBetweenProdsFollowPrefix(n.referencedRule, n.idx) + this.topProd.name, s = first(new Alternative({ definition: i.concat(a) }));
15
- this.follows[o] = s;
16
- }
17
- };
18
- function computeAllProdsFollows(e) {
19
- let n = {};
20
- return e.forEach((e) => {
21
- let r = new ResyncFollowsWalker(e).startWalking();
22
- Object.assign(n, r);
23
- }), n;
24
- }
25
- function buildBetweenProdsFollowPrefix(e, n) {
26
- return e.name + n + IN;
27
- }
28
- export { computeAllProdsFollows };