@loopstack/loopstack-studio 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -1,43 +1,36 @@
1
- import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
2
- import clone_default from "../../../../../lodash-es/clone.js";
3
- import last_default from "../../../../../lodash-es/last.js";
4
- import drop_default from "../../../../../lodash-es/drop.js";
5
- import dropRight_default from "../../../../../lodash-es/dropRight.js";
6
- import forEach_default from "../../../../../lodash-es/forEach.js";
7
- import head_default from "../../../../../lodash-es/head.js";
8
1
  import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Rule, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
9
2
  import { RestWalker } from "./rest.js";
10
3
  import { first } from "./first.js";
11
4
  var AbstractNextPossibleTokensWalker = class extends RestWalker {
12
- constructor(e, d) {
13
- super(), this.topProd = e, this.path = d, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
5
+ constructor(e, a) {
6
+ super(), this.topProd = e, this.path = a, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
14
7
  }
15
8
  startWalking() {
16
9
  if (this.found = !1, this.path.ruleStack[0] !== this.topProd.name) throw Error("The path does not start with the walker's top Rule!");
17
- return this.ruleStack = clone_default(this.path.ruleStack).reverse(), this.occurrenceStack = clone_default(this.path.occurrenceStack).reverse(), this.ruleStack.pop(), this.occurrenceStack.pop(), this.updateExpectedNext(), this.walk(this.topProd), this.possibleTokTypes;
10
+ return this.ruleStack = [...this.path.ruleStack].reverse(), this.occurrenceStack = [...this.path.occurrenceStack].reverse(), this.ruleStack.pop(), this.occurrenceStack.pop(), this.updateExpectedNext(), this.walk(this.topProd), this.possibleTokTypes;
18
11
  }
19
- walk(e, d = []) {
20
- this.found || super.walk(e, d);
12
+ walk(e, a = []) {
13
+ this.found || super.walk(e, a);
21
14
  }
22
- walkProdRef(e, d, f) {
15
+ walkProdRef(e, a, o) {
23
16
  if (e.referencedRule.name === this.nextProductionName && e.idx === this.nextProductionOccurrence) {
24
- let p = d.concat(f);
25
- this.updateExpectedNext(), this.walk(e.referencedRule, p);
17
+ let s = a.concat(o);
18
+ this.updateExpectedNext(), this.walk(e.referencedRule, s);
26
19
  }
27
20
  }
28
21
  updateExpectedNext() {
29
- isEmpty_default(this.ruleStack) ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
22
+ this.ruleStack.length === 0 ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
30
23
  }
31
24
  }, NextAfterTokenWalker = class extends AbstractNextPossibleTokensWalker {
32
- constructor(e, d) {
33
- super(e, d), this.path = d, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
25
+ constructor(e, a) {
26
+ super(e, a), this.path = a, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
34
27
  }
35
- walkTerminal(e, d, f) {
36
- this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found && (this.possibleTokTypes = first(new Alternative({ definition: d.concat(f) })), this.found = !0);
28
+ walkTerminal(e, o, s) {
29
+ this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found && (this.possibleTokTypes = first(new Alternative({ definition: o.concat(s) })), this.found = !0);
37
30
  }
38
31
  }, AbstractNextTerminalAfterProductionWalker = class extends RestWalker {
39
- constructor(e, d) {
40
- super(), this.topRule = e, this.occurrence = d, this.result = {
32
+ constructor(e, a) {
33
+ super(), this.topRule = e, this.occurrence = a, this.result = {
41
34
  token: void 0,
42
35
  occurrence: void 0,
43
36
  isEndOfRule: void 0
@@ -47,223 +40,223 @@ var AbstractNextPossibleTokensWalker = class extends RestWalker {
47
40
  return this.walk(this.topRule), this.result;
48
41
  }
49
42
  }, NextTerminalAfterManyWalker = class extends AbstractNextTerminalAfterProductionWalker {
50
- walkMany(e, d, f) {
43
+ walkMany(e, a, o) {
51
44
  if (e.idx === this.occurrence) {
52
- let e = head_default(d.concat(f));
45
+ let e = a.concat(o)[0];
53
46
  this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
54
- } else super.walkMany(e, d, f);
47
+ } else super.walkMany(e, a, o);
55
48
  }
56
49
  }, NextTerminalAfterManySepWalker = class extends AbstractNextTerminalAfterProductionWalker {
57
- walkManySep(e, d, f) {
50
+ walkManySep(e, a, o) {
58
51
  if (e.idx === this.occurrence) {
59
- let e = head_default(d.concat(f));
52
+ let e = a.concat(o)[0];
60
53
  this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
61
- } else super.walkManySep(e, d, f);
54
+ } else super.walkManySep(e, a, o);
62
55
  }
63
56
  }, NextTerminalAfterAtLeastOneWalker = class extends AbstractNextTerminalAfterProductionWalker {
64
- walkAtLeastOne(e, d, f) {
57
+ walkAtLeastOne(e, a, o) {
65
58
  if (e.idx === this.occurrence) {
66
- let e = head_default(d.concat(f));
59
+ let e = a.concat(o)[0];
67
60
  this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
68
- } else super.walkAtLeastOne(e, d, f);
61
+ } else super.walkAtLeastOne(e, a, o);
69
62
  }
70
63
  }, NextTerminalAfterAtLeastOneSepWalker = class extends AbstractNextTerminalAfterProductionWalker {
71
- walkAtLeastOneSep(e, d, f) {
64
+ walkAtLeastOneSep(e, a, o) {
72
65
  if (e.idx === this.occurrence) {
73
- let e = head_default(d.concat(f));
66
+ let e = a.concat(o)[0];
74
67
  this.result.isEndOfRule = e === void 0, e instanceof Terminal && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
75
- } else super.walkAtLeastOneSep(e, d, f);
68
+ } else super.walkAtLeastOneSep(e, a, o);
76
69
  }
77
70
  };
78
- function possiblePathsFrom(f, m, g = []) {
79
- g = clone_default(g);
80
- let _ = [], v = 0;
81
- function y(e) {
82
- return e.concat(drop_default(f, v + 1));
71
+ function possiblePathsFrom(u, d, f = []) {
72
+ f = [...f];
73
+ let p = [], m = 0;
74
+ function h(e) {
75
+ return e.concat(u.slice(m + 1));
83
76
  }
84
- function b(e) {
85
- let d = possiblePathsFrom(y(e), m, g);
86
- return _.concat(d);
77
+ function g(e) {
78
+ let a = possiblePathsFrom(h(e), d, f);
79
+ return p.concat(a);
87
80
  }
88
- for (; g.length < m && v < f.length;) {
89
- let d = f[v];
90
- if (d instanceof Alternative || d instanceof NonTerminal) return b(d.definition);
91
- if (d instanceof Option) _ = b(d.definition);
92
- else if (d instanceof RepetitionMandatory) return b(d.definition.concat([new Repetition({ definition: d.definition })]));
93
- else if (d instanceof RepetitionMandatoryWithSeparator) return b([new Alternative({ definition: d.definition }), new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]);
94
- else if (d instanceof RepetitionWithSeparator) _ = b(d.definition.concat([new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]));
95
- else if (d instanceof Repetition) _ = b(d.definition.concat([new Repetition({ definition: d.definition })]));
96
- else if (d instanceof Alternation) return forEach_default(d.definition, (d) => {
97
- isEmpty_default(d.definition) === !1 && (_ = b(d.definition));
98
- }), _;
99
- else if (d instanceof Terminal) g.push(d.terminalType);
81
+ for (; f.length < d && m < u.length;) {
82
+ let d = u[m];
83
+ if (d instanceof Alternative || d instanceof NonTerminal) return g(d.definition);
84
+ if (d instanceof Option) p = g(d.definition);
85
+ else if (d instanceof RepetitionMandatory) return g(d.definition.concat([new Repetition({ definition: d.definition })]));
86
+ else if (d instanceof RepetitionMandatoryWithSeparator) return g([new Alternative({ definition: d.definition }), new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]);
87
+ else if (d instanceof RepetitionWithSeparator) p = g(d.definition.concat([new Repetition({ definition: [new Terminal({ terminalType: d.separator })].concat(d.definition) })]));
88
+ else if (d instanceof Repetition) p = g(d.definition.concat([new Repetition({ definition: d.definition })]));
89
+ else if (d instanceof Alternation) return d.definition.forEach((e) => {
90
+ e.definition.length !== 0 && (p = g(e.definition));
91
+ }), p;
92
+ else if (d instanceof Terminal) f.push(d.terminalType);
100
93
  else throw Error("non exhaustive match");
101
- v++;
94
+ m++;
102
95
  }
103
- return _.push({
104
- partialPath: g,
105
- suffixDef: drop_default(f, v)
106
- }), _;
96
+ return p.push({
97
+ partialPath: f,
98
+ suffixDef: u.slice(m)
99
+ }), p;
107
100
  }
108
- function nextPossibleTokensAfter(h, g, v, y) {
109
- let b = "EXIT_NONE_TERMINAL", x = [b], S = "EXIT_ALTERNATIVE", C = !1, w = g.length, T = w - y - 1, E = [], D = [];
110
- for (D.push({
101
+ function nextPossibleTokensAfter(d, f, p, m) {
102
+ let h = "EXIT_NONE_TERMINAL", g = [h], _ = "EXIT_ALTERNATIVE", v = !1, y = f.length, b = y - m - 1, x = [], S = [];
103
+ for (S.push({
111
104
  idx: -1,
112
- def: h,
105
+ def: d,
113
106
  ruleStack: [],
114
107
  occurrenceStack: []
115
- }); !isEmpty_default(D);) {
116
- let h = D.pop();
117
- if (h === S) {
118
- C && last_default(D).idx <= T && D.pop();
108
+ }); S.length !== 0;) {
109
+ let d = S.pop();
110
+ if (d === _) {
111
+ v && S.at(-1).idx <= b && S.pop();
119
112
  continue;
120
113
  }
121
- let y = h.def, O = h.idx, k = h.ruleStack, A = h.occurrenceStack;
122
- if (isEmpty_default(y)) continue;
123
- let j = y[0];
114
+ let m = d.def, C = d.idx, w = d.ruleStack, T = d.occurrenceStack;
115
+ if (m.length === 0) continue;
116
+ let E = m[0];
124
117
  /* istanbul ignore else */
125
- if (j === b) {
118
+ if (E === h) {
126
119
  let e = {
127
- idx: O,
128
- def: drop_default(y),
129
- ruleStack: dropRight_default(k),
130
- occurrenceStack: dropRight_default(A)
120
+ idx: C,
121
+ def: m.slice(1),
122
+ ruleStack: w.slice(0, -1),
123
+ occurrenceStack: T.slice(0, -1)
131
124
  };
132
- D.push(e);
133
- } else if (j instanceof Terminal)
125
+ S.push(e);
126
+ } else if (E instanceof Terminal)
134
127
  /* istanbul ignore else */
135
- if (O < w - 1) {
136
- let e = O + 1, d = g[e];
137
- if (v(d, j.terminalType)) {
138
- let d = {
128
+ if (C < y - 1) {
129
+ let e = C + 1, a = f[e];
130
+ if (p(a, E.terminalType)) {
131
+ let a = {
139
132
  idx: e,
140
- def: drop_default(y),
141
- ruleStack: k,
142
- occurrenceStack: A
133
+ def: m.slice(1),
134
+ ruleStack: w,
135
+ occurrenceStack: T
143
136
  };
144
- D.push(d);
137
+ S.push(a);
145
138
  }
146
- } else if (O === w - 1) E.push({
147
- nextTokenType: j.terminalType,
148
- nextTokenOccurrence: j.idx,
149
- ruleStack: k,
150
- occurrenceStack: A
151
- }), C = !0;
139
+ } else if (C === y - 1) x.push({
140
+ nextTokenType: E.terminalType,
141
+ nextTokenOccurrence: E.idx,
142
+ ruleStack: w,
143
+ occurrenceStack: T
144
+ }), v = !0;
152
145
  else throw Error("non exhaustive match");
153
- else if (j instanceof NonTerminal) {
154
- let e = clone_default(k);
155
- e.push(j.nonTerminalName);
156
- let f = clone_default(A);
157
- f.push(j.idx);
158
- let m = {
159
- idx: O,
160
- def: j.definition.concat(x, drop_default(y)),
146
+ else if (E instanceof NonTerminal) {
147
+ let e = [...w];
148
+ e.push(E.nonTerminalName);
149
+ let a = [...T];
150
+ a.push(E.idx);
151
+ let o = {
152
+ idx: C,
153
+ def: E.definition.concat(g, m.slice(1)),
161
154
  ruleStack: e,
162
- occurrenceStack: f
155
+ occurrenceStack: a
163
156
  };
164
- D.push(m);
165
- } else if (j instanceof Option) {
157
+ S.push(o);
158
+ } else if (E instanceof Option) {
166
159
  let e = {
167
- idx: O,
168
- def: drop_default(y),
169
- ruleStack: k,
170
- occurrenceStack: A
160
+ idx: C,
161
+ def: m.slice(1),
162
+ ruleStack: w,
163
+ occurrenceStack: T
171
164
  };
172
- D.push(e), D.push(S);
173
- let d = {
174
- idx: O,
175
- def: j.definition.concat(drop_default(y)),
176
- ruleStack: k,
177
- occurrenceStack: A
165
+ S.push(e), S.push(_);
166
+ let a = {
167
+ idx: C,
168
+ def: E.definition.concat(m.slice(1)),
169
+ ruleStack: w,
170
+ occurrenceStack: T
178
171
  };
179
- D.push(d);
180
- } else if (j instanceof RepetitionMandatory) {
172
+ S.push(a);
173
+ } else if (E instanceof RepetitionMandatory) {
181
174
  let e = new Repetition({
182
- definition: j.definition,
183
- idx: j.idx
184
- }), d = {
185
- idx: O,
186
- def: j.definition.concat([e], drop_default(y)),
187
- ruleStack: k,
188
- occurrenceStack: A
175
+ definition: E.definition,
176
+ idx: E.idx
177
+ }), a = {
178
+ idx: C,
179
+ def: E.definition.concat([e], m.slice(1)),
180
+ ruleStack: w,
181
+ occurrenceStack: T
189
182
  };
190
- D.push(d);
191
- } else if (j instanceof RepetitionMandatoryWithSeparator) {
183
+ S.push(a);
184
+ } else if (E instanceof RepetitionMandatoryWithSeparator) {
192
185
  let e = new Repetition({
193
- definition: [new Terminal({ terminalType: j.separator })].concat(j.definition),
194
- idx: j.idx
195
- }), d = {
196
- idx: O,
197
- def: j.definition.concat([e], drop_default(y)),
198
- ruleStack: k,
199
- occurrenceStack: A
186
+ definition: [new Terminal({ terminalType: E.separator })].concat(E.definition),
187
+ idx: E.idx
188
+ }), a = {
189
+ idx: C,
190
+ def: E.definition.concat([e], m.slice(1)),
191
+ ruleStack: w,
192
+ occurrenceStack: T
200
193
  };
201
- D.push(d);
202
- } else if (j instanceof RepetitionWithSeparator) {
194
+ S.push(a);
195
+ } else if (E instanceof RepetitionWithSeparator) {
203
196
  let e = {
204
- idx: O,
205
- def: drop_default(y),
206
- ruleStack: k,
207
- occurrenceStack: A
197
+ idx: C,
198
+ def: m.slice(1),
199
+ ruleStack: w,
200
+ occurrenceStack: T
208
201
  };
209
- D.push(e), D.push(S);
210
- let d = new Repetition({
211
- definition: [new Terminal({ terminalType: j.separator })].concat(j.definition),
212
- idx: j.idx
213
- }), f = {
214
- idx: O,
215
- def: j.definition.concat([d], drop_default(y)),
216
- ruleStack: k,
217
- occurrenceStack: A
202
+ S.push(e), S.push(_);
203
+ let a = new Repetition({
204
+ definition: [new Terminal({ terminalType: E.separator })].concat(E.definition),
205
+ idx: E.idx
206
+ }), o = {
207
+ idx: C,
208
+ def: E.definition.concat([a], m.slice(1)),
209
+ ruleStack: w,
210
+ occurrenceStack: T
218
211
  };
219
- D.push(f);
220
- } else if (j instanceof Repetition) {
212
+ S.push(o);
213
+ } else if (E instanceof Repetition) {
221
214
  let e = {
222
- idx: O,
223
- def: drop_default(y),
224
- ruleStack: k,
225
- occurrenceStack: A
215
+ idx: C,
216
+ def: m.slice(1),
217
+ ruleStack: w,
218
+ occurrenceStack: T
226
219
  };
227
- D.push(e), D.push(S);
228
- let d = new Repetition({
229
- definition: j.definition,
230
- idx: j.idx
231
- }), f = {
232
- idx: O,
233
- def: j.definition.concat([d], drop_default(y)),
234
- ruleStack: k,
235
- occurrenceStack: A
220
+ S.push(e), S.push(_);
221
+ let a = new Repetition({
222
+ definition: E.definition,
223
+ idx: E.idx
224
+ }), o = {
225
+ idx: C,
226
+ def: E.definition.concat([a], m.slice(1)),
227
+ ruleStack: w,
228
+ occurrenceStack: T
236
229
  };
237
- D.push(f);
238
- } else if (j instanceof Alternation) for (let e = j.definition.length - 1; e >= 0; e--) {
239
- let d = {
240
- idx: O,
241
- def: j.definition[e].definition.concat(drop_default(y)),
242
- ruleStack: k,
243
- occurrenceStack: A
230
+ S.push(o);
231
+ } else if (E instanceof Alternation) for (let e = E.definition.length - 1; e >= 0; e--) {
232
+ let a = {
233
+ idx: C,
234
+ def: E.definition[e].definition.concat(m.slice(1)),
235
+ ruleStack: w,
236
+ occurrenceStack: T
244
237
  };
245
- D.push(d), D.push(S);
238
+ S.push(a), S.push(_);
246
239
  }
247
- else if (j instanceof Alternative) D.push({
248
- idx: O,
249
- def: j.definition.concat(drop_default(y)),
250
- ruleStack: k,
251
- occurrenceStack: A
240
+ else if (E instanceof Alternative) S.push({
241
+ idx: C,
242
+ def: E.definition.concat(m.slice(1)),
243
+ ruleStack: w,
244
+ occurrenceStack: T
252
245
  });
253
- else if (j instanceof Rule) D.push(expandTopLevelRule(j, O, k, A));
246
+ else if (E instanceof Rule) S.push(expandTopLevelRule(E, C, w, T));
254
247
  else throw Error("non exhaustive match");
255
248
  }
256
- return E;
249
+ return x;
257
250
  }
258
- function expandTopLevelRule(e, f, p, m) {
259
- let h = clone_default(p);
260
- h.push(e.name);
261
- let g = clone_default(m);
262
- return g.push(1), {
263
- idx: f,
251
+ function expandTopLevelRule(e, a, o, s) {
252
+ let c = [...o];
253
+ c.push(e.name);
254
+ let l = [...s];
255
+ return l.push(1), {
256
+ idx: a,
264
257
  def: e.definition,
265
- ruleStack: h,
266
- occurrenceStack: g
258
+ ruleStack: c,
259
+ occurrenceStack: l
267
260
  };
268
261
  }
269
262
  export { NextAfterTokenWalker, NextTerminalAfterAtLeastOneSepWalker, NextTerminalAfterAtLeastOneWalker, NextTerminalAfterManySepWalker, NextTerminalAfterManyWalker, nextPossibleTokensAfter, possiblePathsFrom };
@@ -1,5 +1,3 @@
1
- import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
2
- import flatMap_default from "../../../../../lodash-es/flatMap.js";
3
1
  import { defaultGrammarValidatorErrorProvider } from "../errors_public.js";
4
2
  import { buildAlternativesLookAheadFunc, buildLookaheadFuncForOptionalProd, buildLookaheadFuncForOr, buildSingleAlternativeLookaheadFunction, getProdType } from "./lookahead.js";
5
3
  import { validateAmbiguousAlternationAlternatives, validateEmptyOrAlternative, validateNoLeftRecursion, validateSomeNonEmptyLookaheadPath } from "./checks.js";
@@ -8,30 +6,30 @@ var LLkLookaheadStrategy = class {
8
6
  constructor(e) {
9
7
  this.maxLookahead = e?.maxLookahead ?? DEFAULT_PARSER_CONFIG.maxLookahead;
10
8
  }
11
- validate(u) {
12
- let d = this.validateNoLeftRecursion(u.rules);
13
- if (isEmpty_default(d)) {
14
- let e = this.validateEmptyOrAlternatives(u.rules), f = this.validateAmbiguousAlternationAlternatives(u.rules, this.maxLookahead), p = this.validateSomeNonEmptyLookaheadPath(u.rules, this.maxLookahead);
9
+ validate(e) {
10
+ let c = this.validateNoLeftRecursion(e.rules);
11
+ if (c.length === 0) {
12
+ let l = this.validateEmptyOrAlternatives(e.rules), u = this.validateAmbiguousAlternationAlternatives(e.rules, this.maxLookahead), d = this.validateSomeNonEmptyLookaheadPath(e.rules, this.maxLookahead);
15
13
  return [
16
- ...d,
17
- ...e,
18
- ...f,
19
- ...p
14
+ ...c,
15
+ ...l,
16
+ ...u,
17
+ ...d
20
18
  ];
21
19
  }
22
- return d;
20
+ return c;
23
21
  }
24
- validateNoLeftRecursion(e) {
25
- return flatMap_default(e, (e) => validateNoLeftRecursion(e, e, defaultGrammarValidatorErrorProvider));
22
+ validateNoLeftRecursion(c) {
23
+ return c.flatMap((c) => validateNoLeftRecursion(c, c, defaultGrammarValidatorErrorProvider));
26
24
  }
27
- validateEmptyOrAlternatives(e) {
28
- return flatMap_default(e, (e) => validateEmptyOrAlternative(e, defaultGrammarValidatorErrorProvider));
25
+ validateEmptyOrAlternatives(c) {
26
+ return c.flatMap((c) => validateEmptyOrAlternative(c, defaultGrammarValidatorErrorProvider));
29
27
  }
30
- validateAmbiguousAlternationAlternatives(e, f) {
31
- return flatMap_default(e, (e) => validateAmbiguousAlternationAlternatives(e, f, defaultGrammarValidatorErrorProvider));
28
+ validateAmbiguousAlternationAlternatives(c, l) {
29
+ return c.flatMap((c) => validateAmbiguousAlternationAlternatives(c, l, defaultGrammarValidatorErrorProvider));
32
30
  }
33
- validateSomeNonEmptyLookaheadPath(e, u) {
34
- return validateSomeNonEmptyLookaheadPath(e, u, defaultGrammarValidatorErrorProvider);
31
+ validateSomeNonEmptyLookaheadPath(c, l) {
32
+ return validateSomeNonEmptyLookaheadPath(c, l, defaultGrammarValidatorErrorProvider);
35
33
  }
36
34
  buildLookaheadForAlternation(e) {
37
35
  return buildLookaheadFuncForOr(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, buildAlternativesLookAheadFunc);