@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,9 +1,3 @@
1
- import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
2
- import clone_default from "../../../../../lodash-es/clone.js";
3
- import forEach_default from "../../../../../lodash-es/forEach.js";
4
- import map_default from "../../../../../lodash-es/map.js";
5
- import has_default from "../../../../../lodash-es/has.js";
6
- import values_default from "../../../../../lodash-es/values.js";
7
1
  import { toFastProperties } from "../../../../../@chevrotain/utils/lib/src/to-fast-properties.js";
8
2
  import { computeAllProdsFollows } from "../grammar/follow.js";
9
3
  import { EOF, createTokenInstance } from "../../scan/tokens_public.js";
@@ -17,7 +11,6 @@ import { LexerAdapter } from "./traits/lexer_adapter.js";
17
11
  import { RecognizerApi } from "./traits/recognizer_api.js";
18
12
  import { RecognizerEngine } from "./traits/recognizer_engine.js";
19
13
  import { ErrorHandler } from "./traits/error_handler.js";
20
- import { ContentAssist } from "./traits/context_assist.js";
21
14
  import { GastRecorder } from "./traits/gast_recorder.js";
22
15
  import { PerformanceTracer } from "./traits/perf_tracer.js";
23
16
  import { applyMixins } from "./utils/apply_mixins.js";
@@ -37,68 +30,68 @@ const DEFAULT_PARSER_CONFIG = Object.freeze({
37
30
  resyncEnabled: !0
38
31
  });
39
32
  var ParserDefinitionErrorType;
