@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,13 +1,6 @@
1
- import isEmpty_default from "../../../../../../lodash-es/isEmpty.js";
2
- import flatten_default from "../../../../../../lodash-es/flatten.js";
3
- import clone_default from "../../../../../../lodash-es/clone.js";
4
- import dropRight_default from "../../../../../../lodash-es/dropRight.js";
5
- import find_default from "../../../../../../lodash-es/find.js";
6
- import map_default from "../../../../../../lodash-es/map.js";
7
- import has_default from "../../../../../../lodash-es/has.js";
8
- import includes_default from "../../../../../../lodash-es/includes.js";
9
1
  import { IN } from "../../constants.js";
10
2
  import { EOF, createTokenInstance, tokenMatcher } from "../../../scan/tokens_public.js";
3
+ import { NextAfterTokenWalker } from "../../grammar/interpreter.js";
11
4
  import { MismatchedTokenException } from "../../exceptions_public.js";
12
5
  import { DEFAULT_PARSER_CONFIG } from "../parser.js";
13
6
  const EOF_FOLLOW_KEY = {}, IN_RULE_RECOVERY_EXCEPTION = "InRuleRecoveryException";
@@ -17,11 +10,11 @@ var InRuleRecoveryException = class extends Error {
17
10
  }
18
11
  }, Recoverable = class {
19
12
  initRecoverable(e) {
20
- this.firstAfterRepMap = {}, this.resyncFollows = {}, this.recoveryEnabled = has_default(e, "recoveryEnabled") ? e.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = attemptInRepetitionRecovery);
13
+ this.firstAfterRepMap = {}, this.resyncFollows = {}, this.recoveryEnabled = Object.hasOwn(e, "recoveryEnabled") ? e.recoveryEnabled : DEFAULT_PARSER_CONFIG.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = attemptInRepetitionRecovery);
21
14
  }
22
15
  getTokenToInsert(e) {
23
- let s = createTokenInstance(e, "", NaN, NaN, NaN, NaN, NaN, NaN);
24
- return s.isInsertedInRecovery = !0, s;
16
+ let t = createTokenInstance(e, "", NaN, NaN, NaN, NaN, NaN, NaN);
17
+ return t.isInsertedInRecovery = !0, t;
25
18
  }
