@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,42 +1,39 @@
1
- import has_default from "../../../../lodash-es/has.js";
2
- import isString_default from "../../../../lodash-es/isString.js";
3
- import isUndefined_default from "../../../../lodash-es/isUndefined.js";
4
1
  import { augmentTokenTypes, tokenStructuredMatcher } from "./tokens.js";
5
2
  import { Lexer } from "./lexer_public.js";
6
3
  function tokenLabel(e) {
7
4
  return hasTokenLabel(e) ? e.LABEL : e.name;
8
5
  }
9
6
  function hasTokenLabel(e) {
10
- return isString_default(e.LABEL) && e.LABEL !== "";
7
+ return typeof e.LABEL == "string" && e.LABEL !== "";
11
8
  }
12
9
  var PARENT = "parent", CATEGORIES = "categories", LABEL = "label", GROUP = "group", PUSH_MODE = "push_mode", POP_MODE = "pop_mode", LONGER_ALT = "longer_alt", LINE_BREAKS = "line_breaks", START_CHARS_HINT = "start_chars_hint";
13
10
  function createToken(e) {
14
11
  return createTokenInternal(e);
15
12
  }
16
- function createTokenInternal(h) {
17
- let v = h.pattern, y = {};
18
- if (y.name = h.name, isUndefined_default(v) || (y.PATTERN = v), has_default(h, PARENT)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
19
- return has_default(h, CATEGORIES) && (y.CATEGORIES = h[CATEGORIES]), augmentTokenTypes([y]), has_default(h, LABEL) && (y.LABEL = h[LABEL]), has_default(h, GROUP) && (y.GROUP = h[GROUP]), has_default(h, POP_MODE) && (y.POP_MODE = h[POP_MODE]), has_default(h, PUSH_MODE) && (y.PUSH_MODE = h[PUSH_MODE]), has_default(h, LONGER_ALT) && (y.LONGER_ALT = h[LONGER_ALT]), has_default(h, LINE_BREAKS) && (y.LINE_BREAKS = h[LINE_BREAKS]), has_default(h, START_CHARS_HINT) && (y.START_CHARS_HINT = h[START_CHARS_HINT]), y;
13
+ function createTokenInternal(f) {
14
+ let p = f.pattern, m = {};
15
+ if (m.name = f.name, p !== void 0 && (m.PATTERN = p), Object.hasOwn(f, PARENT)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
16
+ return Object.hasOwn(f, CATEGORIES) && (m.CATEGORIES = f[CATEGORIES]), augmentTokenTypes([m]), Object.hasOwn(f, LABEL) && (m.LABEL = f[LABEL]), Object.hasOwn(f, GROUP) && (m.GROUP = f[GROUP]), Object.hasOwn(f, POP_MODE) && (m.POP_MODE = f[POP_MODE]), Object.hasOwn(f, PUSH_MODE) && (m.PUSH_MODE = f[PUSH_MODE]), Object.hasOwn(f, LONGER_ALT) && (m.LONGER_ALT = f[LONGER_ALT]), Object.hasOwn(f, LINE_BREAKS) && (m.LINE_BREAKS = f[LINE_BREAKS]), Object.hasOwn(f, START_CHARS_HINT) && (m.START_CHARS_HINT = f[START_CHARS_HINT]), m;
20
17
  }
21
18
  const EOF = createToken({
22
19
  name: "EOF",
23
20
  pattern: Lexer.NA
24
21
  });
25
22
  augmentTokenTypes([EOF]);
26
- function createTokenInstance(e, h, g, _, v, y, b, x) {
23
+ function createTokenInstance(e, f, p, m, h, g, _, v) {
27
24
  return {
28
- image: h,
29
- startOffset: g,
30
- endOffset: _,
31
- startLine: v,
32
- endLine: y,
33
- startColumn: b,
34
- endColumn: x,
25
+ image: f,
26
+ startOffset: p,
27
+ endOffset: m,
28
+ startLine: h,
29
+ endLine: g,
30
+ startColumn: _,
31
+ endColumn: v,
35
32
  tokenTypeIdx: e.tokenTypeIdx,
36
33
  tokenType: e
37
34
  };
38
35
  }
39
- function tokenMatcher(e, h) {
40
- return tokenStructuredMatcher(e, h);
36
+ function tokenMatcher(e, p) {
37
+ return tokenStructuredMatcher(e, p);
41
38
  }
42
39
  export { EOF, createToken, createTokenInstance, hasTokenLabel, tokenLabel, tokenMatcher };
@@ -1,50 +1,50 @@
1
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 map_default from "../../lodash-es/map.js";
5
- import flatMap_default from "../../lodash-es/flatMap.js";
6
- import min_default from "../../lodash-es/min.js";
7
- import reduce_default from "../../lodash-es/reduce.js";
8
- import uniqBy_default from "../../lodash-es/uniqBy.js";
9
2
  import { Alternation, NonTerminal, Option, Repetition, RepetitionMandatory, RepetitionMandatoryWithSeparator, RepetitionWithSeparator, Terminal } from "../../@chevrotain/gast/lib/src/model.js";
10
3
  import { tokenLabel, tokenMatcher } from "../../chevrotain/lib/src/scan/tokens_public.js";
11
4
  import { getLookaheadPaths } from "../../chevrotain/lib/src/parse/grammar/lookahead.js";
12
5
  import { LLkLookaheadStrategy } from "../../chevrotain/lib/src/parse/grammar/llk_lookahead.js";
13
6
  import "../../chevrotain/lib/src/api.js";
7
+ import map_default from "../../lodash-es/map.js";
14
8
  import { ATN_RULE_STOP, AtomTransition, EpsilonTransition, RuleTransition, buildATNKey, createATN } from "./atn.js";
15
9
  import { ATNConfigSet, DFA_ERROR, getATNConfigKey } from "./dfa.js";
16
- function createDFACache(d, B) {
17
- let V = {};
18
- return (H) => {
19
- let U = H.toString(), W = V[U];
20
- return W === void 0 ? (W = {
21
- atnStartState: d,
22
- decision: B,
10
+ import min_default from "../../lodash-es/min.js";
11
+ import flatMap_default from "../../lodash-es/flatMap.js";
12
+ import uniqBy_default from "../../lodash-es/uniqBy.js";
13
+ import flatten_default from "../../lodash-es/flatten.js";
14
+ import forEach_default from "../../lodash-es/forEach.js";
15
+ import reduce_default from "../../lodash-es/reduce.js";
16
+ function createDFACache(h, W) {
17
+ let G = {};
18
+ return (K) => {
19
+ let q = K.toString(), J = G[q];
20
+ return J === void 0 ? (J = {
21
+ atnStartState: h,
22
+ decision: W,
23
23
  states: {}
24
- }, V[U] = W, W) : W;
24
+ }, G[q] = J, J) : J;
25
25
  };
26
26
  }
27
27
  var PredicateSet = class {
28
28
  constructor() {
29
29
  this.predicates = [];
30
30
  }
31
- is(d) {
32
- return d >= this.predicates.length || this.predicates[d];
31
+ is(h) {
32
+ return h >= this.predicates.length || this.predicates[h];
33
33
  }
34
- set(d, B) {
35
- this.predicates[d] = B;
34
+ set(h, W) {
35
+ this.predicates[h] = W;
36
36
  }
37
37
  toString() {
38
- let d = "", B = this.predicates.length;
39
- for (let V = 0; V < B; V++) d += this.predicates[V] === !0 ? "1" : "0";
40
- return d;
38
+ let h = "", W = this.predicates.length;
39
+ for (let G = 0; G < W; G++) h += this.predicates[G] === !0 ? "1" : "0";
40
+ return h;
41
41
  }
42
42
  }, EMPTY_PREDICATES = new PredicateSet(), LLStarLookaheadStrategy = class extends LLkLookaheadStrategy {
43
- constructor(d) {
44
- super(), this.logging = d?.logging ?? ((d) => console.log(d));
43
+ constructor(h) {
44
+ super(), this.logging = h?.logging ?? ((h) => console.log(h));
45
45
  }
46
- initialize(d) {
47
- this.atn = createATN(d.rules), this.dfas = initATNSimulator(this.atn);
46
+ initialize(h) {
47
+ this.atn = createATN(h.rules), this.dfas = initATNSimulator(this.atn);
48
48
  }
49
49
  validateAmbiguousAlternationAlternatives() {
50
50
  return [];
@@ -52,295 +52,295 @@ var PredicateSet = class {
52
52
  validateEmptyOrAlternatives() {
53
53
  return [];
54
54
  }
55
- buildLookaheadForAlternation(d) {
56
- let { prodOccurrence: B, rule: U, hasPredicates: W, dynamicTokensEnabled: K } = d, q = this.dfas, J = this.logging, Y = buildATNKey(U, "Alternation", B), X = this.atn.decisionMap[Y].decision, Z = map_default(getLookaheadPaths({
55
+ buildLookaheadForAlternation(h) {
56
+ let { prodOccurrence: W, rule: G, hasPredicates: K, dynamicTokensEnabled: q } = h, J = this.dfas, Y = this.logging, X = buildATNKey(G, "Alternation", W), Z = this.atn.decisionMap[X].decision, Q = map_default(getLookaheadPaths({
57
57
  maxLookahead: 1,
58
- occurrence: B,
58
+ occurrence: W,
59
59
  prodType: "Alternation",
60
- rule: U
61
- }), (d) => map_default(d, (d) => d[0]));
62
- if (isLL1Sequence(Z, !1) && !K) {
63
- let d = reduce_default(Z, (d, B, H) => (forEach_default(B, (B) => {
64
- B && (d[B.tokenTypeIdx] = H, forEach_default(B.categoryMatches, (B) => {
65
- d[B] = H;
60
+ rule: G
61
+ }), (h) => map_default(h, (h) => h[0]));
62
+ if (isLL1Sequence(Q, !1) && !q) {
63
+ let h = reduce_default(Q, (h, W, G) => (forEach_default(W, (W) => {
64
+ W && (h[W.tokenTypeIdx] = G, forEach_default(W.categoryMatches, (W) => {
65
+ h[W] = G;
66
66
  }));
67
- }), d), {});
68
- return W ? function(B) {
69
- let V = d[this.LA(1).tokenTypeIdx];
70
- if (B !== void 0 && V !== void 0) {
71
- let d = B[V]?.GATE;
72
- if (d !== void 0 && d.call(this) === !1) return;
67
+ }), h), {});
68
+ return K ? function(W) {
69
+ let G = h[this.LA_FAST(1).tokenTypeIdx];
70
+ if (W !== void 0 && G !== void 0) {
71
+ let h = W[G]?.GATE;
72
+ if (h !== void 0 && h.call(this) === !1) return;
73
73
  }
74
- return V;
74
+ return G;
75
75
  } : function() {
76
- return d[this.LA(1).tokenTypeIdx];
76
+ return h[this.LA_FAST(1).tokenTypeIdx];
77
77
  };
78
- } else if (W) return function(d) {
79
- let B = new PredicateSet(), V = d === void 0 ? 0 : d.length;
80
- for (let H = 0; H < V; H++) {
81
- let V = d?.[H].GATE;
82
- B.set(H, V === void 0 || V.call(this));
78
+ } else if (K) return function(h) {
79
+ let W = new PredicateSet(), G = h === void 0 ? 0 : h.length;
80
+ for (let K = 0; K < G; K++) {
81
+ let G = h?.[K].GATE;
82
+ W.set(K, G === void 0 || G.call(this));
83
83
  }
84
- let H = adaptivePredict.call(this, q, X, B, J);
85
- return typeof H == "number" ? H : void 0;
84
+ let K = adaptivePredict.call(this, J, Z, W, Y);
85
+ return typeof K == "number" ? K : void 0;
86
86
  };
87
87
  else return function() {
88
- let d = adaptivePredict.call(this, q, X, EMPTY_PREDICATES, J);
89
- return typeof d == "number" ? d : void 0;
88
+ let h = adaptivePredict.call(this, J, Z, EMPTY_PREDICATES, Y);
89
+ return typeof h == "number" ? h : void 0;
90
90
  };
91
91
  }
92
- buildLookaheadForOptional(U) {
93
- let { prodOccurrence: W, rule: K, prodType: q, dynamicTokensEnabled: J } = U, Y = this.dfas, X = this.logging, Z = buildATNKey(K, q, W), Q = this.atn.decisionMap[Z].decision, $ = map_default(getLookaheadPaths({
92
+ buildLookaheadForOptional(W) {
93
+ let { prodOccurrence: G, rule: K, prodType: q, dynamicTokensEnabled: J } = W, Y = this.dfas, X = this.logging, Z = buildATNKey(K, q, G), Q = this.atn.decisionMap[Z].decision, $ = map_default(getLookaheadPaths({
94
94
  maxLookahead: 1,
95
- occurrence: W,
95
+ occurrence: G,
96
96
  prodType: q,
97
97
  rule: K
98
- }), (d) => map_default(d, (d) => d[0]));
98
+ }), (h) => map_default(h, (h) => h[0]));
99
99
  if (isLL1Sequence($) && $[0][0] && !J) {
100
- let H = $[0], U = flatten_default(H);
101
- if (U.length === 1 && isEmpty_default(U[0].categoryMatches)) {
102
- let d = U[0].tokenTypeIdx;
100
+ let W = $[0], G = flatten_default(W);
101
+ if (G.length === 1 && isEmpty_default(G[0].categoryMatches)) {
102
+ let h = G[0].tokenTypeIdx;
103
103
  return function() {
104
- return this.LA(1).tokenTypeIdx === d;
104
+ return this.LA_FAST(1).tokenTypeIdx === h;
105
105
  };
106
106
  } else {
107
- let d = reduce_default(U, (d, B) => (B !== void 0 && (d[B.tokenTypeIdx] = !0, forEach_default(B.categoryMatches, (B) => {
108
- d[B] = !0;
109
- })), d), {});
107
+ let h = reduce_default(G, (h, W) => (W !== void 0 && (h[W.tokenTypeIdx] = !0, forEach_default(W.categoryMatches, (W) => {
108
+ h[W] = !0;
109
+ })), h), {});
110
110
  return function() {
111
- return d[this.LA(1).tokenTypeIdx] === !0;
111
+ return h[this.LA_FAST(1).tokenTypeIdx] === !0;
112
112
  };
113
113
  }
114
114
  }
115
115
  return function() {
116
- let d = adaptivePredict.call(this, Y, Q, EMPTY_PREDICATES, X);
117
- return typeof d == "object" ? !1 : d === 0;
116
+ let h = adaptivePredict.call(this, Y, Q, EMPTY_PREDICATES, X);
117
+ return typeof h == "object" ? !1 : h === 0;
118
118
  };
119
119
  }
120
120
  };
121
- function isLL1Sequence(d, B = !0) {
122
- let V = /* @__PURE__ */ new Set();
123
- for (let H of d) {
124
- let d = /* @__PURE__ */ new Set();
125
- for (let U of H) {
126
- if (U === void 0) {
127
- if (B) break;
121
+ function isLL1Sequence(h, W = !0) {
122
+ let G = /* @__PURE__ */ new Set();
123
+ for (let K of h) {
124
+ let h = /* @__PURE__ */ new Set();
125
+ for (let q of K) {
126
+ if (q === void 0) {
127
+ if (W) break;
128
128
  return !1;
129
129
  }
130
- let H = [U.tokenTypeIdx].concat(U.categoryMatches);
131
- for (let B of H) if (V.has(B)) {
132
- if (!d.has(B)) return !1;
133
- } else V.add(B), d.add(B);
130
+ let K = [q.tokenTypeIdx].concat(q.categoryMatches);
131
+ for (let W of K) if (G.has(W)) {
132
+ if (!h.has(W)) return !1;
133
+ } else G.add(W), h.add(W);
134
134
  }
135
135
  }
136
136
  return !0;
137
137
  }
138
- function initATNSimulator(d) {
139
- let B = d.decisionStates.length, V = Array(B);
140
- for (let H = 0; H < B; H++) V[H] = createDFACache(d.decisionStates[H], H);
141
- return V;
138
+ function initATNSimulator(h) {
139
+ let W = h.decisionStates.length, G = Array(W);
140
+ for (let K = 0; K < W; K++) G[K] = createDFACache(h.decisionStates[K], K);
141
+ return G;
142
142
  }
143
- function adaptivePredict(d, B, V, H) {
144
- let U = d[B](V), W = U.start;
145
- return W === void 0 && (W = addDFAState(U, newDFAState(computeStartState(U.atnStartState))), U.start = W), performLookahead.apply(this, [
146
- U,
147
- W,
148
- V,
149
- H
143
+ function adaptivePredict(h, W, G, K) {
144
+ let q = h[W](G), J = q.start;
145
+ return J === void 0 && (J = addDFAState(q, newDFAState(computeStartState(q.atnStartState))), q.start = J), performLookahead.apply(this, [
146
+ q,
147
+ J,
148
+ G,
149
+ K
150
150
  ]);
151
151
  }
152
- function performLookahead(d, B, V, H) {
153
- let U = B, W = 1, G = [], K = this.LA(W++);
152
+ function performLookahead(h, W, G, K) {
153
+ let q = W, J = 1, Y = [], X = this.LA_FAST(J++);
154
154
  for (;;) {
155
- let B = getExistingTargetState(U, K);
156
- if (B === void 0 && (B = computeLookaheadTarget.apply(this, [
157
- d,
158
- U,
159
- K,
160
- W,
161
- V,
162
- H
163
- ])), B === DFA_ERROR) return buildAdaptivePredictError(G, U, K);
164
- if (B.isAcceptState === !0) return B.prediction;
165
- U = B, G.push(K), K = this.LA(W++);
155
+ let W = getExistingTargetState(q, X);
156
+ if (W === void 0 && (W = computeLookaheadTarget.apply(this, [
157
+ h,
158
+ q,
159
+ X,
160
+ J,
161
+ G,
162
+ K
163
+ ])), W === DFA_ERROR) return buildAdaptivePredictError(Y, q, X);
164
+ if (W.isAcceptState === !0) return W.prediction;
165
+ q = W, Y.push(X), X = this.LA(J++);
166
166
  }
167
167
  }
168
- function computeLookaheadTarget(d, B, V, H, U, G) {
169
- let K = computeReachSet(B.configs, V, U);
170
- if (K.size === 0) return addDFAEdge(d, B, V, DFA_ERROR), DFA_ERROR;
171
- let q = newDFAState(K), J = getUniqueAlt(K, U);
172
- if (J !== void 0) q.isAcceptState = !0, q.prediction = J, q.configs.uniqueAlt = J;
173
- else if (hasConflictTerminatingPrediction(K)) {
174
- let B = min_default(K.alts);
175
- q.isAcceptState = !0, q.prediction = B, q.configs.uniqueAlt = B, reportLookaheadAmbiguity.apply(this, [
176
- d,
177
- H,
178
- K.alts,
179
- G
168
+ function computeLookaheadTarget(h, W, G, K, q, J) {
169
+ let Y = computeReachSet(W.configs, G, q);
170
+ if (Y.size === 0) return addDFAEdge(h, W, G, DFA_ERROR), DFA_ERROR;
171
+ let X = newDFAState(Y), Z = getUniqueAlt(Y, q);
172
+ if (Z !== void 0) X.isAcceptState = !0, X.prediction = Z, X.configs.uniqueAlt = Z;
173
+ else if (hasConflictTerminatingPrediction(Y)) {
174
+ let W = min_default(Y.alts);
175
+ X.isAcceptState = !0, X.prediction = W, X.configs.uniqueAlt = W, reportLookaheadAmbiguity.apply(this, [
176
+ h,
177
+ K,
178
+ Y.alts,
179
+ J
180
180
  ]);
181
181
  }
182
- return q = addDFAEdge(d, B, V, q), q;
182
+ return X = addDFAEdge(h, W, G, X), X;
183
183
  }
184
- function reportLookaheadAmbiguity(d, B, V, H) {
185
- let U = [];
186
- for (let d = 1; d <= B; d++) U.push(this.LA(d).tokenType);
187
- let W = d.atnStartState, G = W.rule, K = W.production;
188
- H(buildAmbiguityError({
189
- topLevelRule: G,
190
- ambiguityIndices: V,
191
- production: K,
192
- prefixPath: U
184
+ function reportLookaheadAmbiguity(h, W, G, K) {
185
+ let q = [];
186
+ for (let h = 1; h <= W; h++) q.push(this.LA(h).tokenType);
187
+ let J = h.atnStartState, Y = J.rule, X = J.production;
188
+ K(buildAmbiguityError({
189
+ topLevelRule: Y,
190
+ ambiguityIndices: G,
191
+ production: X,
192
+ prefixPath: q
193
193
  }));
194
194
  }
195
- function buildAmbiguityError(d) {
196
- let B = map_default(d.prefixPath, (d) => tokenLabel(d)).join(", "), V = d.production.idx === 0 ? "" : d.production.idx, U = `Ambiguous Alternatives Detected: <${d.ambiguityIndices.join(", ")}> in <${getProductionDslName(d.production)}${V}> inside <${d.topLevelRule.name}> Rule,\n<${B}> may appears as a prefix path in all these alternatives.\n`;
197
- return U += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", U;
195
+ function buildAmbiguityError(h) {
196
+ let W = map_default(h.prefixPath, (h) => tokenLabel(h)).join(", "), G = h.production.idx === 0 ? "" : h.production.idx, K = `Ambiguous Alternatives Detected: <${h.ambiguityIndices.join(", ")}> in <${getProductionDslName(h.production)}${G}> inside <${h.topLevelRule.name}> Rule,\n<${W}> may appears as a prefix path in all these alternatives.\n`;
197
+ return K += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", K;
198
198
  }
199
- function getProductionDslName(d) {
200
- if (d instanceof NonTerminal) return "SUBRULE";
201
- if (d instanceof Option) return "OPTION";
202
- if (d instanceof Alternation) return "OR";
203
- if (d instanceof RepetitionMandatory) return "AT_LEAST_ONE";
204
- if (d instanceof RepetitionMandatoryWithSeparator) return "AT_LEAST_ONE_SEP";
205
- if (d instanceof RepetitionWithSeparator) return "MANY_SEP";
206
- if (d instanceof Repetition) return "MANY";
207
- if (d instanceof Terminal) return "CONSUME";
199
+ function getProductionDslName(h) {
200
+ if (h instanceof NonTerminal) return "SUBRULE";
201
+ if (h instanceof Option) return "OPTION";
202
+ if (h instanceof Alternation) return "OR";
203
+ if (h instanceof RepetitionMandatory) return "AT_LEAST_ONE";
204
+ if (h instanceof RepetitionMandatoryWithSeparator) return "AT_LEAST_ONE_SEP";
205
+ if (h instanceof RepetitionWithSeparator) return "MANY_SEP";
206
+ if (h instanceof Repetition) return "MANY";
207
+ if (h instanceof Terminal) return "CONSUME";
208
208
  throw Error("non exhaustive match");
209
209
  }
210
- function buildAdaptivePredictError(d, B, V) {
210
+ function buildAdaptivePredictError(h, W, G) {
211
211
  return {
212
- actualToken: V,
213
- possibleTokenTypes: uniqBy_default(flatMap_default(B.configs.elements, (d) => d.state.transitions).filter((d) => d instanceof AtomTransition).map((d) => d.tokenType), (d) => d.tokenTypeIdx),
214
- tokenPath: d
212
+ actualToken: G,
213
+ possibleTokenTypes: uniqBy_default(flatMap_default(W.configs.elements, (h) => h.state.transitions).filter((h) => h instanceof AtomTransition).map((h) => h.tokenType), (h) => h.tokenTypeIdx),
214
+ tokenPath: h
215
215
  };
216
216
  }
217
- function getExistingTargetState(d, B) {
218
- return d.edges[B.tokenTypeIdx];
217
+ function getExistingTargetState(h, W) {
218
+ return h.edges[W.tokenTypeIdx];
219
219
  }
220
- function computeReachSet(d, B, V) {
221
- let H = new ATNConfigSet(), U = [];
222
- for (let W of d.elements) {
223
- if (V.is(W.alt) === !1) continue;
224
- if (W.state.type === 7) {
225
- U.push(W);
220
+ function computeReachSet(h, W, G) {
221
+ let K = new ATNConfigSet(), q = [];
222
+ for (let J of h.elements) {
223
+ if (G.is(J.alt) === !1) continue;
224
+ if (J.state.type === 7) {
225
+ q.push(J);
226
226
  continue;
227
227
  }
228
- let d = W.state.transitions.length;
229
- for (let V = 0; V < d; V++) {
230
- let d = W.state.transitions[V], U = getReachableTarget(d, B);
231
- U !== void 0 && H.add({
232
- state: U,
233
- alt: W.alt,
234
- stack: W.stack
228
+ let h = J.state.transitions.length;
229
+ for (let G = 0; G < h; G++) {
230
+ let h = J.state.transitions[G], q = getReachableTarget(h, W);
231
+ q !== void 0 && K.add({
232
+ state: q,
233
+ alt: J.alt,
234
+ stack: J.stack
235
235
  });
236
236
  }
237
237
  }
238
- let W;
239
- if (U.length === 0 && H.size === 1 && (W = H), W === void 0) {
240
- W = new ATNConfigSet();
241
- for (let d of H.elements) closure(d, W);
238
+ let J;
239
+ if (q.length === 0 && K.size === 1 && (J = K), J === void 0) {
240
+ J = new ATNConfigSet();
241
+ for (let h of K.elements) closure(h, J);
242
242
  }
243
- if (U.length > 0 && !hasConfigInRuleStopState(W)) for (let d of U) W.add(d);
244
- return W;
243
+ if (q.length > 0 && !hasConfigInRuleStopState(J)) for (let h of q) J.add(h);
244
+ return J;
245
245
  }
246
- function getReachableTarget(d, B) {
247
- if (d instanceof AtomTransition && tokenMatcher(B, d.tokenType)) return d.target;
246
+ function getReachableTarget(h, W) {
247
+ if (h instanceof AtomTransition && tokenMatcher(W, h.tokenType)) return h.target;
248
248
  }
249
- function getUniqueAlt(d, B) {
250
- let V;
251
- for (let H of d.elements) if (B.is(H.alt) === !0) {
252
- if (V === void 0) V = H.alt;
253
- else if (V !== H.alt) return;
249
+ function getUniqueAlt(h, W) {
250
+ let G;
251
+ for (let K of h.elements) if (W.is(K.alt) === !0) {
252
+ if (G === void 0) G = K.alt;
253
+ else if (G !== K.alt) return;
254
254
  }
255
- return V;
255
+ return G;
256
256
  }
257
- function newDFAState(d) {
257
+ function newDFAState(h) {
258
258
  return {
259
- configs: d,
259
+ configs: h,
260
260
  edges: {},
261
261
  isAcceptState: !1,
262
262
  prediction: -1
263
263
  };
264
264
  }
265
- function addDFAEdge(d, B, V, H) {
266
- return H = addDFAState(d, H), B.edges[V.tokenTypeIdx] = H, H;
265
+ function addDFAEdge(h, W, G, K) {
266
+ return K = addDFAState(h, K), W.edges[G.tokenTypeIdx] = K, K;
267
267
  }
268
- function addDFAState(d, B) {
269
- if (B === DFA_ERROR) return B;
270
- let V = B.configs.key, H = d.states[V];
271
- return H === void 0 ? (B.configs.finalize(), d.states[V] = B, B) : H;
268
+ function addDFAState(h, W) {
269
+ if (W === DFA_ERROR) return W;
270
+ let G = W.configs.key, K = h.states[G];
271
+ return K === void 0 ? (W.configs.finalize(), h.states[G] = W, W) : K;
272
272
  }
273
- function computeStartState(d) {
274
- let B = new ATNConfigSet(), V = d.transitions.length;
275
- for (let H = 0; H < V; H++) closure({
276
- state: d.transitions[H].target,
277
- alt: H,
273
+ function computeStartState(h) {
274
+ let W = new ATNConfigSet(), G = h.transitions.length;
275
+ for (let K = 0; K < G; K++) closure({
276
+ state: h.transitions[K].target,
277
+ alt: K,
278
278
  stack: []
279
- }, B);
280
- return B;
279
+ }, W);
280
+ return W;
281
281
  }
282
- function closure(d, B) {
283
- let V = d.state;
284
- if (V.type === 7) {
285
- if (d.stack.length > 0) {
286
- let V = [...d.stack];
282
+ function closure(h, W) {
283
+ let G = h.state;
284
+ if (G.type === 7) {
285
+ if (h.stack.length > 0) {
286
+ let G = [...h.stack];
287
287
  closure({
288
- state: V.pop(),
289
- alt: d.alt,
290
- stack: V
291
- }, B);
292
- } else B.add(d);
288
+ state: G.pop(),
289
+ alt: h.alt,
290
+ stack: G
291
+ }, W);
292
+ } else W.add(h);
293
293
  return;
294
294
  }
295
- V.epsilonOnlyTransitions || B.add(d);
296
- let H = V.transitions.length;
297
- for (let U = 0; U < H; U++) {
298
- let H = V.transitions[U], W = getEpsilonTarget(d, H);
299
- W !== void 0 && closure(W, B);
295
+ G.epsilonOnlyTransitions || W.add(h);
296
+ let K = G.transitions.length;
297
+ for (let q = 0; q < K; q++) {
298
+ let K = G.transitions[q], J = getEpsilonTarget(h, K);
299
+ J !== void 0 && closure(J, W);
300
300
  }
301
301
  }
302
- function getEpsilonTarget(d, B) {
303
- if (B instanceof EpsilonTransition) return {
304
- state: B.target,
305
- alt: d.alt,
306
- stack: d.stack
302
+ function getEpsilonTarget(h, W) {
303
+ if (W instanceof EpsilonTransition) return {
304
+ state: W.target,
305
+ alt: h.alt,
306
+ stack: h.stack
307
307
  };
308
- if (B instanceof RuleTransition) {
309
- let V = [...d.stack, B.followState];
308
+ if (W instanceof RuleTransition) {
309
+ let G = [...h.stack, W.followState];
310
310
  return {
311
- state: B.target,
312
- alt: d.alt,
313
- stack: V
311
+ state: W.target,
312
+ alt: h.alt,
313
+ stack: G
314
314
  };
315
315
  }
316
316
  }
317
- function hasConfigInRuleStopState(d) {
318
- for (let B of d.elements) if (B.state.type === 7) return !0;
317
+ function hasConfigInRuleStopState(h) {
318
+ for (let W of h.elements) if (W.state.type === 7) return !0;
319
319
  return !1;
320
320
  }
321
- function allConfigsInRuleStopStates(d) {
322
- for (let B of d.elements) if (B.state.type !== 7) return !1;
321
+ function allConfigsInRuleStopStates(h) {
322
+ for (let W of h.elements) if (W.state.type !== 7) return !1;
323
323
  return !0;
324
324
  }
325
- function hasConflictTerminatingPrediction(d) {
326
- if (allConfigsInRuleStopStates(d)) return !0;
327
- let B = getConflictingAltSets(d.elements);
328
- return hasConflictingAltSet(B) && !hasStateAssociatedWithOneAlt(B);
325
+ function hasConflictTerminatingPrediction(h) {
326
+ if (allConfigsInRuleStopStates(h)) return !0;
327
+ let W = getConflictingAltSets(h.elements);
328
+ return hasConflictingAltSet(W) && !hasStateAssociatedWithOneAlt(W);
329
329
  }
330
- function getConflictingAltSets(d) {
331
- let B = /* @__PURE__ */ new Map();
332
- for (let V of d) {
333
- let d = getATNConfigKey(V, !1), H = B.get(d);
334
- H === void 0 && (H = {}, B.set(d, H)), H[V.alt] = !0;
330
+ function getConflictingAltSets(h) {
331
+ let W = /* @__PURE__ */ new Map();
332
+ for (let G of h) {
333
+ let h = getATNConfigKey(G, !1), K = W.get(h);
334
+ K === void 0 && (K = {}, W.set(h, K)), K[G.alt] = !0;
335
335
  }
336
- return B;
336
+ return W;
337
337
  }
338
- function hasConflictingAltSet(d) {
339
- for (let B of Array.from(d.values())) if (Object.keys(B).length > 1) return !0;
338
+ function hasConflictingAltSet(h) {
339
+ for (let W of Array.from(h.values())) if (Object.keys(W).length > 1) return !0;
340
340
  return !1;
341
341
  }
342
- function hasStateAssociatedWithOneAlt(d) {
343
- for (let B of Array.from(d.values())) if (Object.keys(B).length === 1) return !0;
342
+ function hasStateAssociatedWithOneAlt(h) {
343
+ for (let W of Array.from(h.values())) if (Object.keys(W).length === 1) return !0;
344
344
  return !1;
345
345
  }
346
346
  export { LLStarLookaheadStrategy };