@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,248 +1,241 @@
1
- import isEmpty_default from "../../../../../lodash-es/isEmpty.js";
2
- import flatten_default from "../../../../../lodash-es/flatten.js";
3
- import forEach_default from "../../../../../lodash-es/forEach.js";
4
- import every_default from "../../../../../lodash-es/every.js";
5
- import map_default from "../../../../../lodash-es/map.js";
6
- import has_default from "../../../../../lodash-es/has.js";
7
- import reduce_default from "../../../../../lodash-es/reduce.js";
8
1
  import { Alternation, Alternative, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator } from "../../../../../@chevrotain/gast/lib/src/model.js";
9
2
  import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
10
3
  import { RestWalker } from "./rest.js";
11
4
  import { tokenStructuredMatcher, tokenStructuredMatcherNoCategories } from "../../scan/tokens.js";
12
5
  import { possiblePathsFrom } from "./interpreter.js";
13
6
  var PROD_TYPE;
14
- (function(a) {
15
- a[a.OPTION = 0] = "OPTION", a[a.REPETITION = 1] = "REPETITION", a[a.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", a[a.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", a[a.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", a[a.ALTERNATION = 5] = "ALTERNATION";
7
+ (function(e) {
8
+ e[e.OPTION = 0] = "OPTION", e[e.REPETITION = 1] = "REPETITION", e[e.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", e[e.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", e[e.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", e[e.ALTERNATION = 5] = "ALTERNATION";
16
9
  })(PROD_TYPE ||= {});
17
- function getProdType(a) {
10
+ function getProdType(b) {
18
11
  /* istanbul ignore else */
19
- if (a instanceof Option || a === "Option") return PROD_TYPE.OPTION;
20
- if (a instanceof Repetition || a === "Repetition") return PROD_TYPE.REPETITION;
21
- if (a instanceof RepetitionMandatory || a === "RepetitionMandatory") return PROD_TYPE.REPETITION_MANDATORY;
22
- if (a instanceof RepetitionMandatoryWithSeparator || a === "RepetitionMandatoryWithSeparator") return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR;
23
- if (a instanceof RepetitionWithSeparator || a === "RepetitionWithSeparator") return PROD_TYPE.REPETITION_WITH_SEPARATOR;
24
- if (a instanceof Alternation || a === "Alternation") return PROD_TYPE.ALTERNATION;
12
+ if (b instanceof Option || b === "Option") return PROD_TYPE.OPTION;
13
+ if (b instanceof Repetition || b === "Repetition") return PROD_TYPE.REPETITION;
14
+ if (b instanceof RepetitionMandatory || b === "RepetitionMandatory") return PROD_TYPE.REPETITION_MANDATORY;
15
+ if (b instanceof RepetitionMandatoryWithSeparator || b === "RepetitionMandatoryWithSeparator") return PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR;
16
+ if (b instanceof RepetitionWithSeparator || b === "RepetitionWithSeparator") return PROD_TYPE.REPETITION_WITH_SEPARATOR;
17
+ if (b instanceof Alternation || b === "Alternation") return PROD_TYPE.ALTERNATION;
25
18
  throw Error("non exhaustive match");
26
19
  }
27
- function getLookaheadPaths(a) {
28
- let { occurrence: T, rule: E, prodType: D, maxLookahead: O } = a, k = getProdType(D);
29
- return k === PROD_TYPE.ALTERNATION ? getLookaheadPathsForOr(T, E, O) : getLookaheadPathsForOptionalProd(T, E, k, O);
20
+ function getLookaheadPaths(e) {
21
+ let { occurrence: b, rule: x, prodType: S, maxLookahead: C } = e, w = getProdType(S);
22
+ return w === PROD_TYPE.ALTERNATION ? getLookaheadPathsForOr(b, x, C) : getLookaheadPathsForOptionalProd(b, x, w, C);
30
23
  }
31
- function buildLookaheadFuncForOr(a, T, E, D, O, k) {
32
- let A = getLookaheadPathsForOr(a, T, E);
33
- return k(A, D, areTokenCategoriesNotUsed(A) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, O);
24
+ function buildLookaheadFuncForOr(e, b, x, S, C, w) {
25
+ let T = getLookaheadPathsForOr(e, b, x);
26
+ return w(T, S, areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher, C);
34
27
  }
35
- function buildLookaheadFuncForOptionalProd(a, T, E, D, O, k) {
36
- let A = getLookaheadPathsForOptionalProd(a, T, O, E), j = areTokenCategoriesNotUsed(A) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
37
- return k(A[0], j, D);
28
+ function buildLookaheadFuncForOptionalProd(e, b, x, S, C, w) {
29
+ let T = getLookaheadPathsForOptionalProd(e, b, C, x), E = areTokenCategoriesNotUsed(T) ? tokenStructuredMatcherNoCategories : tokenStructuredMatcher;
30
+ return w(T[0], E, S);
38
31
  }
39
- function buildAlternativesLookAheadFunc(a, j, M, N) {
40
- let P = a.length, F = every_default(a, (a) => every_default(a, (a) => a.length === 1));
41
- if (j) return function(T) {
42
- let E = map_default(T, (a) => a.GATE);
43
- for (let T = 0; T < P; T++) {
44
- let D = a[T], O = D.length, k = E[T];
45
- if (!(k !== void 0 && k.call(this) === !1)) nextPath: for (let a = 0; a < O; a++) {
46
- let E = D[a], O = E.length;
47
- for (let a = 0; a < O; a++) if (M(this.LA(a + 1), E[a]) === !1) continue nextPath;
48
- return T;
32
+ function buildAlternativesLookAheadFunc(e, b, x, S) {
33
+ let C = e.length, w = e.every((e) => e.every((e) => e.length === 1));
34
+ if (b) return function(b) {
35
+ let S = b.map((e) => e.GATE);
36
+ for (let b = 0; b < C; b++) {
37
+ let C = e[b], w = C.length, T = S[b];
38
+ if (!(T !== void 0 && T.call(this) === !1)) nextPath: for (let e = 0; e < w; e++) {
39
+ let S = C[e], w = S.length;
40
+ for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
41
+ return b;
49
42
  }
50
43
  }
51
44
  };
52
- if (F && !N) {
53
- let D = reduce_default(map_default(a, (a) => flatten_default(a)), (a, T, D) => (forEach_default(T, (T) => {
54
- has_default(a, T.tokenTypeIdx) || (a[T.tokenTypeIdx] = D), forEach_default(T.categoryMatches, (T) => {
55
- has_default(a, T) || (a[T] = D);
45
+ if (w && !S) {
46
+ let b = e.map((e) => e.flat()).reduce((e, b, x) => (b.forEach((b) => {
47
+ b.tokenTypeIdx in e || (e[b.tokenTypeIdx] = x), b.categoryMatches.forEach((b) => {
48
+ Object.hasOwn(e, b) || (e[b] = x);
56
49
  });
57
- }), a), {});
50
+ }), e), {});
58
51
  return function() {
59
- return D[this.LA(1).tokenTypeIdx];
52
+ return b[this.LA_FAST(1).tokenTypeIdx];
60
53
  };
61
54
  } else return function() {
62
- for (let T = 0; T < P; T++) {
63
- let E = a[T], D = E.length;
64
- nextPath: for (let a = 0; a < D; a++) {
65
- let D = E[a], O = D.length;
66
- for (let a = 0; a < O; a++) if (M(this.LA(a + 1), D[a]) === !1) continue nextPath;
67
- return T;
55
+ for (let b = 0; b < C; b++) {
56
+ let S = e[b], C = S.length;
57
+ nextPath: for (let e = 0; e < C; e++) {
58
+ let C = S[e], w = C.length;
59
+ for (let e = 0; e < w; e++) if (x(this.LA_FAST(e + 1), C[e]) === !1) continue nextPath;
60
+ return b;
68
61
  }
69
62
  }
70
63
  };
71
64
  }
72
- function buildSingleAlternativeLookaheadFunction(O, k, j) {
73
- let M = every_default(O, (a) => a.length === 1), N = O.length;
74
- if (M && !j) {
75
- let D = flatten_default(O);
76
- if (D.length === 1 && isEmpty_default(D[0].categoryMatches)) {
77
- let a = D[0].tokenTypeIdx;
65
+ function buildSingleAlternativeLookaheadFunction(e, b, x) {
66
+ let S = e.every((e) => e.length === 1), C = e.length;
67
+ if (S && !x) {
68
+ let b = e.flat();
69
+ if (b.length === 1 && b[0].categoryMatches.length === 0) {
70
+ let e = b[0].tokenTypeIdx;
78
71
  return function() {
79
- return this.LA(1).tokenTypeIdx === a;
72
+ return this.LA_FAST(1).tokenTypeIdx === e;
80
73
  };
81
74
  } else {
82
- let a = reduce_default(D, (a, T, D) => (a[T.tokenTypeIdx] = !0, forEach_default(T.categoryMatches, (T) => {
83
- a[T] = !0;
84
- }), a), []);
75
+ let e = b.reduce((e, b, x) => (e[b.tokenTypeIdx] = !0, b.categoryMatches.forEach((b) => {
76
+ e[b] = !0;
77
+ }), e), []);
85
78
  return function() {
86
- return a[this.LA(1).tokenTypeIdx] === !0;
79
+ return e[this.LA_FAST(1).tokenTypeIdx] === !0;
87
80
  };
88
81
  }
89
82
  } else return function() {
90
- nextPath: for (let a = 0; a < N; a++) {
91
- let T = O[a], E = T.length;
92
- for (let a = 0; a < E; a++) if (k(this.LA(a + 1), T[a]) === !1) continue nextPath;
83
+ nextPath: for (let x = 0; x < C; x++) {
84
+ let S = e[x], C = S.length;
85
+ for (let e = 0; e < C; e++) if (b(this.LA_FAST(e + 1), S[e]) === !1) continue nextPath;
93
86
  return !0;
94
87
  }
95
88
  return !1;
96
89
  };
97
90
  }
98
91
  var RestDefinitionFinderWalker = class extends RestWalker {
99
- constructor(a, T, E) {
100
- super(), this.topProd = a, this.targetOccurrence = T, this.targetProdType = E;
92
+ constructor(e, b, x) {
93
+ super(), this.topProd = e, this.targetOccurrence = b, this.targetProdType = x;
101
94
  }
102
95
  startWalking() {
103
96
  return this.walk(this.topProd), this.restDef;
104
97
  }
105
- checkIsTarget(a, T, E, D) {
106
- return a.idx === this.targetOccurrence && this.targetProdType === T ? (this.restDef = E.concat(D), !0) : !1;
98
+ checkIsTarget(e, b, x, S) {
99
+ return e.idx === this.targetOccurrence && this.targetProdType === b ? (this.restDef = x.concat(S), !0) : !1;
107
100
  }
108
- walkOption(a, T, E) {
109
- this.checkIsTarget(a, PROD_TYPE.OPTION, T, E) || super.walkOption(a, T, E);
101
+ walkOption(e, b, x) {
102
+ this.checkIsTarget(e, PROD_TYPE.OPTION, b, x) || super.walkOption(e, b, x);
110
103
  }
111
- walkAtLeastOne(a, T, E) {
112
- this.checkIsTarget(a, PROD_TYPE.REPETITION_MANDATORY, T, E) || super.walkOption(a, T, E);
104
+ walkAtLeastOne(e, b, x) {
105
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY, b, x) || super.walkOption(e, b, x);
113
106
  }
114
- walkAtLeastOneSep(a, T, E) {
115
- this.checkIsTarget(a, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, T, E) || super.walkOption(a, T, E);
107
+ walkAtLeastOneSep(e, b, x) {
108
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
116
109
  }
117
- walkMany(a, T, E) {
118
- this.checkIsTarget(a, PROD_TYPE.REPETITION, T, E) || super.walkOption(a, T, E);
110
+ walkMany(e, b, x) {
111
+ this.checkIsTarget(e, PROD_TYPE.REPETITION, b, x) || super.walkOption(e, b, x);
119
112
  }
120
- walkManySep(a, T, E) {
121
- this.checkIsTarget(a, PROD_TYPE.REPETITION_WITH_SEPARATOR, T, E) || super.walkOption(a, T, E);
113
+ walkManySep(e, b, x) {
114
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR, b, x) || super.walkOption(e, b, x);
122
115
  }
123
116
  }, InsideDefinitionFinderVisitor = class extends GAstVisitor {
124
- constructor(a, T, E) {
125
- super(), this.targetOccurrence = a, this.targetProdType = T, this.targetRef = E, this.result = [];
117
+ constructor(e, b, x) {
118
+ super(), this.targetOccurrence = e, this.targetProdType = b, this.targetRef = x, this.result = [];
126
119
  }
127
- checkIsTarget(a, T) {
128
- a.idx === this.targetOccurrence && this.targetProdType === T && (this.targetRef === void 0 || a === this.targetRef) && (this.result = a.definition);
120
+ checkIsTarget(e, b) {
121
+ e.idx === this.targetOccurrence && this.targetProdType === b && (this.targetRef === void 0 || e === this.targetRef) && (this.result = e.definition);
129
122
  }
130
- visitOption(a) {
131
- this.checkIsTarget(a, PROD_TYPE.OPTION);
123
+ visitOption(e) {
124
+ this.checkIsTarget(e, PROD_TYPE.OPTION);
132
125
  }
133
- visitRepetition(a) {
134
- this.checkIsTarget(a, PROD_TYPE.REPETITION);
126
+ visitRepetition(e) {
127
+ this.checkIsTarget(e, PROD_TYPE.REPETITION);
135
128
  }
136
- visitRepetitionMandatory(a) {
137
- this.checkIsTarget(a, PROD_TYPE.REPETITION_MANDATORY);
129
+ visitRepetitionMandatory(e) {
130
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY);
138
131
  }
139
- visitRepetitionMandatoryWithSeparator(a) {
140
- this.checkIsTarget(a, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR);
132
+ visitRepetitionMandatoryWithSeparator(e) {
133
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR);
141
134
  }
142
- visitRepetitionWithSeparator(a) {
143
- this.checkIsTarget(a, PROD_TYPE.REPETITION_WITH_SEPARATOR);
135
+ visitRepetitionWithSeparator(e) {
136
+ this.checkIsTarget(e, PROD_TYPE.REPETITION_WITH_SEPARATOR);
144
137
  }
145
- visitAlternation(a) {
146
- this.checkIsTarget(a, PROD_TYPE.ALTERNATION);
138
+ visitAlternation(e) {
139
+ this.checkIsTarget(e, PROD_TYPE.ALTERNATION);
147
140
  }
148
141
  };
149
- function initializeArrayOfArrays(a) {
150
- let T = Array(a);
151
- for (let E = 0; E < a; E++) T[E] = [];
152
- return T;
142
+ function initializeArrayOfArrays(e) {
143
+ let b = Array(e);
144
+ for (let x = 0; x < e; x++) b[x] = [];
145
+ return b;
153
146
  }
154
- function pathToHashKeys(a) {
155
- let T = [""];
156
- for (let E = 0; E < a.length; E++) {
157
- let D = a[E], O = [];
158
- for (let a = 0; a < T.length; a++) {
159
- let E = T[a];
160
- O.push(E + "_" + D.tokenTypeIdx);
161
- for (let a = 0; a < D.categoryMatches.length; a++) {
162
- let T = "_" + D.categoryMatches[a];
163
- O.push(E + T);
147
+ function pathToHashKeys(e) {
148
+ let b = [""];
149
+ for (let x = 0; x < e.length; x++) {
150
+ let S = e[x], C = [];
151
+ for (let e = 0; e < b.length; e++) {
152
+ let x = b[e];
153
+ C.push(x + "_" + S.tokenTypeIdx);
154
+ for (let e = 0; e < S.categoryMatches.length; e++) {
155
+ let b = "_" + S.categoryMatches[e];
156
+ C.push(x + b);
164
157
  }
165
158
  }
166
- T = O;
159
+ b = C;
167
160
  }
168
- return T;
161
+ return b;
169
162
  }
170
- function isUniquePrefixHash(a, T, E) {
171
- for (let D = 0; D < a.length; D++) {
172
- if (D === E) continue;
173
- let O = a[D];
174
- for (let a = 0; a < T.length; a++) if (O[T[a]] === !0) return !1;
163
+ function isUniquePrefixHash(e, b, x) {
164
+ for (let S = 0; S < e.length; S++) {
165
+ if (S === x) continue;
166
+ let C = e[S];
167
+ for (let e = 0; e < b.length; e++) if (C[b[e]] === !0) return !1;
175
168
  }
176
169
  return !0;
177
170
  }
178
- function lookAheadSequenceFromAlternatives(T, D) {
179
- let k = map_default(T, (a) => possiblePathsFrom([a], 1)), A = initializeArrayOfArrays(k.length), j = map_default(k, (a) => {
180
- let T = {};
181
- return forEach_default(a, (a) => {
182
- forEach_default(pathToHashKeys(a.partialPath), (a) => {
183
- T[a] = !0;
171
+ function lookAheadSequenceFromAlternatives(e, b) {
172
+ let x = e.map((e) => possiblePathsFrom([e], 1)), S = initializeArrayOfArrays(x.length), C = x.map((e) => {
173
+ let b = {};
174
+ return e.forEach((e) => {
175
+ pathToHashKeys(e.partialPath).forEach((e) => {
176
+ b[e] = !0;
184
177
  });
185
- }), T;
186
- }), M = k;
187
- for (let T = 1; T <= D; T++) {
188
- let O = M;
189
- M = initializeArrayOfArrays(O.length);
190
- for (let k = 0; k < O.length; k++) {
191
- let N = O[k];
192
- for (let O = 0; O < N.length; O++) {
193
- let P = N[O].partialPath, F = N[O].suffixDef, I = pathToHashKeys(P);
194
- if (isUniquePrefixHash(j, I, k) || isEmpty_default(F) || P.length === D) {
195
- let a = A[k];
196
- if (containsPath(a, P) === !1) {
197
- a.push(P);
198
- for (let a = 0; a < I.length; a++) {
199
- let T = I[a];
200
- j[k][T] = !0;
178
+ }), b;
179
+ }), w = x;
180
+ for (let e = 1; e <= b; e++) {
181
+ let x = w;
182
+ w = initializeArrayOfArrays(x.length);
183
+ for (let T = 0; T < x.length; T++) {
184
+ let E = x[T];
185
+ for (let x = 0; x < E.length; x++) {
186
+ let D = E[x].partialPath, O = E[x].suffixDef, k = pathToHashKeys(D);
187
+ if (isUniquePrefixHash(C, k, T) || O.length === 0 || D.length === b) {
188
+ let e = S[T];
189
+ if (containsPath(e, D) === !1) {
190
+ e.push(D);
191
+ for (let e = 0; e < k.length; e++) {
192
+ let b = k[e];
193
+ C[T][b] = !0;
201
194
  }
202
195
  }
203
196
  } else {
204
- let a = possiblePathsFrom(F, T + 1, P);
205
- M[k] = M[k].concat(a), forEach_default(a, (a) => {
206
- forEach_default(pathToHashKeys(a.partialPath), (a) => {
207
- j[k][a] = !0;
197
+ let b = possiblePathsFrom(O, e + 1, D);
198
+ w[T] = w[T].concat(b), b.forEach((e) => {
199
+ pathToHashKeys(e.partialPath).forEach((e) => {
200
+ C[T][e] = !0;
208
201
  });
209
202
  });
210
203
  }
211
204
  }
212
205
  }
213
206
  }
214
- return A;
207
+ return S;
215
208
  }
216
- function getLookaheadPathsForOr(a, T, E, D) {
217
- let O = new InsideDefinitionFinderVisitor(a, PROD_TYPE.ALTERNATION, D);
218
- return T.accept(O), lookAheadSequenceFromAlternatives(O.result, E);
209
+ function getLookaheadPathsForOr(e, b, x, S) {
210
+ let C = new InsideDefinitionFinderVisitor(e, PROD_TYPE.ALTERNATION, S);
211
+ return b.accept(C), lookAheadSequenceFromAlternatives(C.result, x);
219
212
  }
220
- function getLookaheadPathsForOptionalProd(a, T, E, D) {
221
- let O = new InsideDefinitionFinderVisitor(a, E);
222
- T.accept(O);
223
- let k = O.result, A = new RestDefinitionFinderWalker(T, a, E).startWalking();
224
- return lookAheadSequenceFromAlternatives([new Alternative({ definition: k }), new Alternative({ definition: A })], D);
213
+ function getLookaheadPathsForOptionalProd(e, x, S, C) {
214
+ let w = new InsideDefinitionFinderVisitor(e, S);
215
+ x.accept(w);
216
+ let T = w.result, E = new RestDefinitionFinderWalker(x, e, S).startWalking();
217
+ return lookAheadSequenceFromAlternatives([new Alternative({ definition: T }), new Alternative({ definition: E })], C);
225
218
  }
226
- function containsPath(a, T) {
227
- compareOtherPath: for (let E = 0; E < a.length; E++) {
228
- let D = a[E];
229
- if (D.length === T.length) {
230
- for (let a = 0; a < D.length; a++) {
231
- let E = T[a], O = D[a];
232
- if (!(E === O || O.categoryMatchesMap[E.tokenTypeIdx] !== void 0)) continue compareOtherPath;
219
+ function containsPath(e, b) {
220
+ compareOtherPath: for (let x = 0; x < e.length; x++) {
221
+ let S = e[x];
222
+ if (S.length === b.length) {
223
+ for (let e = 0; e < S.length; e++) {
224
+ let x = b[e], C = S[e];
225
+ if (!(x === C || C.categoryMatchesMap[x.tokenTypeIdx] !== void 0)) continue compareOtherPath;
233
226
  }
234
227
  return !0;
235
228
  }
236
229
  }
237
230
  return !1;
238
231
  }
239
- function isStrictPrefixOfPath(a, T) {
240
- return a.length < T.length && every_default(a, (a, E) => {
241
- let D = T[E];
242
- return a === D || D.categoryMatchesMap[a.tokenTypeIdx];
232
+ function isStrictPrefixOfPath(e, b) {
233
+ return e.length < b.length && e.every((e, x) => {
234
+ let S = b[x];
235
+ return e === S || S.categoryMatchesMap[e.tokenTypeIdx];
243
236
  });
244
237
  }
245
- function areTokenCategoriesNotUsed(T) {
246
- return every_default(T, (T) => every_default(T, (T) => every_default(T, (T) => isEmpty_default(T.categoryMatches))));
238
+ function areTokenCategoriesNotUsed(e) {
239
+ return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
247
240
  }
248
241
  export { PROD_TYPE, buildAlternativesLookAheadFunc, buildLookaheadFuncForOptionalProd, buildLookaheadFuncForOr, buildSingleAlternativeLookaheadFunction, containsPath, getLookaheadPaths, getLookaheadPathsForOptionalProd, getLookaheadPathsForOr, getProdType, isStrictPrefixOfPath };
@@ -1,27 +1,25 @@
1
- import forEach_default from "../../../../../lodash-es/forEach.js";
2
- import values_default from "../../../../../lodash-es/values.js";
3
1
  import { GAstVisitor } from "../../../../../@chevrotain/gast/lib/src/visitor.js";
4
2
  import { ParserDefinitionErrorType } from "../parser/parser.js";
5
- function resolveGrammar(e, i) {
6
- let a = new GastRefResolverVisitor(e, i);
7
- return a.resolveRefs(), a.errors;
3
+ function resolveGrammar(e, n) {
4
+ let r = new GastRefResolverVisitor(e, n);
5
+ return r.resolveRefs(), r.errors;
8
6
  }
9
7
  var GastRefResolverVisitor = class extends GAstVisitor {
10
- constructor(e, i) {
11
- super(), this.nameToTopRule = e, this.errMsgProvider = i, this.errors = [];
8
+ constructor(e, n) {
9
+ super(), this.nameToTopRule = e, this.errMsgProvider = n, this.errors = [];
12
10
  }
13
11
  resolveRefs() {
14
- forEach_default(values_default(this.nameToTopRule), (e) => {
12
+ Object.values(this.nameToTopRule).forEach((e) => {
15
13
  this.currTopLevel = e, e.accept(this);
16
14
  });
17
15
  }
18
16
  visitNonTerminal(e) {
19
- let i = this.nameToTopRule[e.nonTerminalName];
20
- if (i) e.referencedRule = i;
17
+ let r = this.nameToTopRule[e.nonTerminalName];
18
+ if (r) e.referencedRule = r;
21
19
  else {
22
- let i = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, e);
20
+ let r = this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel, e);
23
21
  this.errors.push({
24
- message: i,
22
+ message: r,
25
23
  type: ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,
26
24
  ruleName: this.currTopLevel.name,
27
25
  unresolvedRefName: e.nonTerminalName
@@ -1,58 +1,56 @@
1
- import drop_default from "../../../../../lodash-es/drop.js";
2
- import forEach_default from "../../../../../lodash-es/forEach.js";
3
1
  import { Alternation, Alternative, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Terminal } from "../../../../../@chevrotain/gast/lib/src/model.js";
4
2
  var RestWalker = class {
5
- walk(d, f = []) {
6
- forEach_default(d.definition, (o, p) => {
7
- let m = drop_default(d.definition, p + 1);
3
+ walk(l, u = []) {
4
+ l.definition.forEach((d, f) => {
5
+ let p = l.definition.slice(f + 1);
8
6
  /* istanbul ignore else */
9
- if (o instanceof NonTerminal) this.walkProdRef(o, m, f);
10
- else if (o instanceof Terminal) this.walkTerminal(o, m, f);
11
- else if (o instanceof Alternative) this.walkFlat(o, m, f);
12
- else if (o instanceof Option) this.walkOption(o, m, f);
13
- else if (o instanceof RepetitionMandatory) this.walkAtLeastOne(o, m, f);
14
- else if (o instanceof RepetitionMandatoryWithSeparator) this.walkAtLeastOneSep(o, m, f);
15
- else if (o instanceof RepetitionWithSeparator) this.walkManySep(o, m, f);
16
- else if (o instanceof Repetition) this.walkMany(o, m, f);
17
- else if (o instanceof Alternation) this.walkOr(o, m, f);
7
+ if (d instanceof NonTerminal) this.walkProdRef(d, p, u);
8
+ else if (d instanceof Terminal) this.walkTerminal(d, p, u);
9
+ else if (d instanceof Alternative) this.walkFlat(d, p, u);
10
+ else if (d instanceof Option) this.walkOption(d, p, u);
11
+ else if (d instanceof RepetitionMandatory) this.walkAtLeastOne(d, p, u);
12
+ else if (d instanceof RepetitionMandatoryWithSeparator) this.walkAtLeastOneSep(d, p, u);
13
+ else if (d instanceof RepetitionWithSeparator) this.walkManySep(d, p, u);
14
+ else if (d instanceof Repetition) this.walkMany(d, p, u);
15
+ else if (d instanceof Alternation) this.walkOr(d, p, u);
18
16
  else throw Error("non exhaustive match");
19
17
  });
20
18
  }
21
- walkTerminal(e, o, s) {}
22
- walkProdRef(e, o, s) {}
23
- walkFlat(e, o, s) {
24
- let c = o.concat(s);
25
- this.walk(e, c);
19
+ walkTerminal(e, a, o) {}
20
+ walkProdRef(e, a, o) {}
21
+ walkFlat(e, a, o) {
22
+ let s = a.concat(o);
23
+ this.walk(e, s);
26
24
  }
27
- walkOption(e, o, s) {
28
- let c = o.concat(s);
29
- this.walk(e, c);
25
+ walkOption(e, a, o) {
26
+ let s = a.concat(o);
27
+ this.walk(e, s);
30
28
  }
31
- walkAtLeastOne(e, o, s) {
32
- let c = [new Option({ definition: e.definition })].concat(o, s);
29
+ walkAtLeastOne(e, a, o) {
30
+ let c = [new Option({ definition: e.definition })].concat(a, o);
33
31
  this.walk(e, c);
34
32
  }
35
- walkAtLeastOneSep(e, o, s) {
36
- let c = restForRepetitionWithSeparator(e, o, s);
37
- this.walk(e, c);
33
+ walkAtLeastOneSep(e, a, o) {
34
+ let s = restForRepetitionWithSeparator(e, a, o);
35
+ this.walk(e, s);
38
36
  }
39
- walkMany(e, o, s) {
40
- let c = [new Option({ definition: e.definition })].concat(o, s);
37
+ walkMany(e, a, o) {
38
+ let c = [new Option({ definition: e.definition })].concat(a, o);
41
39
  this.walk(e, c);
42
40
  }
43
- walkManySep(e, o, s) {
44
- let c = restForRepetitionWithSeparator(e, o, s);
45
- this.walk(e, c);
41
+ walkManySep(e, a, o) {
42
+ let s = restForRepetitionWithSeparator(e, a, o);
43
+ this.walk(e, s);
46
44
  }
47
- walkOr(e, s, l) {
48
- let u = s.concat(l);
49
- forEach_default(e.definition, (e) => {
45
+ walkOr(e, o, s) {
46
+ let c = o.concat(s);
47
+ e.definition.forEach((e) => {
50
48
  let o = new Alternative({ definition: [e] });
51
- this.walk(o, u);
49
+ this.walk(o, c);
52
50
  });
53
51
  }
54
52
  };
55
- function restForRepetitionWithSeparator(e, o, s) {
56
- return [new Option({ definition: [new Terminal({ terminalType: e.separator })].concat(e.definition) })].concat(o, s);
53
+ function restForRepetitionWithSeparator(e, a, o) {
54
+ return [new Option({ definition: [new Terminal({ terminalType: e.separator })].concat(e.definition) })].concat(a, o);
57
55
  }
58
56
  export { RestWalker };