26
19
  canTokenTypeBeInsertedInRecovery(e) {
27
20
  return !0;
@@ -29,116 +22,123 @@ var InRuleRecoveryException = class extends Error {
29
22
  canTokenTypeBeDeletedInRecovery(e) {
30
23
  return !0;
31
24
  }
32
- tryInRepetitionRecovery(e, s, c, u) {
33
- let d = this.findReSyncTokenType(), f = this.exportLexerState(), p = [], m = !1, h = this.LA(1), g = this.LA(1), _ = () => {
34
- let e = this.LA(0), s = new MismatchedTokenException(this.errorMessageProvider.buildMismatchTokenMessage({
35
- expected: u,
36
- actual: h,
25
+ tryInRepetitionRecovery(e, t, n, r) {
26
+ let i = this.findReSyncTokenType(), o = this.exportLexerState(), s = [], c = !1, l = this.LA_FAST(1), u = this.LA_FAST(1), d = () => {
27
+ let e = this.LA(0), t = new MismatchedTokenException(this.errorMessageProvider.buildMismatchTokenMessage({
28
+ expected: r,
29
+ actual: l,
37
30
  previous: e,
38
31
  ruleName: this.getCurrRuleFullName()
39
- }), h, this.LA(0));
40
- s.resyncedTokens = dropRight_default(p), this.SAVE_ERROR(s);
32
+ }), l, this.LA(0));
33
+ t.resyncedTokens = s.slice(0, -1), this.SAVE_ERROR(t);
41
34
  };
42
- for (; !m;) if (this.tokenMatcher(g, u)) {
43
- _();
35
+ for (; !c;) if (this.tokenMatcher(u, r)) {
36
+ d();
44
37
  return;
45
- } else if (c.call(this)) {
46
- _(), e.apply(this, s);
38
+ } else if (n.call(this)) {
39
+ d(), e.apply(this, t);
47
40
  return;
48
- } else this.tokenMatcher(g, d) ? m = !0 : (g = this.SKIP_TOKEN(), this.addToResyncTokens(g, p));
49
- this.importLexerState(f);
41
+ } else this.tokenMatcher(u, i) ? c = !0 : (u = this.SKIP_TOKEN(), this.addToResyncTokens(u, s));
42
+ this.importLexerState(o);
50
43
  }
51
- shouldInRepetitionRecoveryBeTried(e, s, c) {
52
- return !(c === !1 || this.tokenMatcher(this.LA(1), e) || this.isBackTracking() || this.canPerformInRuleRecovery(e, this.getFollowsForInRuleRecovery(e, s)));
44
+ shouldInRepetitionRecoveryBeTried(e, t, n) {
45
+ return !(n === !1 || this.tokenMatcher(this.LA_FAST(1), e) || this.isBackTracking() || this.canPerformInRuleRecovery(e, this.getFollowsForInRuleRecovery(e, t)));
53
46
  }
54
- getFollowsForInRuleRecovery(e, s) {
55
- let c = this.getCurrentGrammarPath(e, s);
56
- return this.getNextPossibleTokenTypes(c);
47
+ getNextPossibleTokenTypes(e) {
48
+ let t = e.ruleStack[0], n = this.getGAstProductions()[t];
49
+ return new NextAfterTokenWalker(n, e).startWalking();
57
50
  }
58
- tryInRuleRecovery(e, s) {
59
- if (this.canRecoverWithSingleTokenInsertion(e, s)) return this.getTokenToInsert(e);
51
+ getFollowsForInRuleRecovery(e, t) {
52
+ let n = this.getCurrentGrammarPath(e, t);
53
+ return this.getNextPossibleTokenTypes(n);
54
+ }
55
+ tryInRuleRecovery(e, t) {
56
+ if (this.canRecoverWithSingleTokenInsertion(e, t)) return this.getTokenToInsert(e);
60
57
  if (this.canRecoverWithSingleTokenDeletion(e)) {
61
58
  let e = this.SKIP_TOKEN();
62
59
  return this.consumeToken(), e;
63
60
  }
64
61
  throw new InRuleRecoveryException("sad sad panda");
65
62
  }
66
- canPerformInRuleRecovery(e, s) {
67
- return this.canRecoverWithSingleTokenInsertion(e, s) || this.canRecoverWithSingleTokenDeletion(e);
63
+ canPerformInRuleRecovery(e, t) {
64
+ return this.canRecoverWithSingleTokenInsertion(e, t) || this.canRecoverWithSingleTokenDeletion(e);
68
65
  }
69
- canRecoverWithSingleTokenInsertion(s, c) {
70
- if (!this.canTokenTypeBeInsertedInRecovery(s) || isEmpty_default(c)) return !1;
71
- let l = this.LA(1);
72
- return find_default(c, (e) => this.tokenMatcher(l, e)) !== void 0;
66
+ canRecoverWithSingleTokenInsertion(e, t) {
67
+ if (!this.canTokenTypeBeInsertedInRecovery(e) || t.length === 0) return !1;
68
+ let n = this.LA_FAST(1);
69
+ return t.find((e) => this.tokenMatcher(n, e)) !== void 0;
73
70
  }
74
71
  canRecoverWithSingleTokenDeletion(e) {
75
72
  return this.canTokenTypeBeDeletedInRecovery(e) ? this.tokenMatcher(this.LA(2), e) : !1;
76
73
  }
77
74
  isInCurrentRuleReSyncSet(e) {
78
- let s = this.getCurrFollowKey();
79
- return includes_default(this.getFollowSetFromFollowKey(s), e);
75
+ let t = this.getCurrFollowKey();
76
+ return this.getFollowSetFromFollowKey(t).includes(e);
80
77
  }
81
78
  findReSyncTokenType() {
82
- let e = this.flattenFollowSet(), s = this.LA(1), c = 2;
79
+ let e = this.flattenFollowSet(), t = this.LA_FAST(1), n = 2;
83
80
  for (;;) {
84
- let l = find_default(e, (e) => tokenMatcher(s, e));
85
- if (l !== void 0) return l;
86
- s = this.LA(c), c++;
81
+ let i = e.find((e) => tokenMatcher(t, e));
82
+ if (i !== void 0) return i;
83
+ t = this.LA(n), n++;
87
84
  }
88
85
  }
89
86
  getCurrFollowKey() {
90
- if (this.RULE_STACK.length === 1) return EOF_FOLLOW_KEY;
91
- let e = this.getLastExplicitRuleShortName(), s = this.getLastExplicitRuleOccurrenceIndex(), c = this.getPreviousExplicitRuleShortName();
87
+ if (this.RULE_STACK_IDX === 0) return EOF_FOLLOW_KEY;
88
+ let e = this.currRuleShortName, t = this.getLastExplicitRuleOccurrenceIndex(), n = this.getPreviousExplicitRuleShortName();
92
89
  return {
93
90
  ruleName: this.shortRuleNameToFullName(e),
94
- idxInCallingRule: s,
95
- inRule: this.shortRuleNameToFullName(c)
91
+ idxInCallingRule: t,
92
+ inRule: this.shortRuleNameToFullName(n)
96
93
  };
97
94
  }
98
95
  buildFullFollowKeyStack() {
99
- let e = this.RULE_STACK, s = this.RULE_OCCURRENCE_STACK;
100
- return map_default(e, (c, l) => l === 0 ? EOF_FOLLOW_KEY : {
101
- ruleName: this.shortRuleNameToFullName(c),
102
- idxInCallingRule: s[l],
103
- inRule: this.shortRuleNameToFullName(e[l - 1])
104
- });
96
+ let e = this.RULE_STACK, t = this.RULE_OCCURRENCE_STACK, n = this.RULE_STACK_IDX + 1, r = Array(n);
97
+ for (let i = 0; i < n; i++) i === 0 ? r[i] = EOF_FOLLOW_KEY : r[i] = {
98
+ ruleName: this.shortRuleNameToFullName(e[i]),
99
+ idxInCallingRule: t[i],
100
+ inRule: this.shortRuleNameToFullName(e[i - 1])
101
+ };
102
+ return r;
105
103
  }
106
104
  flattenFollowSet() {
107
- return flatten_default(map_default(this.buildFullFollowKeyStack(), (e) => this.getFollowSetFromFollowKey(e)));
105
+ return this.buildFullFollowKeyStack().map((e) => this.getFollowSetFromFollowKey(e)).flat();
108
106
  }
109
- getFollowSetFromFollowKey(e) {
110
- if (e === EOF_FOLLOW_KEY) return [EOF];
111
- let s = e.ruleName + e.idxInCallingRule + IN + e.inRule;
112
- return this.resyncFollows[s];
107
+ getFollowSetFromFollowKey(n) {
108
+ if (n === EOF_FOLLOW_KEY) return [EOF];
109
+ let r = n.ruleName + n.idxInCallingRule + IN + n.inRule;
110
+ return this.resyncFollows[r];
113
111
  }
114
- addToResyncTokens(e, s) {
115
- return this.tokenMatcher(e, EOF) || s.push(e), s;
112
+ addToResyncTokens(e, n) {
113
+ return this.tokenMatcher(e, EOF) || n.push(e), n;
116
114
  }
117
115
  reSyncTo(e) {
118
- let s = [], c = this.LA(1);
119
- for (; this.tokenMatcher(c, e) === !1;) c = this.SKIP_TOKEN(), this.addToResyncTokens(c, s);
120
- return dropRight_default(s);
116
+ let t = [], n = this.LA_FAST(1);
117
+ for (; this.tokenMatcher(n, e) === !1;) n = this.SKIP_TOKEN(), this.addToResyncTokens(n, t);
118
+ return t.slice(0, -1);
121
119
  }
122
- attemptInRepetitionRecovery(e, s, c, l, u, d, f) {}
123
- getCurrentGrammarPath(e, s) {
120
+ attemptInRepetitionRecovery(e, t, n, r, i, a, o) {}
121
+ getCurrentGrammarPath(e, t) {
124
122
  return {
125
123
  ruleStack: this.getHumanReadableRuleStack(),
126
- occurrenceStack: clone_default(this.RULE_OCCURRENCE_STACK),
124
+ occurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1),
127
125
  lastTok: e,
128
- lastTokOccurrence: s
126
+ lastTokOccurrence: t
129
127
  };
130
128
  }
131
129
  getHumanReadableRuleStack() {
132
- return map_default(this.RULE_STACK, (e) => this.shortRuleNameToFullName(e));
130
+ let e = this.RULE_STACK_IDX + 1, t = Array(e);
131
+ for (let n = 0; n < e; n++) t[n] = this.shortRuleNameToFullName(this.RULE_STACK[n]);
132
+ return t;
133
133
  }
134
134
  };
135
- function attemptInRepetitionRecovery(e, s, c, l, u, d, f) {
136
- let p = this.getKeyForAutomaticLookahead(l, u), m = this.firstAfterRepMap[p];
137
- if (m === void 0) {
138
- let e = this.getCurrRuleFullName(), s = this.getGAstProductions()[e];
139
- m = new d(s, u).startWalking(), this.firstAfterRepMap[p] = m;
140
- }
141
- let g = m.token, _ = m.occurrence, v = m.isEndOfRule;
142
- this.RULE_STACK.length === 1 && v && g === void 0 && (g = EOF, _ = 1), !(g === void 0 || _ === void 0) && this.shouldInRepetitionRecoveryBeTried(g, _, f) && this.tryInRepetitionRecovery(e, s, c, g);
135
+ function attemptInRepetitionRecovery(e, n, r, i, a, o, s) {
136
+ let c = this.getKeyForAutomaticLookahead(i, a), l = this.firstAfterRepMap[c];
137
+ if (l === void 0) {
138
+ let e = this.getCurrRuleFullName(), t = this.getGAstProductions()[e];
139
+ l = new o(t, a).startWalking(), this.firstAfterRepMap[c] = l;
140
+ }
141
+ let u = l.token, d = l.occurrence, f = l.isEndOfRule;
142
+ this.RULE_STACK_IDX === 0 && f && u === void 0 && (u = EOF, d = 1), !(u === void 0 || d === void 0) && this.shouldInRepetitionRecoveryBeTried(u, d, s) && this.tryInRepetitionRecovery(e, n, r, u);
143
143
  }
144
144
  export { IN_RULE_RECOVERY_EXCEPTION, Recoverable };
@@ -1,17 +1,13 @@
1
- import noop_default from "../../../../../../lodash-es/noop.js";
2
- import keys_default from "../../../../../../lodash-es/keys.js";
3
- import has_default from "../../../../../../lodash-es/has.js";
4
- import isUndefined_default from "../../../../../../lodash-es/isUndefined.js";
5
1
  import { addNoneTerminalToCst, addTerminalToCst, setNodeLocationFull, setNodeLocationOnlyOffset } from "../../cst/cst.js";
6
2
  import { createBaseSemanticVisitorConstructor, createBaseVisitorConstructorWithDefaults } from "../../cst/cst_visitor.js";
7
3
  import { DEFAULT_PARSER_CONFIG } from "../parser.js";
8
4
  var TreeBuilder = class {
9
- initTreeBuilder(u) {
10
- if (this.CST_STACK = [], this.outputCst = u.outputCst, this.nodeLocationTracking = has_default(u, "nodeLocationTracking") ? u.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking, !this.outputCst) this.cstInvocationStateUpdate = noop_default, this.cstFinallyStateUpdate = noop_default, this.cstPostTerminal = noop_default, this.cstPostNonTerminal = noop_default, this.cstPostRule = noop_default;
11
- else if (/full/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = setNodeLocationFull, this.setNodeLocationFromNode = setNodeLocationFull, this.cstPostRule = noop_default, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = noop_default, this.setNodeLocationFromNode = noop_default, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
12
- else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = setNodeLocationOnlyOffset, this.setNodeLocationFromNode = setNodeLocationOnlyOffset, this.cstPostRule = noop_default, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = noop_default, this.setNodeLocationFromNode = noop_default, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
13
- else if (/none/i.test(this.nodeLocationTracking)) this.setNodeLocationFromToken = noop_default, this.setNodeLocationFromNode = noop_default, this.cstPostRule = noop_default, this.setInitialNodeLocation = noop_default;
14
- else throw Error(`Invalid <nodeLocationTracking> config option: "${u.nodeLocationTracking}"`);
5
+ initTreeBuilder(e) {
6
+ if (this.CST_STACK = [], this.outputCst = e.outputCst, this.nodeLocationTracking = Object.hasOwn(e, "nodeLocationTracking") ? e.nodeLocationTracking : DEFAULT_PARSER_CONFIG.nodeLocationTracking, !this.outputCst) this.cstInvocationStateUpdate = () => {}, this.cstFinallyStateUpdate = () => {}, this.cstPostTerminal = () => {}, this.cstPostNonTerminal = () => {}, this.cstPostRule = () => {};
7
+ else if (/full/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = setNodeLocationFull, this.setNodeLocationFromNode = setNodeLocationFull, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
8
+ else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = setNodeLocationOnlyOffset, this.setNodeLocationFromNode = setNodeLocationOnlyOffset, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
9
+ else if (/none/i.test(this.nodeLocationTracking)) this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = () => {}, this.setInitialNodeLocation = () => {};
10
+ else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);
15
11
  }
16
12
  setInitialNodeLocationOnlyOffsetRecovery(e) {
17
13
  e.location = {
@@ -21,7 +17,7 @@ var TreeBuilder = class {
21
17
  }
22
18
  setInitialNodeLocationOnlyOffsetRegular(e) {
23
19
  e.location = {
24
- startOffset: this.LA(1).startOffset,
20
+ startOffset: this.LA_FAST(1).startOffset,
25
21
  endOffset: NaN
26
22
  };
27
23
  }
@@ -36,67 +32,61 @@ var TreeBuilder = class {
36
32
  };
37
33
  }
38
34
  setInitialNodeLocationFullRegular(e) {
39
- let u = this.LA(1);
35
+ let a = this.LA_FAST(1);
40
36
  e.location = {
41
- startOffset: u.startOffset,
42
- startLine: u.startLine,
43
- startColumn: u.startColumn,
37
+ startOffset: a.startOffset,
38
+ startLine: a.startLine,
39
+ startColumn: a.startColumn,
44
40
  endOffset: NaN,
45
41
  endLine: NaN,
46
42
  endColumn: NaN
47
43
  };
48
44
  }
49
45
  cstInvocationStateUpdate(e) {
50
- let u = {
46
+ let a = {
51
47
  name: e,
52
48
  children: Object.create(null)
53
49
  };
54
- this.setInitialNodeLocation(u), this.CST_STACK.push(u);
50
+ this.setInitialNodeLocation(a), this.CST_STACK.push(a);
55
51
  }
56
52
  cstFinallyStateUpdate() {
57
53
  this.CST_STACK.pop();
58
54
  }
59
55
  cstPostRuleFull(e) {
60
- let u = this.LA(0), d = e.location;
61
- d.startOffset <= u.startOffset ? (d.endOffset = u.endOffset, d.endLine = u.endLine, d.endColumn = u.endColumn) : (d.startOffset = NaN, d.startLine = NaN, d.startColumn = NaN);
56
+ let a = this.LA(0), o = e.location;
57
+ o.startOffset <= a.startOffset ? (o.endOffset = a.endOffset, o.endLine = a.endLine, o.endColumn = a.endColumn) : (o.startOffset = NaN, o.startLine = NaN, o.startColumn = NaN);
62
58
  }
63
59
  cstPostRuleOnlyOffset(e) {
64
- let u = this.LA(0), d = e.location;
65
- d.startOffset <= u.startOffset ? d.endOffset = u.endOffset : d.startOffset = NaN;
60
+ let a = this.LA(0), o = e.location;
61
+ o.startOffset <= a.startOffset ? o.endOffset = a.endOffset : o.startOffset = NaN;
66
62
  }
67
- cstPostTerminal(e, u) {
68
- let d = this.CST_STACK[this.CST_STACK.length - 1];
69
- addTerminalToCst(d, u, e), this.setNodeLocationFromToken(d.location, u);
63
+ cstPostTerminal(e, o) {
64
+ let s = this.CST_STACK[this.CST_STACK.length - 1];
65
+ addTerminalToCst(s, o, e), this.setNodeLocationFromToken(s.location, o);
70
66
  }
71
- cstPostNonTerminal(e, u) {
72
- let d = this.CST_STACK[this.CST_STACK.length - 1];
73
- addNoneTerminalToCst(d, u, e), this.setNodeLocationFromNode(d.location, e.location);
67
+ cstPostNonTerminal(a, o) {
68
+ let s = this.CST_STACK[this.CST_STACK.length - 1];
69
+ addNoneTerminalToCst(s, o, a), this.setNodeLocationFromNode(s.location, a.location);
74
70
  }
75
71
  getBaseCstVisitorConstructor() {
76
- if (isUndefined_default(this.baseCstVisitorConstructor)) {
77
- let e = createBaseSemanticVisitorConstructor(this.className, keys_default(this.gastProductionsCache));
72
+ if (this.baseCstVisitorConstructor === void 0) {
73
+ let e = createBaseSemanticVisitorConstructor(this.className, Object.keys(this.gastProductionsCache));
78
74
  return this.baseCstVisitorConstructor = e, e;
79
75
  }
80
76
  return this.baseCstVisitorConstructor;
81
77
  }
82
78
  getBaseCstVisitorConstructorWithDefaults() {
83
- if (isUndefined_default(this.baseCstVisitorWithDefaultsConstructor)) {
84
- let e = createBaseVisitorConstructorWithDefaults(this.className, keys_default(this.gastProductionsCache), this.getBaseCstVisitorConstructor());
79
+ if (this.baseCstVisitorWithDefaultsConstructor === void 0) {
80
+ let e = createBaseVisitorConstructorWithDefaults(this.className, Object.keys(this.gastProductionsCache), this.getBaseCstVisitorConstructor());
85
81
  return this.baseCstVisitorWithDefaultsConstructor = e, e;
86
82
  }
87
83
  return this.baseCstVisitorWithDefaultsConstructor;
88
84
  }
89
- getLastExplicitRuleShortName() {
90
- let e = this.RULE_STACK;
91
- return e[e.length - 1];
92
- }
93
85
  getPreviousExplicitRuleShortName() {
94
- let e = this.RULE_STACK;
95
- return e[e.length - 2];
86
+ return this.RULE_STACK[this.RULE_STACK_IDX - 1];
96
87
  }
97
88
  getLastExplicitRuleOccurrenceIndex() {
98
- let e = this.RULE_OCCURRENCE_STACK;
99
- return e[e.length - 1];
89
+ return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX];
100
90
  }
101
91
  };
102
92
  export { TreeBuilder };