40
- (function(u) {
41
- u[u.INVALID_RULE_NAME = 0] = "INVALID_RULE_NAME", u[u.DUPLICATE_RULE_NAME = 1] = "DUPLICATE_RULE_NAME", u[u.INVALID_RULE_OVERRIDE = 2] = "INVALID_RULE_OVERRIDE", u[u.DUPLICATE_PRODUCTIONS = 3] = "DUPLICATE_PRODUCTIONS", u[u.UNRESOLVED_SUBRULE_REF = 4] = "UNRESOLVED_SUBRULE_REF", u[u.LEFT_RECURSION = 5] = "LEFT_RECURSION", u[u.NONE_LAST_EMPTY_ALT = 6] = "NONE_LAST_EMPTY_ALT", u[u.AMBIGUOUS_ALTS = 7] = "AMBIGUOUS_ALTS", u[u.CONFLICT_TOKENS_RULES_NAMESPACE = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE", u[u.INVALID_TOKEN_NAME = 9] = "INVALID_TOKEN_NAME", u[u.NO_NON_EMPTY_LOOKAHEAD = 10] = "NO_NON_EMPTY_LOOKAHEAD", u[u.AMBIGUOUS_PREFIX_ALTS = 11] = "AMBIGUOUS_PREFIX_ALTS", u[u.TOO_MANY_ALTS = 12] = "TOO_MANY_ALTS", u[u.CUSTOM_LOOKAHEAD_VALIDATION = 13] = "CUSTOM_LOOKAHEAD_VALIDATION";
33
+ (function(e) {
34
+ e[e.INVALID_RULE_NAME = 0] = "INVALID_RULE_NAME", e[e.DUPLICATE_RULE_NAME = 1] = "DUPLICATE_RULE_NAME", e[e.INVALID_RULE_OVERRIDE = 2] = "INVALID_RULE_OVERRIDE", e[e.DUPLICATE_PRODUCTIONS = 3] = "DUPLICATE_PRODUCTIONS", e[e.UNRESOLVED_SUBRULE_REF = 4] = "UNRESOLVED_SUBRULE_REF", e[e.LEFT_RECURSION = 5] = "LEFT_RECURSION", e[e.NONE_LAST_EMPTY_ALT = 6] = "NONE_LAST_EMPTY_ALT", e[e.AMBIGUOUS_ALTS = 7] = "AMBIGUOUS_ALTS", e[e.CONFLICT_TOKENS_RULES_NAMESPACE = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE", e[e.INVALID_TOKEN_NAME = 9] = "INVALID_TOKEN_NAME", e[e.NO_NON_EMPTY_LOOKAHEAD = 10] = "NO_NON_EMPTY_LOOKAHEAD", e[e.AMBIGUOUS_PREFIX_ALTS = 11] = "AMBIGUOUS_PREFIX_ALTS", e[e.TOO_MANY_ALTS = 12] = "TOO_MANY_ALTS", e[e.CUSTOM_LOOKAHEAD_VALIDATION = 13] = "CUSTOM_LOOKAHEAD_VALIDATION";
42
35
  })(ParserDefinitionErrorType ||= {});
43
- function EMPTY_ALT(u = void 0) {
36
+ function EMPTY_ALT(e = void 0) {
44
37
  return function() {
45
- return u;
38
+ return e;
46
39
  };
47
40
  }
48
- var Parser = class D {
49
- static performSelfAnalysis(u) {
41
+ var Parser = class S {
42
+ static performSelfAnalysis(e) {
50
43
  throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.");
51
44
  }
52
45
  performSelfAnalysis() {
53
46
  this.TRACE_INIT("performSelfAnalysis", () => {
54
- let A;
47
+ let C;
55
48
  this.selfAnalysisDone = !0;
56
- let j = this.className;
49
+ let w = this.className;
57
50
  this.TRACE_INIT("toFastProps", () => {
58
51
  toFastProperties(this);
59
52
  }), this.TRACE_INIT("Grammar Recording", () => {
60
53
  try {
61
- this.enableRecording(), forEach_default(this.definedRulesNames, (u) => {
62
- let D = this[u].originalGrammarAction, O;
63
- this.TRACE_INIT(`${u} Rule`, () => {
64
- O = this.topLevelRuleRecord(u, D);
65
- }), this.gastProductionsCache[u] = O;
54
+ this.enableRecording(), this.definedRulesNames.forEach((e) => {
55
+ let x = this[e].originalGrammarAction, S;
56
+ this.TRACE_INIT(`${e} Rule`, () => {
57
+ S = this.topLevelRuleRecord(e, x);
58
+ }), this.gastProductionsCache[e] = S;
66
59
  });
67
60
  } finally {
68
61
  this.disableRecording();
69
62
  }
70
63
  });
71
- let M = [];
64
+ let T = [];
72
65
  if (this.TRACE_INIT("Grammar Resolving", () => {
73
- M = resolveGrammar({ rules: values_default(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(M);
66
+ T = resolveGrammar({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(T);
74
67
  }), this.TRACE_INIT("Grammar Validations", () => {
75
- if (isEmpty_default(M) && this.skipValidations === !1) {
76
- let u = validateGrammar({
77
- rules: values_default(this.gastProductionsCache),
78
- tokenTypes: values_default(this.tokensMap),
68
+ if (T.length === 0 && this.skipValidations === !1) {
69
+ let e = validateGrammar({
70
+ rules: Object.values(this.gastProductionsCache),
71
+ tokenTypes: Object.values(this.tokensMap),
79
72
  errMsgProvider: defaultGrammarValidatorErrorProvider,
80
- grammarName: j
81
- }), D = validateLookahead({
73
+ grammarName: w
74
+ }), x = validateLookahead({
82
75
  lookaheadStrategy: this.lookaheadStrategy,
83
- rules: values_default(this.gastProductionsCache),
84
- tokenTypes: values_default(this.tokensMap),
85
- grammarName: j
76
+ rules: Object.values(this.gastProductionsCache),
77
+ tokenTypes: Object.values(this.tokensMap),
78
+ grammarName: w
86
79
  });
87
- this.definitionErrors = this.definitionErrors.concat(u, D);
80
+ this.definitionErrors = this.definitionErrors.concat(e, x);
88
81
  }
89
- }), isEmpty_default(this.definitionErrors) && (this.recoveryEnabled && this.TRACE_INIT("computeAllProdsFollows", () => {
90
- this.resyncFollows = computeAllProdsFollows(values_default(this.gastProductionsCache));
82
+ }), this.definitionErrors.length === 0 && (this.recoveryEnabled && this.TRACE_INIT("computeAllProdsFollows", () => {
83
+ this.resyncFollows = computeAllProdsFollows(Object.values(this.gastProductionsCache));
91
84
  }), this.TRACE_INIT("ComputeLookaheadFunctions", () => {
92
- var u, D;
93
- (D = (u = this.lookaheadStrategy).initialize) == null || D.call(u, { rules: values_default(this.gastProductionsCache) }), this.preComputeLookaheadFunctions(values_default(this.gastProductionsCache));
94
- })), !D.DEFER_DEFINITION_ERRORS_HANDLING && !isEmpty_default(this.definitionErrors)) throw A = map_default(this.definitionErrors, (u) => u.message), Error(`Parser Definition Errors detected:\n ${A.join("\n-------------------------------\n")}`);
85
+ var e, x;
86
+ (x = (e = this.lookaheadStrategy).initialize) == null || x.call(e, { rules: Object.values(this.gastProductionsCache) }), this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache));
87
+ })), !S.DEFER_DEFINITION_ERRORS_HANDLING && this.definitionErrors.length !== 0) throw C = this.definitionErrors.map((e) => e.message), Error(`Parser Definition Errors detected:\n ${C.join("\n-------------------------------\n")}`);
95
88
  });
96
89
  }
97
- constructor(u, D) {
90
+ constructor(e, x) {
98
91
  this.definitionErrors = [], this.selfAnalysisDone = !1;
99
- let O = this;
100
- if (O.initErrorHandler(D), O.initLexerAdapter(), O.initLooksAhead(D), O.initRecognizerEngine(u, D), O.initRecoverable(D), O.initTreeBuilder(D), O.initContentAssist(), O.initGastRecorder(D), O.initPerformanceTracer(D), has_default(D, "ignoredIssues")) throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");
101
- this.skipValidations = has_default(D, "skipValidations") ? D.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
92
+ let S = this;
93
+ if (S.initErrorHandler(x), S.initLexerAdapter(), S.initLooksAhead(x), S.initRecognizerEngine(e, x), S.initRecoverable(x), S.initTreeBuilder(x), S.initGastRecorder(x), S.initPerformanceTracer(x), Object.hasOwn(x, "ignoredIssues")) throw Error("The <ignoredIssues> IParserConfig property has been deprecated.\n Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.\n See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES\n For further details.");
94
+ this.skipValidations = Object.hasOwn(x, "skipValidations") ? x.skipValidations : DEFAULT_PARSER_CONFIG.skipValidations;
102
95
  }
103
96
  };
104
97
  Parser.DEFER_DEFINITION_ERRORS_HANDLING = !1, applyMixins(Parser, [
@@ -109,14 +102,13 @@ Parser.DEFER_DEFINITION_ERRORS_HANDLING = !1, applyMixins(Parser, [
109
102
  RecognizerEngine,
110
103
  RecognizerApi,
111
104
  ErrorHandler,
112
- ContentAssist,
113
105
  GastRecorder,
114
106
  PerformanceTracer
115
107
  ]);
116
108
  var EmbeddedActionsParser = class extends Parser {
117
- constructor(u, O = DEFAULT_PARSER_CONFIG) {
118
- let k = clone_default(O);
119
- k.outputCst = !1, super(u, k);
109
+ constructor(e, x = DEFAULT_PARSER_CONFIG) {
110
+ let S = Object.assign({}, x);
111
+ S.outputCst = !1, super(e, S);
120
112
  }
121
113
  };
122
114
  export { DEFAULT_PARSER_CONFIG, DEFAULT_RULE_CONFIG, EMPTY_ALT, END_OF_FILE, EmbeddedActionsParser, ParserDefinitionErrorType };
@@ -1,45 +1,43 @@
1
- import clone_default from "../../../../../../lodash-es/clone.js";
2
- import has_default from "../../../../../../lodash-es/has.js";
3
1
  import { getLookaheadPathsForOptionalProd, getLookaheadPathsForOr } from "../../grammar/lookahead.js";
4
2
  import { EarlyExitException, NoViableAltException, isRecognitionException } from "../../exceptions_public.js";
5
3
  import { DEFAULT_PARSER_CONFIG } from "../parser.js";
6
4
  var ErrorHandler = class {
7
5
  initErrorHandler(e) {
8
- this._errors = [], this.errorMessageProvider = has_default(e, "errorMessageProvider") ? e.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider;
6
+ this._errors = [], this.errorMessageProvider = Object.hasOwn(e, "errorMessageProvider") ? e.errorMessageProvider : DEFAULT_PARSER_CONFIG.errorMessageProvider;
9
7
  }
10
- SAVE_ERROR(t) {
11
- if (isRecognitionException(t)) return t.context = {
8
+ SAVE_ERROR(e) {
9
+ if (isRecognitionException(e)) return e.context = {
12
10
  ruleStack: this.getHumanReadableRuleStack(),
13
- ruleOccurrenceStack: clone_default(this.RULE_OCCURRENCE_STACK)
14
- }, this._errors.push(t), t;
11
+ ruleOccurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1)
12
+ }, this._errors.push(e), e;
15
13
  throw Error("Trying to save an Error which is not a RecognitionException");
16
14
  }
17
15
  get errors() {
18
- return clone_default(this._errors);
16
+ return [...this._errors];
19
17
  }
20
18
  set errors(e) {
21
19
  this._errors = e;
22
20
  }
23
- raiseEarlyExitException(e, t, r) {
24
- let a = this.getCurrRuleFullName(), o = this.getGAstProductions()[a], s = getLookaheadPathsForOptionalProd(e, o, t, this.maxLookahead)[0], c = [];
21
+ raiseEarlyExitException(t, r, i) {
22
+ let a = this.getCurrRuleFullName(), o = this.getGAstProductions()[a], s = getLookaheadPathsForOptionalProd(t, o, r, this.maxLookahead)[0], c = [];
25
23
  for (let e = 1; e <= this.maxLookahead; e++) c.push(this.LA(e));
26
24
  let l = this.errorMessageProvider.buildEarlyExitMessage({
27
25
  expectedIterationPaths: s,
28
26
  actual: c,
29
27
  previous: this.LA(0),
30
- customUserDescription: r,
28
+ customUserDescription: i,
31
29
  ruleName: a
32
30
  });
33
31
  throw this.SAVE_ERROR(new EarlyExitException(l, this.LA(1), this.LA(0)));
34
32
  }
35
- raiseNoAltException(e, t) {
36
- let n = this.getCurrRuleFullName(), i = this.getGAstProductions()[n], o = getLookaheadPathsForOr(e, i, this.maxLookahead), s = [];
33
+ raiseNoAltException(e, n) {
34
+ let i = this.getCurrRuleFullName(), a = this.getGAstProductions()[i], o = getLookaheadPathsForOr(e, a, this.maxLookahead), s = [];
37
35
  for (let e = 1; e <= this.maxLookahead; e++) s.push(this.LA(e));
38
36
  let c = this.LA(0), l = this.errorMessageProvider.buildNoViableAltMessage({
39
37
  expectedPathsPerAlt: o,
40
38
  actual: s,
41
39
  previous: c,
42
- customUserDescription: t,
40
+ customUserDescription: n,
43
41
  ruleName: this.getCurrRuleFullName()
44
42
  });
45
43
  throw this.SAVE_ERROR(new NoViableAltException(l, this.LA(1), c));
@@ -1,9 +1,3 @@
1
- import isFunction_default from "../../../../../../lodash-es/isFunction.js";
2
- import isArray_default from "../../../../../../lodash-es/isArray.js";
3
- import last_default from "../../../../../../lodash-es/last.js";
4
- import forEach_default from "../../../../../../lodash-es/forEach.js";
5
- import has_default from "../../../../../../lodash-es/has.js";
6
- import some_default from "../../../../../../lodash-es/some.js";
7
1
  import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Rule, Terminal } from "../../../../../../@chevrotain/gast/lib/src/model.js";
8
2
  import { augmentTokenTypes, hasShortKeyProperty } from "../../../scan/tokens.js";
9
3
  import { Lexer } from "../../../scan/lexer_public.js";
@@ -23,149 +17,149 @@ var RECORDING_PHASE_CSTNODE = {
23
17
  name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",
24
18
  children: {}
25
19
  }, GastRecorder = class {
26
- initGastRecorder(i) {
20
+ initGastRecorder(e) {
27
21
  this.recordingProdStack = [], this.RECORDING_PHASE = !1;
28
22
  }
29
23
  enableRecording() {
30
24
  this.RECORDING_PHASE = !0, this.TRACE_INIT("Enable Recording", () => {
31
- for (let i = 0; i < 10; i++) {
32
- let x = i > 0 ? i : "";
25
+ for (let e = 0; e < 10; e++) {
26
+ let x = e > 0 ? e : "";
33
27
  this[`CONSUME${x}`] = function(x, S) {
34
- return this.consumeInternalRecord(x, i, S);
28
+ return this.consumeInternalRecord(x, e, S);
35
29
  }, this[`SUBRULE${x}`] = function(x, S) {
36
- return this.subruleInternalRecord(x, i, S);
30
+ return this.subruleInternalRecord(x, e, S);
37
31
  }, this[`OPTION${x}`] = function(x) {
38
- return this.optionInternalRecord(x, i);
32
+ return this.optionInternalRecord(x, e);
39
33
  }, this[`OR${x}`] = function(x) {
40
- return this.orInternalRecord(x, i);
34
+ return this.orInternalRecord(x, e);
41
35
  }, this[`MANY${x}`] = function(x) {
42
- this.manyInternalRecord(i, x);
36
+ this.manyInternalRecord(e, x);
43
37
  }, this[`MANY_SEP${x}`] = function(x) {
44
- this.manySepFirstInternalRecord(i, x);
38
+ this.manySepFirstInternalRecord(e, x);
45
39
  }, this[`AT_LEAST_ONE${x}`] = function(x) {
46
- this.atLeastOneInternalRecord(i, x);
40
+ this.atLeastOneInternalRecord(e, x);
47
41
  }, this[`AT_LEAST_ONE_SEP${x}`] = function(x) {
48
- this.atLeastOneSepFirstInternalRecord(i, x);
42
+ this.atLeastOneSepFirstInternalRecord(e, x);
49
43
  };
50
44
  }
51
- this.consume = function(i, x, S) {
52
- return this.consumeInternalRecord(x, i, S);
53
- }, this.subrule = function(i, x, S) {
54
- return this.subruleInternalRecord(x, i, S);
55
- }, this.option = function(i, x) {
56
- return this.optionInternalRecord(x, i);
57
- }, this.or = function(i, x) {
58
- return this.orInternalRecord(x, i);
59
- }, this.many = function(i, x) {
60
- this.manyInternalRecord(i, x);
61
- }, this.atLeastOne = function(i, x) {
62
- this.atLeastOneInternalRecord(i, x);
45
+ this.consume = function(e, x, S) {
46
+ return this.consumeInternalRecord(x, e, S);
47
+ }, this.subrule = function(e, x, S) {
48
+ return this.subruleInternalRecord(x, e, S);
49
+ }, this.option = function(e, x) {
50
+ return this.optionInternalRecord(x, e);
51
+ }, this.or = function(e, x) {
52
+ return this.orInternalRecord(x, e);
53
+ }, this.many = function(e, x) {
54
+ this.manyInternalRecord(e, x);
55
+ }, this.atLeastOne = function(e, x) {
56
+ this.atLeastOneInternalRecord(e, x);
63
57
  }, this.ACTION = this.ACTION_RECORD, this.BACKTRACK = this.BACKTRACK_RECORD, this.LA = this.LA_RECORD;
64
58
  });
65
59
  }
66
60
  disableRecording() {
67
61
  this.RECORDING_PHASE = !1, this.TRACE_INIT("Deleting Recording methods", () => {
68
- let i = this;
62
+ let e = this;
69
63
  for (let x = 0; x < 10; x++) {
70
64
  let S = x > 0 ? x : "";
71
- delete i[`CONSUME${S}`], delete i[`SUBRULE${S}`], delete i[`OPTION${S}`], delete i[`OR${S}`], delete i[`MANY${S}`], delete i[`MANY_SEP${S}`], delete i[`AT_LEAST_ONE${S}`], delete i[`AT_LEAST_ONE_SEP${S}`];
65
+ delete e[`CONSUME${S}`], delete e[`SUBRULE${S}`], delete e[`OPTION${S}`], delete e[`OR${S}`], delete e[`MANY${S}`], delete e[`MANY_SEP${S}`], delete e[`AT_LEAST_ONE${S}`], delete e[`AT_LEAST_ONE_SEP${S}`];
72
66
  }
73
- delete i.consume, delete i.subrule, delete i.option, delete i.or, delete i.many, delete i.atLeastOne, delete i.ACTION, delete i.BACKTRACK, delete i.LA;
67
+ delete e.consume, delete e.subrule, delete e.option, delete e.or, delete e.many, delete e.atLeastOne, delete e.ACTION, delete e.BACKTRACK, delete e.LA;
74
68
  });
75
69
  }
76
- ACTION_RECORD(i) {}
77
- BACKTRACK_RECORD(i, x) {
70
+ ACTION_RECORD(e) {}
71
+ BACKTRACK_RECORD(e, x) {
78
72
  return () => !0;
79
73
  }
80
- LA_RECORD(i) {
74
+ LA_RECORD(e) {
81
75
  return END_OF_FILE;
82
76
  }
83
- topLevelRuleRecord(i, x) {
77
+ topLevelRuleRecord(e, x) {
84
78
  try {
85
79
  let S = new Rule({
86
80
  definition: [],
87
- name: i
81
+ name: e
88
82
  });
89
- return S.name = i, this.recordingProdStack.push(S), x.call(this), this.recordingProdStack.pop(), S;
90
- } catch (i) {
91
- if (i.KNOWN_RECORDER_ERROR !== !0) try {
92
- i.message += "\n This error was thrown during the \"grammar recording phase\" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording";
83
+ return S.name = e, this.recordingProdStack.push(S), x.call(this), this.recordingProdStack.pop(), S;
84
+ } catch (e) {
85
+ if (e.KNOWN_RECORDER_ERROR !== !0) try {
86
+ e.message += "\n This error was thrown during the \"grammar recording phase\" For more info see:\n https://chevrotain.io/docs/guide/internals.html#grammar-recording";
93
87
  } catch {
94
- throw i;
88
+ throw e;
95
89
  }
96
- throw i;
90
+ throw e;
97
91
  }
98
92
  }
99
- optionInternalRecord(i, x) {
100
- return recordProd.call(this, Option, i, x);
93
+ optionInternalRecord(e, x) {
94
+ return recordProd.call(this, Option, e, x);
101
95
  }
102
- atLeastOneInternalRecord(i, x) {
103
- recordProd.call(this, RepetitionMandatory, x, i);
96
+ atLeastOneInternalRecord(e, x) {
97
+ recordProd.call(this, RepetitionMandatory, x, e);
104
98
  }
105
- atLeastOneSepFirstInternalRecord(i, x) {
106
- recordProd.call(this, RepetitionMandatoryWithSeparator, x, i, HANDLE_SEPARATOR);
99
+ atLeastOneSepFirstInternalRecord(e, x) {
100
+ recordProd.call(this, RepetitionMandatoryWithSeparator, x, e, HANDLE_SEPARATOR);
107
101
  }
108
- manyInternalRecord(i, x) {
109
- recordProd.call(this, Repetition, x, i);
102
+ manyInternalRecord(e, x) {
103
+ recordProd.call(this, Repetition, x, e);
110
104
  }
111
- manySepFirstInternalRecord(i, x) {
112
- recordProd.call(this, RepetitionWithSeparator, x, i, HANDLE_SEPARATOR);
105
+ manySepFirstInternalRecord(e, x) {
106
+ recordProd.call(this, RepetitionWithSeparator, x, e, HANDLE_SEPARATOR);
113
107
  }
114
- orInternalRecord(i, x) {
115
- return recordOrProd.call(this, i, x);
108
+ orInternalRecord(e, x) {
109
+ return recordOrProd.call(this, e, x);
116
110
  }
117
- subruleInternalRecord(i, x, C) {
118
- if (assertMethodIdxIsValid(x), !i || has_default(i, "ruleName") === !1) {
119
- let S = /* @__PURE__ */ Error(`<SUBRULE${getIdxSuffix(x)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(i)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
111
+ subruleInternalRecord(e, x, C) {
112
+ if (assertMethodIdxIsValid(x), !e || !Object.hasOwn(e, "ruleName")) {
113
+ let S = /* @__PURE__ */ Error(`<SUBRULE${getIdxSuffix(x)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
120
114
  throw S.KNOWN_RECORDER_ERROR = !0, S;
121
115
  }
122
- let T = last_default(this.recordingProdStack), E = i.ruleName, D = new NonTerminal({
116
+ let w = this.recordingProdStack.at(-1), T = e.ruleName, E = new NonTerminal({
123
117
  idx: x,
124
- nonTerminalName: E,
118
+ nonTerminalName: T,
125
119
  label: C?.LABEL,
126
120
  referencedRule: void 0
127
121
  });
128
- return T.definition.push(D), this.outputCst ? RECORDING_PHASE_CSTNODE : RECORDING_NULL_OBJECT;
122
+ return w.definition.push(E), this.outputCst ? RECORDING_PHASE_CSTNODE : RECORDING_NULL_OBJECT;
129
123
  }
130
- consumeInternalRecord(i, x, C) {
131
- if (assertMethodIdxIsValid(x), !hasShortKeyProperty(i)) {
132
- let S = /* @__PURE__ */ Error(`<CONSUME${getIdxSuffix(x)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(i)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
124
+ consumeInternalRecord(e, x, S) {
125
+ if (assertMethodIdxIsValid(x), !hasShortKeyProperty(e)) {
126
+ let S = /* @__PURE__ */ Error(`<CONSUME${getIdxSuffix(x)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
133
127
  throw S.KNOWN_RECORDER_ERROR = !0, S;
134
128
  }
135
- let w = last_default(this.recordingProdStack), T = new Terminal({
129
+ let C = this.recordingProdStack.at(-1), w = new Terminal({
136
130
  idx: x,
137
- terminalType: i,
138
- label: C?.LABEL
131
+ terminalType: e,
132
+ label: S?.LABEL
139
133
  });
140
- return w.definition.push(T), RECORDING_PHASE_TOKEN;
134
+ return C.definition.push(w), RECORDING_PHASE_TOKEN;
141
135
  }
142
136
  };
143
- function recordProd(x, C, T, E = !1) {
144
- assertMethodIdxIsValid(T);
145
- let D = last_default(this.recordingProdStack), O = isFunction_default(C) ? C : C.DEF, k = new x({
137
+ function recordProd(e, x, S, C = !1) {
138
+ assertMethodIdxIsValid(S);
139
+ let w = this.recordingProdStack.at(-1), T = typeof x == "function" ? x : x.DEF, E = new e({
146
140
  definition: [],
147
- idx: T
141
+ idx: S
148
142
  });
149
- return E && (k.separator = C.SEP), has_default(C, "MAX_LOOKAHEAD") && (k.maxLookahead = C.MAX_LOOKAHEAD), this.recordingProdStack.push(k), O.call(this), D.definition.push(k), this.recordingProdStack.pop(), RECORDING_NULL_OBJECT;
143
+ return C && (E.separator = x.SEP), Object.hasOwn(x, "MAX_LOOKAHEAD") && (E.maxLookahead = x.MAX_LOOKAHEAD), this.recordingProdStack.push(E), T.call(this), w.definition.push(E), this.recordingProdStack.pop(), RECORDING_NULL_OBJECT;
150
144
  }
151
- function recordOrProd(O, k) {
152
- assertMethodIdxIsValid(k);
153
- let A = last_default(this.recordingProdStack), j = isArray_default(O) === !1, M = j === !1 ? O : O.DEF, N = new Alternation({
145
+ function recordOrProd(S, C) {
146
+ assertMethodIdxIsValid(C);
147
+ let w = this.recordingProdStack.at(-1), T = Array.isArray(S) === !1, E = T === !1 ? S : S.DEF, D = new Alternation({
154
148
  definition: [],
155
- idx: k,
156
- ignoreAmbiguities: j && O.IGNORE_AMBIGUITIES === !0
149
+ idx: C,
150
+ ignoreAmbiguities: T && S.IGNORE_AMBIGUITIES === !0
157
151
  });
158
- return has_default(O, "MAX_LOOKAHEAD") && (N.maxLookahead = O.MAX_LOOKAHEAD), N.hasPredicates = some_default(M, (x) => isFunction_default(x.GATE)), A.definition.push(N), forEach_default(M, (i) => {
159
- let x = new Alternative({ definition: [] });
160
- N.definition.push(x), has_default(i, "IGNORE_AMBIGUITIES") ? x.ignoreAmbiguities = i.IGNORE_AMBIGUITIES : has_default(i, "GATE") && (x.ignoreAmbiguities = !0), this.recordingProdStack.push(x), i.ALT.call(this), this.recordingProdStack.pop();
152
+ return Object.hasOwn(S, "MAX_LOOKAHEAD") && (D.maxLookahead = S.MAX_LOOKAHEAD), D.hasPredicates = E.some((e) => typeof e.GATE == "function"), w.definition.push(D), E.forEach((e) => {
153
+ let S = new Alternative({ definition: [] });
154
+ D.definition.push(S), Object.hasOwn(e, "IGNORE_AMBIGUITIES") ? S.ignoreAmbiguities = e.IGNORE_AMBIGUITIES : Object.hasOwn(e, "GATE") && (S.ignoreAmbiguities = !0), this.recordingProdStack.push(S), e.ALT.call(this), this.recordingProdStack.pop();
161
155
  }), RECORDING_NULL_OBJECT;
162
156
  }
163
- function getIdxSuffix(i) {
164
- return i === 0 ? "" : `${i}`;
157
+ function getIdxSuffix(e) {
158
+ return e === 0 ? "" : `${e}`;
165
159
  }
166
- function assertMethodIdxIsValid(i) {
167
- if (i < 0 || i > MAX_METHOD_IDX) {
168
- let x = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${i}>\n\tIdx value must be a none negative value smaller than ${MAX_METHOD_IDX + 1}`);
160
+ function assertMethodIdxIsValid(e) {
161
+ if (e < 0 || e > MAX_METHOD_IDX) {
162
+ let x = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than ${MAX_METHOD_IDX + 1}`);
169
163
  throw x.KNOWN_RECORDER_ERROR = !0, x;
170
164
  }
171
165
  }
@@ -11,7 +11,11 @@ var LexerAdapter = class {
11
11
  return this.tokVector;
12
12
  }
13
13
  SKIP_TOKEN() {
14
- return this.currIdx <= this.tokVector.length - 2 ? (this.consumeToken(), this.LA(1)) : END_OF_FILE;
14
+ return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : END_OF_FILE;
15
+ }
16
+ LA_FAST(e) {
17
+ let t = this.currIdx + e;
18
+ return this.tokVector[t];
15
19
  }
16
20
  LA(t) {
17
21
  let n = this.currIdx + t;
@@ -30,7 +34,7 @@ var LexerAdapter = class {
30
34
  this.currIdx = -1;
31
35
  }
32
36
  moveToTerminatedState() {
33
- this.currIdx = this.tokVector.length - 1;
37
+ this.currIdx = this.tokVectorLength - 1;
34
38
  }
35
39
  getLexerPosition() {
36
40
  return this.exportLexerState();
@@ -1,5 +1,3 @@
1
- import forEach_default from "../../../../../../lodash-es/forEach.js";
2
- import has_default from "../../../../../../lodash-es/has.js";
3
1
  import { GAstVisitor } from "../../../../../../@chevrotain/gast/lib/src/visitor.js";
4
2
  import { getProductionDslName } from "../../../../../../@chevrotain/gast/lib/src/helpers.js";
5
3
  import { AT_LEAST_ONE_IDX, AT_LEAST_ONE_SEP_IDX, MANY_IDX, MANY_SEP_IDX, OPTION_IDX, OR_IDX, getKeyForAutomaticLookahead } from "../../grammar/keys.js";
@@ -7,59 +5,59 @@ import { LLkLookaheadStrategy } from "../../grammar/llk_lookahead.js";
7
5
  import { DEFAULT_PARSER_CONFIG } from "../parser.js";
8
6
  var LooksAhead = class {
9
7
  initLooksAhead(e) {
10
- this.dynamicTokensEnabled = has_default(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled, this.maxLookahead = has_default(e, "maxLookahead") ? e.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead, this.lookaheadStrategy = has_default(e, "lookaheadStrategy") ? e.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
8
+ this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : DEFAULT_PARSER_CONFIG.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : DEFAULT_PARSER_CONFIG.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new LLkLookaheadStrategy({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = /* @__PURE__ */ new Map();
11
9
  }
12
- preComputeLookaheadFunctions(o) {
13
- forEach_default(o, (o) => {
14
- this.TRACE_INIT(`${o.name} Rule Lookahead`, () => {
15
- let { alternation: s, repetition: d, option: f, repetitionMandatory: p, repetitionMandatoryWithSeparator: m, repetitionWithSeparator: h } = collectMethods(o);
16
- forEach_default(s, (e) => {
17
- let s = e.idx === 0 ? "" : e.idx;
18
- this.TRACE_INIT(`${getProductionDslName(e)}${s}`, () => {
19
- let s = this.lookaheadStrategy.buildLookaheadForAlternation({
20
- prodOccurrence: e.idx,
21
- rule: o,
22
- maxLookahead: e.maxLookahead || this.maxLookahead,
23
- hasPredicates: e.hasPredicates,
10
+ preComputeLookaheadFunctions(e) {
11
+ e.forEach((e) => {
12
+ this.TRACE_INIT(`${e.name} Rule Lookahead`, () => {
13
+ let { alternation: s, repetition: l, option: u, repetitionMandatory: d, repetitionMandatoryWithSeparator: f, repetitionWithSeparator: p } = collectMethods(e);
14
+ s.forEach((a) => {
15
+ let o = a.idx === 0 ? "" : a.idx;
16
+ this.TRACE_INIT(`${getProductionDslName(a)}${o}`, () => {
17
+ let i = this.lookaheadStrategy.buildLookaheadForAlternation({
18
+ prodOccurrence: a.idx,
19
+ rule: e,
20
+ maxLookahead: a.maxLookahead || this.maxLookahead,
21
+ hasPredicates: a.hasPredicates,
24
22
  dynamicTokensEnabled: this.dynamicTokensEnabled
25
- }), c = getKeyForAutomaticLookahead(this.fullRuleNameToShort[o.name], 256, e.idx);
26
- this.setLaFuncCache(c, s);
23
+ }), o = getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name], 256, a.idx);
24
+ this.setLaFuncCache(o, i);
27
25
  });
28
- }), forEach_default(d, (e) => {
29
- this.computeLookaheadFunc(o, e.idx, 768, "Repetition", e.maxLookahead, getProductionDslName(e));
30
- }), forEach_default(f, (e) => {
31
- this.computeLookaheadFunc(o, e.idx, 512, "Option", e.maxLookahead, getProductionDslName(e));
32
- }), forEach_default(p, (e) => {
33
- this.computeLookaheadFunc(o, e.idx, AT_LEAST_ONE_IDX, "RepetitionMandatory", e.maxLookahead, getProductionDslName(e));
34
- }), forEach_default(m, (e) => {
35
- this.computeLookaheadFunc(o, e.idx, AT_LEAST_ONE_SEP_IDX, "RepetitionMandatoryWithSeparator", e.maxLookahead, getProductionDslName(e));
36
- }), forEach_default(h, (e) => {
37
- this.computeLookaheadFunc(o, e.idx, MANY_SEP_IDX, "RepetitionWithSeparator", e.maxLookahead, getProductionDslName(e));
26
+ }), l.forEach((a) => {
27
+ this.computeLookaheadFunc(e, a.idx, 768, "Repetition", a.maxLookahead, getProductionDslName(a));
28
+ }), u.forEach((a) => {
29
+ this.computeLookaheadFunc(e, a.idx, 512, "Option", a.maxLookahead, getProductionDslName(a));
30
+ }), d.forEach((o) => {
31
+ this.computeLookaheadFunc(e, o.idx, AT_LEAST_ONE_IDX, "RepetitionMandatory", o.maxLookahead, getProductionDslName(o));
32
+ }), f.forEach((a) => {
33
+ this.computeLookaheadFunc(e, a.idx, AT_LEAST_ONE_SEP_IDX, "RepetitionMandatoryWithSeparator", a.maxLookahead, getProductionDslName(a));
34
+ }), p.forEach((a) => {
35
+ this.computeLookaheadFunc(e, a.idx, MANY_SEP_IDX, "RepetitionWithSeparator", a.maxLookahead, getProductionDslName(a));
38
36
  });
39
37
  });
40
38
  });
41
39
  }
42
- computeLookaheadFunc(e, o, s, c, l, u) {
43
- this.TRACE_INIT(`${u}${o === 0 ? "" : o}`, () => {
44
- let u = this.lookaheadStrategy.buildLookaheadForOptional({
45
- prodOccurrence: o,
40
+ computeLookaheadFunc(e, i, a, o, s, c) {
41
+ this.TRACE_INIT(`${c}${i === 0 ? "" : i}`, () => {
42
+ let c = this.lookaheadStrategy.buildLookaheadForOptional({
43
+ prodOccurrence: i,
46
44
  rule: e,
47
- maxLookahead: l || this.maxLookahead,
45
+ maxLookahead: s || this.maxLookahead,
48
46
  dynamicTokensEnabled: this.dynamicTokensEnabled,
49
- prodType: c
50
- }), d = getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name], s, o);
51
- this.setLaFuncCache(d, u);
47
+ prodType: o
48
+ }), l = getKeyForAutomaticLookahead(this.fullRuleNameToShort[e.name], a, i);
49
+ this.setLaFuncCache(l, c);
52
50
  });
53
51
  }
54
- getKeyForAutomaticLookahead(e, o) {
55
- return getKeyForAutomaticLookahead(this.getLastExplicitRuleShortName(), e, o);
52
+ getKeyForAutomaticLookahead(e, i) {
53
+ return getKeyForAutomaticLookahead(this.currRuleShortName, e, i);
56
54
  }
57
55
  getLaFuncFromCache(e) {
58
56
  return this.lookAheadFuncsCache.get(e);
59
57
  }
60
58
  /* istanbul ignore next */
61
- setLaFuncCache(e, o) {
62
- this.lookAheadFuncsCache.set(e, o);
59
+ setLaFuncCache(e, i) {
60
+ this.lookAheadFuncsCache.set(e, i);
63
61
  }
64
62
  }, collectorVisitor = new class extends GAstVisitor {
65
63
  constructor() {
@@ -103,7 +101,7 @@ var LooksAhead = class {
103
101
  }();
104
102
  function collectMethods(e) {
105
103
  collectorVisitor.reset(), e.accept(collectorVisitor);
106
- let o = collectorVisitor.dslMethods;
107
- return collectorVisitor.reset(), o;
104
+ let i = collectorVisitor.dslMethods;
105
+ return collectorVisitor.reset(), i;
108
106
  }
109
107
  export { LooksAhead };
@@ -1,21 +1,20 @@
1
- import has_default from "../../../../../../lodash-es/has.js";
2
1
  import { timer } from "../../../../../../@chevrotain/utils/lib/src/timer.js";
3
2
  import { DEFAULT_PARSER_CONFIG } from "../parser.js";
4
3
  var PerformanceTracer = class {
5
- initPerformanceTracer(t) {
6
- if (has_default(t, "traceInitPerf")) {
7
- let e = t.traceInitPerf, n = typeof e == "number";
8
- this.traceInitMaxIdent = n ? e : Infinity, this.traceInitPerf = n ? e > 0 : e;
4
+ initPerformanceTracer(e) {
5
+ if (Object.hasOwn(e, "traceInitPerf")) {
6
+ let t = e.traceInitPerf, n = typeof t == "number";
7
+ this.traceInitMaxIdent = n ? t : Infinity, this.traceInitPerf = n ? t > 0 : t;
9
8
  } else this.traceInitMaxIdent = 0, this.traceInitPerf = DEFAULT_PARSER_CONFIG.traceInitPerf;
10
9
  this.traceInitIndent = -1;
11
10
  }
12
- TRACE_INIT(e, n) {
11
+ TRACE_INIT(t, n) {
13
12
  if (this.traceInitPerf === !0) {
14
13
  this.traceInitIndent++;
15
14
  let r = Array(this.traceInitIndent + 1).join(" ");
16
- this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${e}>`);
15
+ this.traceInitIndent < this.traceInitMaxIdent && console.log(`${r}--> <${t}>`);
17
16
  let { time: i, value: a } = timer(n), o = i > 10 ? console.warn : console.log;
18
- return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${e}> time: ${i}ms`), this.traceInitIndent--, a;
17
+ return this.traceInitIndent < this.traceInitMaxIdent && o(`${r}<-- <${t}> time: ${i}ms`), this.traceInitIndent--, a;
19
18
  } else return n();
20
19
  }
21
20
  };