@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,3 @@
1
- import isObject_default from "../../../../../../lodash-es/isObject.js";
2
- import isArray_default from "../../../../../../lodash-es/isArray.js";
3
- import isEmpty_default from "../../../../../../lodash-es/isEmpty.js";
4
- import flatten_default from "../../../../../../lodash-es/flatten.js";
5
- import clone_default from "../../../../../../lodash-es/clone.js";
6
- import every_default from "../../../../../../lodash-es/every.js";
7
- import has_default from "../../../../../../lodash-es/has.js";
8
- import values_default from "../../../../../../lodash-es/values.js";
9
- import reduce_default from "../../../../../../lodash-es/reduce.js";
10
- import uniq_default from "../../../../../../lodash-es/uniq.js";
11
1
  import { augmentTokenTypes, isTokenType, tokenStructuredMatcher, tokenStructuredMatcherNoCategories } from "../../../scan/tokens.js";
12
2
  import { EOF } from "../../../scan/tokens_public.js";
13
3
  import { NextTerminalAfterAtLeastOneSepWalker, NextTerminalAfterAtLeastOneWalker, NextTerminalAfterManySepWalker, NextTerminalAfterManyWalker } from "../../grammar/interpreter.js";
@@ -15,261 +5,281 @@ import { PROD_TYPE } from "../../grammar/lookahead.js";
15
5
  import { MismatchedTokenException, NotAllInputParsedException, isRecognitionException } from "../../exceptions_public.js";
16
6
  import { IN_RULE_RECOVERY_EXCEPTION } from "./recoverable.js";
17
7
  import { AT_LEAST_ONE_IDX, AT_LEAST_ONE_SEP_IDX, BITS_FOR_METHOD_TYPE, BITS_FOR_OCCURRENCE_IDX, MANY_IDX, MANY_SEP_IDX, OPTION_IDX, OR_IDX } from "../../grammar/keys.js";
18
- import { DEFAULT_RULE_CONFIG } from "../parser.js";
8
+ import { DEFAULT_RULE_CONFIG, END_OF_FILE } from "../parser.js";
19
9
  var RecognizerEngine = class {
20
- initRecognizerEngine(M, N) {
21
- if (this.className = this.constructor.name, this.shortRuleNameToFull = {}, this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 256, this.tokenMatcher = tokenStructuredMatcherNoCategories, this.subruleIdx = 0, this.definedRulesNames = [], this.tokensMap = {}, this.isBackTrackingStack = [], this.RULE_STACK = [], this.RULE_OCCURRENCE_STACK = [], this.gastProductionsCache = {}, has_default(N, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
22
- if (isArray_default(M)) {
23
- if (isEmpty_default(M)) throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");
24
- if (typeof M[0].startOffset == "number") throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.");
10
+ initRecognizerEngine(C, w) {
11
+ if (this.className = this.constructor.name, this.shortRuleNameToFull = {}, this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 256, this.tokenMatcher = tokenStructuredMatcherNoCategories, this.subruleIdx = 0, this.currRuleShortName = 0, this.definedRulesNames = [], this.tokensMap = {}, this.isBackTrackingStack = [], this.RULE_STACK = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK = [], this.RULE_OCCURRENCE_STACK_IDX = -1, this.gastProductionsCache = {}, Object.hasOwn(w, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
12
+ if (Array.isArray(C)) {
13
+ if (C.length === 0) throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");
14
+ if (typeof C[0].startOffset == "number") throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.");
25
15
  }
26
- if (isArray_default(M)) this.tokensMap = reduce_default(M, (l, E) => (l[E.name] = E, l), {});
27
- else if (has_default(M, "modes") && every_default(flatten_default(values_default(M.modes)), isTokenType)) this.tokensMap = reduce_default(uniq_default(flatten_default(values_default(M.modes))), (l, E) => (l[E.name] = E, l), {});
28
- else if (isObject_default(M)) this.tokensMap = clone_default(M);
16
+ if (Array.isArray(C)) this.tokensMap = C.reduce((e, y) => (e[y.name] = y, e), {});
17
+ else if (Object.hasOwn(C, "modes") && Object.values(C.modes).flat().every(isTokenType)) {
18
+ let e = Object.values(C.modes).flat();
19
+ this.tokensMap = [...new Set(e)].reduce((e, y) => (e[y.name] = y, e), {});
20
+ } else if (typeof C == "object" && C) this.tokensMap = Object.assign({}, C);
29
21
  else throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");
30
- this.tokensMap.EOF = EOF, this.tokenMatcher = every_default(has_default(M, "modes") ? flatten_default(values_default(M.modes)) : values_default(M), (l) => isEmpty_default(l.categoryMatches)) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, augmentTokenTypes(values_default(this.tokensMap));
31
- }
32
- defineRule(l, E, D) {
33
- if (this.selfAnalysisDone) throw Error(`Grammar rule <${l}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);
34
- let O = has_default(D, "resyncEnabled") ? D.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled, k = has_default(D, "recoveryValueFunc") ? D.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc, A = this.ruleShortNameIdx << 12;
35
- this.ruleShortNameIdx++, this.shortRuleNameToFull[A] = l, this.fullRuleNameToShort[l] = A;
36
- let j;
37
- return j = this.outputCst === !0 ? function(...D) {
22
+ this.tokensMap.EOF = EOF, this.tokenMatcher = (Object.hasOwn(C, "modes") ? Object.values(C.modes).flat() : Object.values(C)).every((e) => e.categoryMatches?.length == 0) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, augmentTokenTypes(Object.values(this.tokensMap));
23
+ }
24
+ defineRule(e, y, b) {
25
+ if (this.selfAnalysisDone) throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);
26
+ let x = Object.hasOwn(b, "resyncEnabled") ? b.resyncEnabled : DEFAULT_RULE_CONFIG.resyncEnabled, S = Object.hasOwn(b, "recoveryValueFunc") ? b.recoveryValueFunc : DEFAULT_RULE_CONFIG.recoveryValueFunc, C = this.ruleShortNameIdx << 12;
27
+ this.ruleShortNameIdx++, this.shortRuleNameToFull[C] = e, this.fullRuleNameToShort[e] = C;
28
+ let w;
29
+ return w = this.outputCst === !0 ? function(...b) {
38
30
  try {
39
- this.ruleInvocationStateUpdate(A, l, this.subruleIdx), E.apply(this, D);
40
- let O = this.CST_STACK[this.CST_STACK.length - 1];
41
- return this.cstPostRule(O), O;
42
- } catch (l) {
43
- return this.invokeRuleCatch(l, O, k);
31
+ this.ruleInvocationStateUpdate(C, e, this.subruleIdx), y.apply(this, b);
32
+ let x = this.CST_STACK[this.CST_STACK.length - 1];
33
+ return this.cstPostRule(x), x;
34
+ } catch (e) {
35
+ return this.invokeRuleCatch(e, x, S);
44
36
  } finally {
45
37
  this.ruleFinallyStateUpdate();
46
38
  }
47
- } : function(...D) {
39
+ } : function(...b) {
48
40
  try {
49
- return this.ruleInvocationStateUpdate(A, l, this.subruleIdx), E.apply(this, D);
50
- } catch (l) {
51
- return this.invokeRuleCatch(l, O, k);
41
+ return this.ruleInvocationStateUpdate(C, e, this.subruleIdx), y.apply(this, b);
42
+ } catch (e) {
43
+ return this.invokeRuleCatch(e, x, S);
52
44
  } finally {
53
45
  this.ruleFinallyStateUpdate();
54
46
  }
55
- }, Object.assign(j, {
56
- ruleName: l,
57
- originalGrammarAction: E
47
+ }, Object.assign(function(...y) {
48
+ this.onBeforeParse(e);
49
+ try {
50
+ return w.apply(this, y);
51
+ } finally {
52
+ this.onAfterParse(e);
53
+ }
54
+ }, {
55
+ ruleName: e,
56
+ originalGrammarAction: y,
57
+ coreRule: w
58
58
  });
59
59
  }
60
- invokeRuleCatch(l, E, D) {
61
- let O = this.RULE_STACK.length === 1, k = E && !this.isBackTracking() && this.recoveryEnabled;
62
- if (isRecognitionException(l)) {
63
- let E = l;
64
- if (k) {
65
- let O = this.findReSyncTokenType();
66
- if (this.isInCurrentRuleReSyncSet(O)) if (E.resyncedTokens = this.reSyncTo(O), this.outputCst) {
67
- let l = this.CST_STACK[this.CST_STACK.length - 1];
68
- return l.recoveredNode = !0, l;
69
- } else return D(l);
60
+ invokeRuleCatch(e, y, b) {
61
+ let x = this.RULE_STACK_IDX === 0, S = y && !this.isBackTracking() && this.recoveryEnabled;
62
+ if (isRecognitionException(e)) {
63
+ let y = e;
64
+ if (S) {
65
+ let x = this.findReSyncTokenType();
66
+ if (this.isInCurrentRuleReSyncSet(x)) if (y.resyncedTokens = this.reSyncTo(x), this.outputCst) {
67
+ let e = this.CST_STACK[this.CST_STACK.length - 1];
68
+ return e.recoveredNode = !0, e;
69
+ } else return b(e);
70
70
  else {
71
71
  if (this.outputCst) {
72
- let l = this.CST_STACK[this.CST_STACK.length - 1];
73
- l.recoveredNode = !0, E.partialCstResult = l;
72
+ let e = this.CST_STACK[this.CST_STACK.length - 1];
73
+ e.recoveredNode = !0, y.partialCstResult = e;
74
74
  }
75
- throw E;
75
+ throw y;
76
76
  }
77
- } else if (O) return this.moveToTerminatedState(), D(l);
78
- else throw E;
79
- } else throw l;
80
- }
81
- optionInternal(l, E) {
82
- let D = this.getKeyForAutomaticLookahead(512, E);
83
- return this.optionInternalLogic(l, E, D);
84
- }
85
- optionInternalLogic(l, E, D) {
86
- let O = this.getLaFuncFromCache(D), k;
87
- if (typeof l != "function") {
88
- k = l.DEF;
89
- let E = l.GATE;
90
- if (E !== void 0) {
91
- let l = O;
92
- O = () => E.call(this) && l.call(this);
77
+ } else if (x) return this.moveToTerminatedState(), b(e);
78
+ else throw y;
79
+ } else throw e;
80
+ }
81
+ optionInternal(e, y) {
82
+ let b = this.getKeyForAutomaticLookahead(512, y);
83
+ return this.optionInternalLogic(e, y, b);
84
+ }
85
+ optionInternalLogic(e, y, b) {
86
+ let x = this.getLaFuncFromCache(b), S;
87
+ if (typeof e != "function") {
88
+ S = e.DEF;
89
+ let y = e.GATE;
90
+ if (y !== void 0) {
91
+ let e = x;
92
+ x = () => y.call(this) && e.call(this);
93
93
  }
94
- } else k = l;
95
- if (O.call(this) === !0) return k.call(this);
96
- }
97
- atLeastOneInternal(l, E) {
98
- let D = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_IDX, l);
99
- return this.atLeastOneInternalLogic(l, E, D);
100
- }
101
- atLeastOneInternalLogic(l, E, D) {
102
- let O = this.getLaFuncFromCache(D), k;
103
- if (typeof E != "function") {
104
- k = E.DEF;
105
- let l = E.GATE;
106
- if (l !== void 0) {
107
- let E = O;
108
- O = () => l.call(this) && E.call(this);
94
+ } else S = e;
95
+ if (x.call(this) === !0) return S.call(this);
96
+ }
97
+ atLeastOneInternal(e, y) {
98
+ let b = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_IDX, e);
99
+ return this.atLeastOneInternalLogic(e, y, b);
100
+ }
101
+ atLeastOneInternalLogic(e, y, b) {
102
+ let x = this.getLaFuncFromCache(b), S;
103
+ if (typeof y != "function") {
104
+ S = y.DEF;
105
+ let e = y.GATE;
106
+ if (e !== void 0) {
107
+ let y = x;
108
+ x = () => e.call(this) && y.call(this);
109
109
  }
110
- } else k = E;
111
- if (O.call(this) === !0) {
112
- let l = this.doSingleRepetition(k);
113
- for (; O.call(this) === !0 && l === !0;) l = this.doSingleRepetition(k);
114
- } else throw this.raiseEarlyExitException(l, PROD_TYPE.REPETITION_MANDATORY, E.ERR_MSG);
115
- this.attemptInRepetitionRecovery(this.atLeastOneInternal, [l, E], O, AT_LEAST_ONE_IDX, l, NextTerminalAfterAtLeastOneWalker);
116
- }
117
- atLeastOneSepFirstInternal(l, E) {
118
- let D = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_SEP_IDX, l);
119
- this.atLeastOneSepFirstInternalLogic(l, E, D);
120
- }
121
- atLeastOneSepFirstInternalLogic(l, E, D) {
122
- let O = E.DEF, k = E.SEP;
123
- if (this.getLaFuncFromCache(D).call(this) === !0) {
124
- O.call(this);
125
- let E = () => this.tokenMatcher(this.LA(1), k);
126
- for (; this.tokenMatcher(this.LA(1), k) === !0;) this.CONSUME(k), O.call(this);
110
+ } else S = y;
111
+ if (x.call(this) === !0) {
112
+ let e = this.doSingleRepetition(S);
113
+ for (; x.call(this) === !0 && e === !0;) e = this.doSingleRepetition(S);
114
+ } else throw this.raiseEarlyExitException(e, PROD_TYPE.REPETITION_MANDATORY, y.ERR_MSG);
115
+ this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, y], x, AT_LEAST_ONE_IDX, e, NextTerminalAfterAtLeastOneWalker);
116
+ }
117
+ atLeastOneSepFirstInternal(e, y) {
118
+ let b = this.getKeyForAutomaticLookahead(AT_LEAST_ONE_SEP_IDX, e);
119
+ this.atLeastOneSepFirstInternalLogic(e, y, b);
120
+ }
121
+ atLeastOneSepFirstInternalLogic(e, y, b) {
122
+ let x = y.DEF, S = y.SEP;
123
+ if (this.getLaFuncFromCache(b).call(this) === !0) {
124
+ x.call(this);
125
+ let y = () => this.tokenMatcher(this.LA_FAST(1), S);
126
+ for (; this.tokenMatcher(this.LA_FAST(1), S) === !0;) this.CONSUME(S), x.call(this);
127
127
  this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
128
- l,
129
- k,
130
- E,
131
- O,
128
+ e,
129
+ S,
130
+ y,
131
+ x,
132
132
  NextTerminalAfterAtLeastOneSepWalker
133
- ], E, AT_LEAST_ONE_SEP_IDX, l, NextTerminalAfterAtLeastOneSepWalker);
134
- } else throw this.raiseEarlyExitException(l, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, E.ERR_MSG);
135
- }
136
- manyInternal(l, E) {
137
- let D = this.getKeyForAutomaticLookahead(768, l);
138
- return this.manyInternalLogic(l, E, D);
139
- }
140
- manyInternalLogic(l, E, D) {
141
- let O = this.getLaFuncFromCache(D), k;
142
- if (typeof E != "function") {
143
- k = E.DEF;
144
- let l = E.GATE;
145
- if (l !== void 0) {
146
- let E = O;
147
- O = () => l.call(this) && E.call(this);
133
+ ], y, AT_LEAST_ONE_SEP_IDX, e, NextTerminalAfterAtLeastOneSepWalker);
134
+ } else throw this.raiseEarlyExitException(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, y.ERR_MSG);
135
+ }
136
+ manyInternal(e, y) {
137
+ let b = this.getKeyForAutomaticLookahead(768, e);
138
+ return this.manyInternalLogic(e, y, b);
139
+ }
140
+ manyInternalLogic(e, y, b) {
141
+ let x = this.getLaFuncFromCache(b), S;
142
+ if (typeof y != "function") {
143
+ S = y.DEF;
144
+ let e = y.GATE;
145
+ if (e !== void 0) {
146
+ let y = x;
147
+ x = () => e.call(this) && y.call(this);
148
148
  }
149
- } else k = E;
150
- let A = !0;
151
- for (; O.call(this) === !0 && A === !0;) A = this.doSingleRepetition(k);
152
- this.attemptInRepetitionRecovery(this.manyInternal, [l, E], O, 768, l, NextTerminalAfterManyWalker, A);
153
- }
154
- manySepFirstInternal(l, E) {
155
- let D = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, l);
156
- this.manySepFirstInternalLogic(l, E, D);
157
- }
158
- manySepFirstInternalLogic(l, E, D) {
159
- let O = E.DEF, k = E.SEP;
160
- if (this.getLaFuncFromCache(D).call(this) === !0) {
161
- O.call(this);
162
- let E = () => this.tokenMatcher(this.LA(1), k);
163
- for (; this.tokenMatcher(this.LA(1), k) === !0;) this.CONSUME(k), O.call(this);
149
+ } else S = y;
150
+ let C = !0;
151
+ for (; x.call(this) === !0 && C === !0;) C = this.doSingleRepetition(S);
152
+ this.attemptInRepetitionRecovery(this.manyInternal, [e, y], x, 768, e, NextTerminalAfterManyWalker, C);
153
+ }
154
+ manySepFirstInternal(e, y) {
155
+ let b = this.getKeyForAutomaticLookahead(MANY_SEP_IDX, e);
156
+ this.manySepFirstInternalLogic(e, y, b);
157
+ }
158
+ manySepFirstInternalLogic(e, y, b) {
159
+ let x = y.DEF, S = y.SEP;
160
+ if (this.getLaFuncFromCache(b).call(this) === !0) {
161
+ x.call(this);
162
+ let y = () => this.tokenMatcher(this.LA_FAST(1), S);
163
+ for (; this.tokenMatcher(this.LA_FAST(1), S) === !0;) this.CONSUME(S), x.call(this);
164
164
  this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
165
- l,
166
- k,
167
- E,
168
- O,
165
+ e,
166
+ S,
167
+ y,
168
+ x,
169
169
  NextTerminalAfterManySepWalker
170
- ], E, MANY_SEP_IDX, l, NextTerminalAfterManySepWalker);
170
+ ], y, MANY_SEP_IDX, e, NextTerminalAfterManySepWalker);
171
171
  }
172
172
  }
173
- repetitionSepSecondInternal(l, E, D, O, k) {
174
- for (; D();) this.CONSUME(E), O.call(this);
173
+ repetitionSepSecondInternal(e, y, b, x, S) {
174
+ for (; b();) this.CONSUME(y), x.call(this);
175
175
  /* istanbul ignore else */
176
176
  this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal, [
177
- l,
178
- E,
179
- D,
180
- O,
181
- k
182
- ], D, AT_LEAST_ONE_SEP_IDX, l, k);
183
- }
184
- doSingleRepetition(l) {
185
- let E = this.getLexerPosition();
186
- return l.call(this), this.getLexerPosition() > E;
187
- }
188
- orInternal(l, D) {
189
- let O = this.getKeyForAutomaticLookahead(256, D), k = isArray_default(l) ? l : l.DEF, A = this.getLaFuncFromCache(O).call(this, k);
190
- if (A !== void 0) return k[A].ALT.call(this);
191
- this.raiseNoAltException(D, l.ERR_MSG);
177
+ e,
178
+ y,
179
+ b,
180
+ x,
181
+ S
182
+ ], b, AT_LEAST_ONE_SEP_IDX, e, S);
183
+ }
184
+ doSingleRepetition(e) {
185
+ let y = this.getLexerPosition();
186
+ return e.call(this), this.getLexerPosition() > y;
187
+ }
188
+ orInternal(e, y) {
189
+ let b = this.getKeyForAutomaticLookahead(256, y), x = Array.isArray(e) ? e : e.DEF, S = this.getLaFuncFromCache(b).call(this, x);
190
+ if (S !== void 0) return x[S].ALT.call(this);
191
+ this.raiseNoAltException(y, e.ERR_MSG);
192
192
  }
193
193
  ruleFinallyStateUpdate() {
194
- if (this.RULE_STACK.pop(), this.RULE_OCCURRENCE_STACK.pop(), this.cstFinallyStateUpdate(), this.RULE_STACK.length === 0 && this.isAtEndOfInput() === !1) {
195
- let l = this.LA(1), E = this.errorMessageProvider.buildNotAllInputParsedMessage({
196
- firstRedundant: l,
197
- ruleName: this.getCurrRuleFullName()
198
- });
199
- this.SAVE_ERROR(new NotAllInputParsedException(E, l));
200
- }
194
+ this.RULE_STACK_IDX--, this.RULE_OCCURRENCE_STACK_IDX--, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]), this.cstFinallyStateUpdate();
201
195
  }
202
- subruleInternal(l, E, D) {
203
- let O;
196
+ subruleInternal(e, y, b) {
197
+ let x;
204
198
  try {
205
- let k = D === void 0 ? void 0 : D.ARGS;
206
- return this.subruleIdx = E, O = l.apply(this, k), this.cstPostNonTerminal(O, D !== void 0 && D.LABEL !== void 0 ? D.LABEL : l.ruleName), O;
207
- } catch (E) {
208
- throw this.subruleInternalError(E, D, l.ruleName);
199
+ let S = b === void 0 ? void 0 : b.ARGS;
200
+ return this.subruleIdx = y, x = e.coreRule.apply(this, S), this.cstPostNonTerminal(x, b !== void 0 && b.LABEL !== void 0 ? b.LABEL : e.ruleName), x;
201
+ } catch (y) {
202
+ throw this.subruleInternalError(y, b, e.ruleName);
209
203
  }
210
204
  }
211
- subruleInternalError(l, E, D) {
212
- throw isRecognitionException(l) && l.partialCstResult !== void 0 && (this.cstPostNonTerminal(l.partialCstResult, E !== void 0 && E.LABEL !== void 0 ? E.LABEL : D), delete l.partialCstResult), l;
205
+ subruleInternalError(e, y, b) {
206
+ throw isRecognitionException(e) && e.partialCstResult !== void 0 && (this.cstPostNonTerminal(e.partialCstResult, y !== void 0 && y.LABEL !== void 0 ? y.LABEL : b), delete e.partialCstResult), e;
213
207
  }
214
- consumeInternal(l, E, D) {
215
- let O;
208
+ consumeInternal(e, y, b) {
209
+ let x;
216
210
  try {
217
- let E = this.LA(1);
218
- this.tokenMatcher(E, l) === !0 ? (this.consumeToken(), O = E) : this.consumeInternalError(l, E, D);
219
- } catch (D) {
220
- O = this.consumeInternalRecovery(l, E, D);
211
+ let y = this.LA_FAST(1);
212
+ this.tokenMatcher(y, e) === !0 ? (this.consumeToken(), x = y) : this.consumeInternalError(e, y, b);
213
+ } catch (b) {
214
+ x = this.consumeInternalRecovery(e, y, b);
221
215
  }
222
- return this.cstPostTerminal(D !== void 0 && D.LABEL !== void 0 ? D.LABEL : l.name, O), O;
223
- }
224
- consumeInternalError(l, E, D) {
225
- let O, k = this.LA(0);
226
- throw O = D !== void 0 && D.ERR_MSG ? D.ERR_MSG : this.errorMessageProvider.buildMismatchTokenMessage({
227
- expected: l,
228
- actual: E,
229
- previous: k,
216
+ return this.cstPostTerminal(b !== void 0 && b.LABEL !== void 0 ? b.LABEL : e.name, x), x;
217
+ }
218
+ consumeInternalError(e, y, b) {
219
+ let x, S = this.LA(0);
220
+ throw x = b !== void 0 && b.ERR_MSG ? b.ERR_MSG : this.errorMessageProvider.buildMismatchTokenMessage({
221
+ expected: e,
222
+ actual: y,
223
+ previous: S,
230
224
  ruleName: this.getCurrRuleFullName()
231
- }), this.SAVE_ERROR(new MismatchedTokenException(O, E, k));
225
+ }), this.SAVE_ERROR(new MismatchedTokenException(x, y, S));
232
226
  }
233
- consumeInternalRecovery(l, E, D) {
234
- if (this.recoveryEnabled && D.name === "MismatchedTokenException" && !this.isBackTracking()) {
235
- let O = this.getFollowsForInRuleRecovery(l, E);
227
+ consumeInternalRecovery(e, y, b) {
228
+ if (this.recoveryEnabled && b.name === "MismatchedTokenException" && !this.isBackTracking()) {
229
+ let x = this.getFollowsForInRuleRecovery(e, y);
236
230
  try {
237
- return this.tryInRuleRecovery(l, O);
238
- } catch (l) {
239
- throw l.name === "InRuleRecoveryException" ? D : l;
231
+ return this.tryInRuleRecovery(e, x);
232
+ } catch (e) {
233
+ throw e.name === "InRuleRecoveryException" ? b : e;
240
234
  }
241
- } else throw D;
235
+ } else throw b;
242
236
  }
243
237
  saveRecogState() {
244
- let l = this.errors, E = clone_default(this.RULE_STACK);
238
+ let e = this.errors, y = this.RULE_STACK.slice(0, this.RULE_STACK_IDX + 1);
245
239
  return {
246
- errors: l,
240
+ errors: e,
247
241
  lexerState: this.exportLexerState(),
248
- RULE_STACK: E,
242
+ RULE_STACK: y,
249
243
  CST_STACK: this.CST_STACK
250
244
  };
251
245
  }
252
- reloadRecogState(l) {
253
- this.errors = l.errors, this.importLexerState(l.lexerState), this.RULE_STACK = l.RULE_STACK;
246
+ reloadRecogState(e) {
247
+ this.errors = e.errors, this.importLexerState(e.lexerState);
248
+ let y = e.RULE_STACK;
249
+ for (let e = 0; e < y.length; e++) this.RULE_STACK[e] = y[e];
250
+ this.RULE_STACK_IDX = y.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]);
254
251
  }
255
- ruleInvocationStateUpdate(l, E, D) {
256
- this.RULE_OCCURRENCE_STACK.push(D), this.RULE_STACK.push(l), this.cstInvocationStateUpdate(E);
252
+ ruleInvocationStateUpdate(e, y, b) {
253
+ this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = b, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.cstInvocationStateUpdate(y);
257
254
  }
258
255
  isBackTracking() {
259
256
  return this.isBackTrackingStack.length !== 0;
260
257
  }
261
258
  getCurrRuleFullName() {
262
- let l = this.getLastExplicitRuleShortName();
263
- return this.shortRuleNameToFull[l];
259
+ let e = this.currRuleShortName;
260
+ return this.shortRuleNameToFull[e];
264
261
  }
265
- shortRuleNameToFullName(l) {
266
- return this.shortRuleNameToFull[l];
262
+ shortRuleNameToFullName(e) {
263
+ return this.shortRuleNameToFull[e];
267
264
  }
268
265
  isAtEndOfInput() {
269
266
  return this.tokenMatcher(this.LA(1), EOF);
270
267
  }
271
268
  reset() {
272
- this.resetLexerState(), this.subruleIdx = 0, this.isBackTrackingStack = [], this.errors = [], this.RULE_STACK = [], this.CST_STACK = [], this.RULE_OCCURRENCE_STACK = [];
269
+ this.resetLexerState(), this.subruleIdx = 0, this.currRuleShortName = 0, this.isBackTrackingStack = [], this.errors = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK_IDX = -1, this.CST_STACK = [];
270
+ }
271
+ onBeforeParse(e) {
272
+ for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(END_OF_FILE);
273
+ }
274
+ onAfterParse(e) {
275
+ if (this.isAtEndOfInput() === !1) {
276
+ let e = this.LA(1), y = this.errorMessageProvider.buildNotAllInputParsedMessage({
277
+ firstRedundant: e,
278
+ ruleName: this.getCurrRuleFullName()
279
+ });
280
+ this.SAVE_ERROR(new NotAllInputParsedException(y, e));
281
+ }
282
+ for (; this.tokVector.at(-1) === END_OF_FILE;) this.tokVector.pop();
273
283
  }
274
284
  };
275
285
  export { RecognizerEngine };