@milkdown/crepe 7.3.6 → 7.5.0

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 (991) hide show
  1. package/lib/cjs/_view-N32ied53.js +27 -0
  2. package/lib/cjs/_view-N32ied53.js.map +1 -0
  3. package/lib/cjs/apl-99bWvYTf.js +145 -0
  4. package/lib/cjs/apl-99bWvYTf.js.map +1 -0
  5. package/lib/cjs/asciiarmor-cf0JLIr_.js +59 -0
  6. package/lib/cjs/asciiarmor-cf0JLIr_.js.map +1 -0
  7. package/lib/cjs/asn1-H4XzAvBS.js +195 -0
  8. package/lib/cjs/asn1-H4XzAvBS.js.map +1 -0
  9. package/lib/cjs/asterisk-0FgJEfZB.js +190 -0
  10. package/lib/cjs/asterisk-0FgJEfZB.js.map +1 -0
  11. package/lib/cjs/brainfuck-JX7vRZy7.js +73 -0
  12. package/lib/cjs/brainfuck-JX7vRZy7.js.map +1 -0
  13. package/lib/cjs/clike-ueXlMQy5.js +1034 -0
  14. package/lib/cjs/clike-ueXlMQy5.js.map +1 -0
  15. package/lib/cjs/clojure-6iDAG5oi.js +277 -0
  16. package/lib/cjs/clojure-6iDAG5oi.js.map +1 -0
  17. package/lib/cjs/clsx-dASsG01A.js +6 -0
  18. package/lib/cjs/clsx-dASsG01A.js.map +1 -0
  19. package/lib/cjs/cmake-L0RIBnfc.js +84 -0
  20. package/lib/cjs/cmake-L0RIBnfc.js.map +1 -0
  21. package/lib/cjs/cobol-oxkMh1GJ.js +238 -0
  22. package/lib/cjs/cobol-oxkMh1GJ.js.map +1 -0
  23. package/lib/cjs/coffeescript--eauIeRQ.js +332 -0
  24. package/lib/cjs/coffeescript--eauIeRQ.js.map +1 -0
  25. package/lib/cjs/commonlisp-pgSu-q6f.js +111 -0
  26. package/lib/cjs/commonlisp-pgSu-q6f.js.map +1 -0
  27. package/lib/cjs/crystal-2y3I5ibZ.js +422 -0
  28. package/lib/cjs/crystal-2y3I5ibZ.js.map +1 -0
  29. package/lib/cjs/css-WH69cXzo.js +855 -0
  30. package/lib/cjs/css-WH69cXzo.js.map +1 -0
  31. package/lib/cjs/cypher-da-dqVyQ.js +125 -0
  32. package/lib/cjs/cypher-da-dqVyQ.js.map +1 -0
  33. package/lib/cjs/d-58J7EOkP.js +208 -0
  34. package/lib/cjs/d-58J7EOkP.js.map +1 -0
  35. package/lib/cjs/diff-437Hfzqm.js +33 -0
  36. package/lib/cjs/diff-437Hfzqm.js.map +1 -0
  37. package/lib/cjs/dockerfile-7i0OoaQe.js +202 -0
  38. package/lib/cjs/dockerfile-7i0OoaQe.js.map +1 -0
  39. package/lib/cjs/dtd-AKekCPPB.js +124 -0
  40. package/lib/cjs/dtd-AKekCPPB.js.map +1 -0
  41. package/lib/cjs/dylan-DLEmvz1I.js +340 -0
  42. package/lib/cjs/dylan-DLEmvz1I.js.map +1 -0
  43. package/lib/cjs/ebnf-36cJWqxB.js +154 -0
  44. package/lib/cjs/ebnf-36cJWqxB.js.map +1 -0
  45. package/lib/cjs/ecl-UWr5vJKJ.js +193 -0
  46. package/lib/cjs/ecl-UWr5vJKJ.js.map +1 -0
  47. package/lib/cjs/eiffel-Su-C9LAY.js +149 -0
  48. package/lib/cjs/eiffel-Su-C9LAY.js.map +1 -0
  49. package/lib/cjs/elm-vNNfVJj7.js +233 -0
  50. package/lib/cjs/elm-vNNfVJj7.js.map +1 -0
  51. package/lib/cjs/erlang-NM9dgYaS.js +584 -0
  52. package/lib/cjs/erlang-NM9dgYaS.js.map +1 -0
  53. package/lib/cjs/factor-RWs-4aWg.js +68 -0
  54. package/lib/cjs/factor-RWs-4aWg.js.map +1 -0
  55. package/lib/cjs/fcl-acUhGCfs.js +157 -0
  56. package/lib/cjs/fcl-acUhGCfs.js.map +1 -0
  57. package/lib/cjs/floating-ui.dom-2cjBpir5.js +1134 -0
  58. package/lib/cjs/floating-ui.dom-2cjBpir5.js.map +1 -0
  59. package/lib/cjs/forth-sDkE6z3A.js +167 -0
  60. package/lib/cjs/forth-sDkE6z3A.js.map +1 -0
  61. package/lib/cjs/fortran-gkb4yvdk.js +175 -0
  62. package/lib/cjs/fortran-gkb4yvdk.js.map +1 -0
  63. package/lib/cjs/gas-mNA0qvkv.js +347 -0
  64. package/lib/cjs/gas-mNA0qvkv.js.map +1 -0
  65. package/lib/cjs/gherkin-5uyKpXXh.js +150 -0
  66. package/lib/cjs/gherkin-5uyKpXXh.js.map +1 -0
  67. package/lib/cjs/go-5XitXoIZ.js +167 -0
  68. package/lib/cjs/go-5XitXoIZ.js.map +1 -0
  69. package/lib/cjs/groovy-mz3pWMKN.js +233 -0
  70. package/lib/cjs/groovy-mz3pWMKN.js.map +1 -0
  71. package/lib/cjs/haskell-9KaSS7kb.js +242 -0
  72. package/lib/cjs/haskell-9KaSS7kb.js.map +1 -0
  73. package/lib/cjs/haxe-L8h6Pvni.js +494 -0
  74. package/lib/cjs/haxe-L8h6Pvni.js.map +1 -0
  75. package/lib/cjs/helper-1aludV1Z.js +15 -0
  76. package/lib/cjs/helper-1aludV1Z.js.map +1 -0
  77. package/lib/cjs/http-BFQQnRR-.js +92 -0
  78. package/lib/cjs/http-BFQQnRR-.js.map +1 -0
  79. package/lib/cjs/idl-29T-AzAy.js +277 -0
  80. package/lib/cjs/idl-29T-AzAy.js.map +1 -0
  81. package/lib/cjs/index--sa4NMpW.js +119 -0
  82. package/lib/cjs/index--sa4NMpW.js.map +1 -0
  83. package/lib/cjs/index--tnUmqZ_.js +108 -0
  84. package/lib/cjs/index--tnUmqZ_.js.map +1 -0
  85. package/lib/cjs/index-1vHyMXH8.js +203 -0
  86. package/lib/cjs/index-1vHyMXH8.js.map +1 -0
  87. package/lib/cjs/index-28q261C7.js +448 -0
  88. package/lib/cjs/index-28q261C7.js.map +1 -0
  89. package/lib/cjs/index-55VIM-52.js +156 -0
  90. package/lib/cjs/index-55VIM-52.js.map +1 -0
  91. package/lib/cjs/index-92bwto5V.js +405 -0
  92. package/lib/cjs/index-92bwto5V.js.map +1 -0
  93. package/lib/cjs/index-Buu2tD9O.js +534 -0
  94. package/lib/cjs/index-Buu2tD9O.js.map +1 -0
  95. package/lib/cjs/index-E4Ist86Z.js +532 -0
  96. package/lib/cjs/index-E4Ist86Z.js.map +1 -0
  97. package/lib/cjs/index-FbNqlZU8.js +263 -0
  98. package/lib/cjs/index-FbNqlZU8.js.map +1 -0
  99. package/lib/cjs/index-HH5lPgpj.js +443 -0
  100. package/lib/cjs/index-HH5lPgpj.js.map +1 -0
  101. package/lib/cjs/index-J1-yHn7v.js +128 -0
  102. package/lib/cjs/index-J1-yHn7v.js.map +1 -0
  103. package/lib/cjs/index-J3XY9IPt.js +78 -0
  104. package/lib/cjs/index-J3XY9IPt.js.map +1 -0
  105. package/lib/cjs/index-Jztk6JlP.js +25698 -0
  106. package/lib/cjs/index-Jztk6JlP.js.map +1 -0
  107. package/lib/cjs/index-N6pPZY61.js +191 -0
  108. package/lib/cjs/index-N6pPZY61.js.map +1 -0
  109. package/lib/cjs/index-TUJs6KKL.js +472 -0
  110. package/lib/cjs/index-TUJs6KKL.js.map +1 -0
  111. package/lib/cjs/index-Tjg8KyK7.js +398 -0
  112. package/lib/cjs/index-Tjg8KyK7.js.map +1 -0
  113. package/lib/cjs/index-VYwHTL3F.js +161 -0
  114. package/lib/cjs/index-VYwHTL3F.js.map +1 -0
  115. package/lib/cjs/index-_GOdKqUK.js +1147 -0
  116. package/lib/cjs/index-_GOdKqUK.js.map +1 -0
  117. package/lib/cjs/index-cKQcw-eu.js +386 -0
  118. package/lib/cjs/index-cKQcw-eu.js.map +1 -0
  119. package/lib/cjs/index-c_OzudR7.js +699 -0
  120. package/lib/cjs/index-c_OzudR7.js.map +1 -0
  121. package/lib/cjs/index-cb-5m0vG.js +2519 -0
  122. package/lib/cjs/index-cb-5m0vG.js.map +1 -0
  123. package/lib/cjs/index-cpC-j5Nt.js +176 -0
  124. package/lib/cjs/index-cpC-j5Nt.js.map +1 -0
  125. package/lib/cjs/index-crv_k6dv.js +1353 -0
  126. package/lib/cjs/index-crv_k6dv.js.map +1 -0
  127. package/lib/cjs/index-jlfsu92T.js +362 -0
  128. package/lib/cjs/index-jlfsu92T.js.map +1 -0
  129. package/lib/cjs/index-jn036wuh.js +1045 -0
  130. package/lib/cjs/index-jn036wuh.js.map +1 -0
  131. package/lib/cjs/index-kqz-P6o6.js +55 -0
  132. package/lib/cjs/index-kqz-P6o6.js.map +1 -0
  133. package/lib/cjs/index-lBumFRUQ.js +209 -0
  134. package/lib/cjs/index-lBumFRUQ.js.map +1 -0
  135. package/lib/cjs/index-lUNj3xuC.js +81 -0
  136. package/lib/cjs/index-lUNj3xuC.js.map +1 -0
  137. package/lib/cjs/index-mcxgNBq9.js +464 -0
  138. package/lib/cjs/index-mcxgNBq9.js.map +1 -0
  139. package/lib/cjs/index-nTfDKYYi.js +1029 -0
  140. package/lib/cjs/index-nTfDKYYi.js.map +1 -0
  141. package/lib/cjs/index-tBw4NmwY.js +33852 -0
  142. package/lib/cjs/index-tBw4NmwY.js.map +1 -0
  143. package/lib/cjs/index-vfzLCXfi.js +774 -0
  144. package/lib/cjs/index-vfzLCXfi.js.map +1 -0
  145. package/lib/cjs/index-von4W2LG.js +356 -0
  146. package/lib/cjs/index-von4W2LG.js.map +1 -0
  147. package/lib/cjs/index-z6pe2alg.js +20 -0
  148. package/lib/cjs/index-z6pe2alg.js.map +1 -0
  149. package/lib/cjs/index-zXSAHvAj.js +1877 -0
  150. package/lib/cjs/index-zXSAHvAj.js.map +1 -0
  151. package/lib/cjs/index.js +20 -0
  152. package/lib/cjs/index.js.map +1 -0
  153. package/lib/cjs/javascript-5-BTydbD.js +928 -0
  154. package/lib/cjs/javascript-5-BTydbD.js.map +1 -0
  155. package/lib/cjs/jinja2-BWMz4gPk.js +174 -0
  156. package/lib/cjs/jinja2-BWMz4gPk.js.map +1 -0
  157. package/lib/cjs/julia-dtR9J3KZ.js +372 -0
  158. package/lib/cjs/julia-dtR9J3KZ.js.map +1 -0
  159. package/lib/cjs/livescript-YxT0INe3.js +262 -0
  160. package/lib/cjs/livescript-YxT0INe3.js.map +1 -0
  161. package/lib/cjs/lua-h7_AXjy9.js +140 -0
  162. package/lib/cjs/lua-h7_AXjy9.js.map +1 -0
  163. package/lib/cjs/mathematica-Zc57fOr3.js +156 -0
  164. package/lib/cjs/mathematica-Zc57fOr3.js.map +1 -0
  165. package/lib/cjs/mbox-ltKsKgJd.js +117 -0
  166. package/lib/cjs/mbox-ltKsKgJd.js.map +1 -0
  167. package/lib/cjs/mirc-xTLeWqmy.js +179 -0
  168. package/lib/cjs/mirc-xTLeWqmy.js.map +1 -0
  169. package/lib/cjs/mllike-xukl-Kjp.js +351 -0
  170. package/lib/cjs/mllike-xukl-Kjp.js.map +1 -0
  171. package/lib/cjs/modelica-LsXtAawk.js +195 -0
  172. package/lib/cjs/modelica-LsXtAawk.js.map +1 -0
  173. package/lib/cjs/mscgen-9HooYIVW.js +154 -0
  174. package/lib/cjs/mscgen-9HooYIVW.js.map +1 -0
  175. package/lib/cjs/mumps-VXqGp84f.js +132 -0
  176. package/lib/cjs/mumps-VXqGp84f.js.map +1 -0
  177. package/lib/cjs/nginx-UrubUbn1.js +166 -0
  178. package/lib/cjs/nginx-UrubUbn1.js.map +1 -0
  179. package/lib/cjs/nsis-c2AYwqyy.js +83 -0
  180. package/lib/cjs/nsis-c2AYwqyy.js.map +1 -0
  181. package/lib/cjs/ntriples-N1nwiheD.js +144 -0
  182. package/lib/cjs/ntriples-N1nwiheD.js.map +1 -0
  183. package/lib/cjs/octave-ElonStfZ.js +115 -0
  184. package/lib/cjs/octave-ElonStfZ.js.map +1 -0
  185. package/lib/cjs/oz-7VQTnCfu.js +238 -0
  186. package/lib/cjs/oz-7VQTnCfu.js.map +1 -0
  187. package/lib/cjs/pascal-yq2Cb88Q.js +127 -0
  188. package/lib/cjs/pascal-yq2Cb88Q.js.map +1 -0
  189. package/lib/cjs/perl-hJq4byS9.js +822 -0
  190. package/lib/cjs/perl-hJq4byS9.js.map +1 -0
  191. package/lib/cjs/pig-2syuOlAa.js +152 -0
  192. package/lib/cjs/pig-2syuOlAa.js.map +1 -0
  193. package/lib/cjs/powershell-NDwxuSDg.js +384 -0
  194. package/lib/cjs/powershell-NDwxuSDg.js.map +1 -0
  195. package/lib/cjs/properties-wacODxDJ.js +65 -0
  196. package/lib/cjs/properties-wacODxDJ.js.map +1 -0
  197. package/lib/cjs/protobuf-zVHZwskk.js +57 -0
  198. package/lib/cjs/protobuf-zVHZwskk.js.map +1 -0
  199. package/lib/cjs/puppet-koQikqO-.js +208 -0
  200. package/lib/cjs/puppet-koQikqO-.js.map +1 -0
  201. package/lib/cjs/python-P3UsKHbj.js +394 -0
  202. package/lib/cjs/python-P3UsKHbj.js.map +1 -0
  203. package/lib/cjs/q-Z_d2uXoA.js +126 -0
  204. package/lib/cjs/q-Z_d2uXoA.js.map +1 -0
  205. package/lib/cjs/r-J6Jl9z1i.js +177 -0
  206. package/lib/cjs/r-J6Jl9z1i.js.map +1 -0
  207. package/lib/cjs/rpm-6C0Omumu.js +93 -0
  208. package/lib/cjs/rpm-6C0Omumu.js.map +1 -0
  209. package/lib/cjs/ruby-POVyUmsb.js +290 -0
  210. package/lib/cjs/ruby-POVyUmsb.js.map +1 -0
  211. package/lib/cjs/sas-vDtpSmFr.js +271 -0
  212. package/lib/cjs/sas-vDtpSmFr.js.map +1 -0
  213. package/lib/cjs/schema-RVrwDDcq.js +74 -0
  214. package/lib/cjs/schema-RVrwDDcq.js.map +1 -0
  215. package/lib/cjs/scheme-5AA5BH7S.js +266 -0
  216. package/lib/cjs/scheme-5AA5BH7S.js.map +1 -0
  217. package/lib/cjs/shell-_ztDMiW6.js +148 -0
  218. package/lib/cjs/shell-_ztDMiW6.js.map +1 -0
  219. package/lib/cjs/sieve-R_vzlbvH.js +181 -0
  220. package/lib/cjs/sieve-R_vzlbvH.js.map +1 -0
  221. package/lib/cjs/simple-mode-ZwmNbV0h.js +138 -0
  222. package/lib/cjs/simple-mode-ZwmNbV0h.js.map +1 -0
  223. package/lib/cjs/smalltalk-dWLp5zN8.js +156 -0
  224. package/lib/cjs/smalltalk-dWLp5zN8.js.map +1 -0
  225. package/lib/cjs/solr-wSmvjKI8.js +83 -0
  226. package/lib/cjs/solr-wSmvjKI8.js.map +1 -0
  227. package/lib/cjs/sparql-GNU_0xKB.js +173 -0
  228. package/lib/cjs/sparql-GNU_0xKB.js.map +1 -0
  229. package/lib/cjs/spreadsheet-BiqYLk6M.js +101 -0
  230. package/lib/cjs/spreadsheet-BiqYLk6M.js.map +1 -0
  231. package/lib/cjs/sql-9GpHBPsC.js +497 -0
  232. package/lib/cjs/sql-9GpHBPsC.js.map +1 -0
  233. package/lib/cjs/stex-1V41CNLk.js +250 -0
  234. package/lib/cjs/stex-1V41CNLk.js.map +1 -0
  235. package/lib/cjs/stylus-H6hn9z_G.js +753 -0
  236. package/lib/cjs/stylus-H6hn9z_G.js.map +1 -0
  237. package/lib/cjs/swift-Xv5f8zgN.js +205 -0
  238. package/lib/cjs/swift-Xv5f8zgN.js.map +1 -0
  239. package/lib/cjs/tcl-LI-LOw_t.js +128 -0
  240. package/lib/cjs/tcl-LI-LOw_t.js.map +1 -0
  241. package/lib/cjs/textile-3NvRPUgg.js +444 -0
  242. package/lib/cjs/textile-3NvRPUgg.js.map +1 -0
  243. package/lib/cjs/tiddlywiki-PkMzy8_R.js +281 -0
  244. package/lib/cjs/tiddlywiki-PkMzy8_R.js.map +1 -0
  245. package/lib/cjs/tiki-Zk_GnEC8.js +292 -0
  246. package/lib/cjs/tiki-Zk_GnEC8.js.map +1 -0
  247. package/lib/cjs/todoList-Ze4FLMlx.js +415 -0
  248. package/lib/cjs/todoList-Ze4FLMlx.js.map +1 -0
  249. package/lib/cjs/toml-36gJ0YCq.js +78 -0
  250. package/lib/cjs/toml-36gJ0YCq.js.map +1 -0
  251. package/lib/cjs/tooltip-plugin--lhebztC.js +191 -0
  252. package/lib/cjs/tooltip-plugin--lhebztC.js.map +1 -0
  253. package/lib/cjs/troff-RLZ_o61o.js +67 -0
  254. package/lib/cjs/troff-RLZ_o61o.js.map +1 -0
  255. package/lib/cjs/ttcn-cfg-twaoJYvf.js +204 -0
  256. package/lib/cjs/ttcn-cfg-twaoJYvf.js.map +1 -0
  257. package/lib/cjs/ttcn-kGwvGb2v.js +260 -0
  258. package/lib/cjs/ttcn-kGwvGb2v.js.map +1 -0
  259. package/lib/cjs/turtle-nnevat7b.js +144 -0
  260. package/lib/cjs/turtle-nnevat7b.js.map +1 -0
  261. package/lib/cjs/vb-fO_I9s3s.js +252 -0
  262. package/lib/cjs/vb-fO_I9s3s.js.map +1 -0
  263. package/lib/cjs/vbscript-HXnn40y4.js +324 -0
  264. package/lib/cjs/vbscript-HXnn40y4.js.map +1 -0
  265. package/lib/cjs/velocity-Wn-ZfFzr.js +189 -0
  266. package/lib/cjs/velocity-Wn-ZfFzr.js.map +1 -0
  267. package/lib/cjs/verilog-y1ev34z6.js +569 -0
  268. package/lib/cjs/verilog-y1ev34z6.js.map +1 -0
  269. package/lib/cjs/vhdl-LF0oeXxc.js +177 -0
  270. package/lib/cjs/vhdl-LF0oeXxc.js.map +1 -0
  271. package/lib/cjs/webidl-6kI5KbeC.js +182 -0
  272. package/lib/cjs/webidl-6kI5KbeC.js.map +1 -0
  273. package/lib/cjs/xquery-BavrmwsO.js +428 -0
  274. package/lib/cjs/xquery-BavrmwsO.js.map +1 -0
  275. package/lib/cjs/yacas-1g_AbTrl.js +185 -0
  276. package/lib/cjs/yacas-1g_AbTrl.js.map +1 -0
  277. package/lib/cjs/z80-QYzKAAp7.js +106 -0
  278. package/lib/cjs/z80-QYzKAAp7.js.map +1 -0
  279. package/lib/esm/_view-IlZC8FA6.js +25 -0
  280. package/lib/esm/_view-IlZC8FA6.js.map +1 -0
  281. package/lib/esm/apl-eHQxyJFn.js +143 -0
  282. package/lib/esm/apl-eHQxyJFn.js.map +1 -0
  283. package/lib/esm/asciiarmor-Z-IGYCI4.js +57 -0
  284. package/lib/esm/asciiarmor-Z-IGYCI4.js.map +1 -0
  285. package/lib/esm/asn1-gF7x-q1y.js +193 -0
  286. package/lib/esm/asn1-gF7x-q1y.js.map +1 -0
  287. package/lib/esm/asterisk-swk20ftp.js +188 -0
  288. package/lib/esm/asterisk-swk20ftp.js.map +1 -0
  289. package/lib/esm/brainfuck-IFQdiQoR.js +71 -0
  290. package/lib/esm/brainfuck-IFQdiQoR.js.map +1 -0
  291. package/lib/esm/clike-q3hUF2Cx.js +1019 -0
  292. package/lib/esm/clike-q3hUF2Cx.js.map +1 -0
  293. package/lib/esm/clojure-I2Krbr2M.js +275 -0
  294. package/lib/esm/clojure-I2Krbr2M.js.map +1 -0
  295. package/lib/esm/clsx-RxCLxYpD.js +4 -0
  296. package/lib/esm/clsx-RxCLxYpD.js.map +1 -0
  297. package/lib/esm/cmake-ewwXLeuZ.js +82 -0
  298. package/lib/esm/cmake-ewwXLeuZ.js.map +1 -0
  299. package/lib/esm/cobol-fpN1nAnR.js +236 -0
  300. package/lib/esm/cobol-fpN1nAnR.js.map +1 -0
  301. package/lib/esm/coffeescript--eTFR-bH.js +330 -0
  302. package/lib/esm/coffeescript--eTFR-bH.js.map +1 -0
  303. package/lib/esm/commonlisp-XLSwVdLc.js +109 -0
  304. package/lib/esm/commonlisp-XLSwVdLc.js.map +1 -0
  305. package/lib/esm/crystal-_r3Aa1_a.js +420 -0
  306. package/lib/esm/crystal-_r3Aa1_a.js.map +1 -0
  307. package/lib/esm/css-hgwYGMKZ.js +848 -0
  308. package/lib/esm/css-hgwYGMKZ.js.map +1 -0
  309. package/lib/esm/cypher-bbJyAa-4.js +123 -0
  310. package/lib/esm/cypher-bbJyAa-4.js.map +1 -0
  311. package/lib/esm/d-5MyulviS.js +206 -0
  312. package/lib/esm/d-5MyulviS.js.map +1 -0
  313. package/lib/esm/diff-neOaT_vk.js +31 -0
  314. package/lib/esm/diff-neOaT_vk.js.map +1 -0
  315. package/lib/esm/dockerfile-lzx42-zz.js +200 -0
  316. package/lib/esm/dockerfile-lzx42-zz.js.map +1 -0
  317. package/lib/esm/dtd-FmzPLZcQ.js +122 -0
  318. package/lib/esm/dtd-FmzPLZcQ.js.map +1 -0
  319. package/lib/esm/dylan-1HtRK4GO.js +338 -0
  320. package/lib/esm/dylan-1HtRK4GO.js.map +1 -0
  321. package/lib/esm/ebnf-Nz-pnLHy.js +152 -0
  322. package/lib/esm/ebnf-Nz-pnLHy.js.map +1 -0
  323. package/lib/esm/ecl-lQsZhQz0.js +191 -0
  324. package/lib/esm/ecl-lQsZhQz0.js.map +1 -0
  325. package/lib/esm/eiffel-R_HiEkhx.js +147 -0
  326. package/lib/esm/eiffel-R_HiEkhx.js.map +1 -0
  327. package/lib/esm/elm-KYv4VTDg.js +231 -0
  328. package/lib/esm/elm-KYv4VTDg.js.map +1 -0
  329. package/lib/esm/erlang-7YaHCBIe.js +582 -0
  330. package/lib/esm/erlang-7YaHCBIe.js.map +1 -0
  331. package/lib/esm/factor-opBU9aTK.js +66 -0
  332. package/lib/esm/factor-opBU9aTK.js.map +1 -0
  333. package/lib/esm/fcl-jm31FmFz.js +155 -0
  334. package/lib/esm/fcl-jm31FmFz.js.map +1 -0
  335. package/lib/esm/floating-ui.dom-CAYjY8Gv.js +1130 -0
  336. package/lib/esm/floating-ui.dom-CAYjY8Gv.js.map +1 -0
  337. package/lib/esm/forth-5NKbjnWh.js +165 -0
  338. package/lib/esm/forth-5NKbjnWh.js.map +1 -0
  339. package/lib/esm/fortran-dXm_-cb9.js +173 -0
  340. package/lib/esm/fortran-dXm_-cb9.js.map +1 -0
  341. package/lib/esm/gas-nsYVnsy-.js +344 -0
  342. package/lib/esm/gas-nsYVnsy-.js.map +1 -0
  343. package/lib/esm/gherkin-fzKpjm3M.js +148 -0
  344. package/lib/esm/gherkin-fzKpjm3M.js.map +1 -0
  345. package/lib/esm/go-Pn1qh7yl.js +165 -0
  346. package/lib/esm/go-Pn1qh7yl.js.map +1 -0
  347. package/lib/esm/groovy-DZY-8keZ.js +231 -0
  348. package/lib/esm/groovy-DZY-8keZ.js.map +1 -0
  349. package/lib/esm/haskell-JGh2upDd.js +240 -0
  350. package/lib/esm/haskell-JGh2upDd.js.map +1 -0
  351. package/lib/esm/haxe-1hvVK-Fy.js +491 -0
  352. package/lib/esm/haxe-1hvVK-Fy.js.map +1 -0
  353. package/lib/esm/helper-wZAtC67x.js +13 -0
  354. package/lib/esm/helper-wZAtC67x.js.map +1 -0
  355. package/lib/esm/http-mY1M77wn.js +90 -0
  356. package/lib/esm/http-mY1M77wn.js.map +1 -0
  357. package/lib/esm/idl-dy_653wH.js +275 -0
  358. package/lib/esm/idl-dy_653wH.js.map +1 -0
  359. package/lib/esm/index-0-j8Icms.js +384 -0
  360. package/lib/esm/index-0-j8Icms.js.map +1 -0
  361. package/lib/esm/index-1l-61HI-.js +358 -0
  362. package/lib/esm/index-1l-61HI-.js.map +1 -0
  363. package/lib/esm/index-3HeWs5rX.js +440 -0
  364. package/lib/esm/index-3HeWs5rX.js.map +1 -0
  365. package/lib/esm/index-3bDzhU6z.js +759 -0
  366. package/lib/esm/index-3bDzhU6z.js.map +1 -0
  367. package/lib/esm/index-6GrVnloh.js +1027 -0
  368. package/lib/esm/index-6GrVnloh.js.map +1 -0
  369. package/lib/esm/index-8QJbxTYk.js +1145 -0
  370. package/lib/esm/index-8QJbxTYk.js.map +1 -0
  371. package/lib/esm/index-9w_hdnvb.js +532 -0
  372. package/lib/esm/index-9w_hdnvb.js.map +1 -0
  373. package/lib/esm/index-A83StUe6.js +174 -0
  374. package/lib/esm/index-A83StUe6.js.map +1 -0
  375. package/lib/esm/index-AOoFzBaK.js +53 -0
  376. package/lib/esm/index-AOoFzBaK.js.map +1 -0
  377. package/lib/esm/index-DS7Z4Ach.js +686 -0
  378. package/lib/esm/index-DS7Z4Ach.js.map +1 -0
  379. package/lib/esm/index-Jvxff1vU.js +16 -0
  380. package/lib/esm/index-Jvxff1vU.js.map +1 -0
  381. package/lib/esm/index-LAdX6LsO.js +33805 -0
  382. package/lib/esm/index-LAdX6LsO.js.map +1 -0
  383. package/lib/esm/index-MB6wQe1U.js +74 -0
  384. package/lib/esm/index-MB6wQe1U.js.map +1 -0
  385. package/lib/esm/index-MxgqkRtj.js +125 -0
  386. package/lib/esm/index-MxgqkRtj.js.map +1 -0
  387. package/lib/esm/index-NZ5-xr5_.js +351 -0
  388. package/lib/esm/index-NZ5-xr5_.js.map +1 -0
  389. package/lib/esm/index-OpUb5xP6.js +1872 -0
  390. package/lib/esm/index-OpUb5xP6.js.map +1 -0
  391. package/lib/esm/index-SDPCpsD5.js +461 -0
  392. package/lib/esm/index-SDPCpsD5.js.map +1 -0
  393. package/lib/esm/index-VP76m4nW.js +157 -0
  394. package/lib/esm/index-VP76m4nW.js.map +1 -0
  395. package/lib/esm/index-Vl0W0S3h.js +259 -0
  396. package/lib/esm/index-Vl0W0S3h.js.map +1 -0
  397. package/lib/esm/index-VoX_n1l_.js +1038 -0
  398. package/lib/esm/index-VoX_n1l_.js.map +1 -0
  399. package/lib/esm/index-XH7OnwZl.js +527 -0
  400. package/lib/esm/index-XH7OnwZl.js.map +1 -0
  401. package/lib/esm/index-Yuj7sNhQ.js +105 -0
  402. package/lib/esm/index-Yuj7sNhQ.js.map +1 -0
  403. package/lib/esm/index-_4fWmRbN.js +206 -0
  404. package/lib/esm/index-_4fWmRbN.js.map +1 -0
  405. package/lib/esm/index-bexsWrgs.js +153 -0
  406. package/lib/esm/index-bexsWrgs.js.map +1 -0
  407. package/lib/esm/index-chrnjY1D.js +470 -0
  408. package/lib/esm/index-chrnjY1D.js.map +1 -0
  409. package/lib/esm/index-eqd5wtjX.js +393 -0
  410. package/lib/esm/index-eqd5wtjX.js.map +1 -0
  411. package/lib/esm/index-g_3dzLYU.js +200 -0
  412. package/lib/esm/index-g_3dzLYU.js.map +1 -0
  413. package/lib/esm/index-grT-Kuf2.js +78 -0
  414. package/lib/esm/index-grT-Kuf2.js.map +1 -0
  415. package/lib/esm/index-hF04phbf.js +189 -0
  416. package/lib/esm/index-hF04phbf.js.map +1 -0
  417. package/lib/esm/index-i79QMXpJ.js +25654 -0
  418. package/lib/esm/index-i79QMXpJ.js.map +1 -0
  419. package/lib/esm/index-rvOBAXap.js +2512 -0
  420. package/lib/esm/index-rvOBAXap.js.map +1 -0
  421. package/lib/esm/index-uP9BKsTM.js +446 -0
  422. package/lib/esm/index-uP9BKsTM.js.map +1 -0
  423. package/lib/esm/index-ueQQMSgm.js +1351 -0
  424. package/lib/esm/index-ueQQMSgm.js.map +1 -0
  425. package/lib/esm/index-x8SyiPMC.js +401 -0
  426. package/lib/esm/index-x8SyiPMC.js.map +1 -0
  427. package/lib/esm/index-zrQXXSXm.js +115 -0
  428. package/lib/esm/index-zrQXXSXm.js.map +1 -0
  429. package/lib/esm/index.js +13 -0
  430. package/lib/esm/index.js.map +1 -0
  431. package/lib/esm/javascript-TMTz-YQH.js +923 -0
  432. package/lib/esm/javascript-TMTz-YQH.js.map +1 -0
  433. package/lib/esm/jinja2-sRIdliZK.js +172 -0
  434. package/lib/esm/jinja2-sRIdliZK.js.map +1 -0
  435. package/lib/esm/julia-fK0wmpGL.js +370 -0
  436. package/lib/esm/julia-fK0wmpGL.js.map +1 -0
  437. package/lib/esm/livescript-FRbAot3D.js +260 -0
  438. package/lib/esm/livescript-FRbAot3D.js.map +1 -0
  439. package/lib/esm/lua-t4FHEjvK.js +138 -0
  440. package/lib/esm/lua-t4FHEjvK.js.map +1 -0
  441. package/lib/esm/mathematica-sn_KGlYj.js +154 -0
  442. package/lib/esm/mathematica-sn_KGlYj.js.map +1 -0
  443. package/lib/esm/mbox-KvVC319E.js +115 -0
  444. package/lib/esm/mbox-KvVC319E.js.map +1 -0
  445. package/lib/esm/mirc-PzJ0zKSk.js +177 -0
  446. package/lib/esm/mirc-PzJ0zKSk.js.map +1 -0
  447. package/lib/esm/mllike-ZK411xkN.js +347 -0
  448. package/lib/esm/mllike-ZK411xkN.js.map +1 -0
  449. package/lib/esm/modelica-ZaHlRCbp.js +193 -0
  450. package/lib/esm/modelica-ZaHlRCbp.js.map +1 -0
  451. package/lib/esm/mscgen-Kkq4o4Zm.js +150 -0
  452. package/lib/esm/mscgen-Kkq4o4Zm.js.map +1 -0
  453. package/lib/esm/mumps-M8a87-rl.js +130 -0
  454. package/lib/esm/mumps-M8a87-rl.js.map +1 -0
  455. package/lib/esm/nginx-2LJIX23E.js +164 -0
  456. package/lib/esm/nginx-2LJIX23E.js.map +1 -0
  457. package/lib/esm/nsis-zvfFgMLi.js +81 -0
  458. package/lib/esm/nsis-zvfFgMLi.js.map +1 -0
  459. package/lib/esm/ntriples-tVkHy5bk.js +142 -0
  460. package/lib/esm/ntriples-tVkHy5bk.js.map +1 -0
  461. package/lib/esm/octave-mE4T5MF5.js +113 -0
  462. package/lib/esm/octave-mE4T5MF5.js.map +1 -0
  463. package/lib/esm/oz-q-LCsuVg.js +236 -0
  464. package/lib/esm/oz-q-LCsuVg.js.map +1 -0
  465. package/lib/esm/pascal-0IgUAn4C.js +125 -0
  466. package/lib/esm/pascal-0IgUAn4C.js.map +1 -0
  467. package/lib/esm/perl-AqxdYGac.js +820 -0
  468. package/lib/esm/perl-AqxdYGac.js.map +1 -0
  469. package/lib/esm/pig-ESM-IjQj.js +150 -0
  470. package/lib/esm/pig-ESM-IjQj.js.map +1 -0
  471. package/lib/esm/powershell-CLFP0L55.js +382 -0
  472. package/lib/esm/powershell-CLFP0L55.js.map +1 -0
  473. package/lib/esm/properties-oWHNzvb9.js +63 -0
  474. package/lib/esm/properties-oWHNzvb9.js.map +1 -0
  475. package/lib/esm/protobuf-c7eMmdcc.js +55 -0
  476. package/lib/esm/protobuf-c7eMmdcc.js.map +1 -0
  477. package/lib/esm/puppet-FjzvdRJr.js +206 -0
  478. package/lib/esm/puppet-FjzvdRJr.js.map +1 -0
  479. package/lib/esm/python-3Pv0tnvt.js +390 -0
  480. package/lib/esm/python-3Pv0tnvt.js.map +1 -0
  481. package/lib/esm/q-IImW8da6.js +124 -0
  482. package/lib/esm/q-IImW8da6.js.map +1 -0
  483. package/lib/esm/r-CnEkTvR0.js +175 -0
  484. package/lib/esm/r-CnEkTvR0.js.map +1 -0
  485. package/lib/esm/rpm-Q55-fEHj.js +90 -0
  486. package/lib/esm/rpm-Q55-fEHj.js.map +1 -0
  487. package/lib/esm/ruby-zhaGB3Kh.js +288 -0
  488. package/lib/esm/ruby-zhaGB3Kh.js.map +1 -0
  489. package/lib/esm/sas-Ur9jZIOV.js +269 -0
  490. package/lib/esm/sas-Ur9jZIOV.js.map +1 -0
  491. package/lib/esm/schema-JWJqD9qa.js +71 -0
  492. package/lib/esm/schema-JWJqD9qa.js.map +1 -0
  493. package/lib/esm/scheme-daT5-Rya.js +264 -0
  494. package/lib/esm/scheme-daT5-Rya.js.map +1 -0
  495. package/lib/esm/shell-cwFL0AYP.js +146 -0
  496. package/lib/esm/shell-cwFL0AYP.js.map +1 -0
  497. package/lib/esm/sieve-MlNXFFUq.js +179 -0
  498. package/lib/esm/sieve-MlNXFFUq.js.map +1 -0
  499. package/lib/esm/simple-mode-m1rsX7Gw.js +136 -0
  500. package/lib/esm/simple-mode-m1rsX7Gw.js.map +1 -0
  501. package/lib/esm/smalltalk-xrQICp9e.js +154 -0
  502. package/lib/esm/smalltalk-xrQICp9e.js.map +1 -0
  503. package/lib/esm/solr-PU3oPgQz.js +81 -0
  504. package/lib/esm/solr-PU3oPgQz.js.map +1 -0
  505. package/lib/esm/sparql--u8NRBii.js +171 -0
  506. package/lib/esm/sparql--u8NRBii.js.map +1 -0
  507. package/lib/esm/spreadsheet-QCp0LifX.js +99 -0
  508. package/lib/esm/spreadsheet-QCp0LifX.js.map +1 -0
  509. package/lib/esm/sql-dsGfl64h.js +482 -0
  510. package/lib/esm/sql-dsGfl64h.js.map +1 -0
  511. package/lib/esm/stex-WcLBzvkD.js +247 -0
  512. package/lib/esm/stex-WcLBzvkD.js.map +1 -0
  513. package/lib/esm/stylus--A5XAqOX.js +751 -0
  514. package/lib/esm/stylus--A5XAqOX.js.map +1 -0
  515. package/lib/esm/swift-qAm73i7G.js +203 -0
  516. package/lib/esm/swift-qAm73i7G.js.map +1 -0
  517. package/lib/esm/tcl-Kdc7qxc-.js +126 -0
  518. package/lib/esm/tcl-Kdc7qxc-.js.map +1 -0
  519. package/lib/esm/textile--sz8UrIz.js +442 -0
  520. package/lib/esm/textile--sz8UrIz.js.map +1 -0
  521. package/lib/esm/tiddlywiki-xNXTeBlQ.js +279 -0
  522. package/lib/esm/tiddlywiki-xNXTeBlQ.js.map +1 -0
  523. package/lib/esm/tiki-LCXjrNH3.js +290 -0
  524. package/lib/esm/tiki-LCXjrNH3.js.map +1 -0
  525. package/lib/esm/todoList-M-PGJKde.js +378 -0
  526. package/lib/esm/todoList-M-PGJKde.js.map +1 -0
  527. package/lib/esm/toml-Ac4tlBMn.js +76 -0
  528. package/lib/esm/toml-Ac4tlBMn.js.map +1 -0
  529. package/lib/esm/tooltip-plugin-iw2EQWIG.js +185 -0
  530. package/lib/esm/tooltip-plugin-iw2EQWIG.js.map +1 -0
  531. package/lib/esm/troff-LLW1x1Yz.js +65 -0
  532. package/lib/esm/troff-LLW1x1Yz.js.map +1 -0
  533. package/lib/esm/ttcn-ZYZ9FS3u.js +258 -0
  534. package/lib/esm/ttcn-ZYZ9FS3u.js.map +1 -0
  535. package/lib/esm/ttcn-cfg-qsvf3MfB.js +202 -0
  536. package/lib/esm/ttcn-cfg-qsvf3MfB.js.map +1 -0
  537. package/lib/esm/turtle-wq3TqOth.js +142 -0
  538. package/lib/esm/turtle-wq3TqOth.js.map +1 -0
  539. package/lib/esm/vb-86M_JuNP.js +250 -0
  540. package/lib/esm/vb-86M_JuNP.js.map +1 -0
  541. package/lib/esm/vbscript-GueAeVug.js +321 -0
  542. package/lib/esm/vbscript-GueAeVug.js.map +1 -0
  543. package/lib/esm/velocity-7PW9GXO2.js +187 -0
  544. package/lib/esm/velocity-7PW9GXO2.js.map +1 -0
  545. package/lib/esm/verilog-PXtXH14C.js +566 -0
  546. package/lib/esm/verilog-PXtXH14C.js.map +1 -0
  547. package/lib/esm/vhdl-I8eyK83X.js +175 -0
  548. package/lib/esm/vhdl-I8eyK83X.js.map +1 -0
  549. package/lib/esm/webidl-1f8ATJ66.js +180 -0
  550. package/lib/esm/webidl-1f8ATJ66.js.map +1 -0
  551. package/lib/esm/xquery-IYp28Wx6.js +426 -0
  552. package/lib/esm/xquery-IYp28Wx6.js.map +1 -0
  553. package/lib/esm/yacas-wkENB05f.js +183 -0
  554. package/lib/esm/yacas-wkENB05f.js.map +1 -0
  555. package/lib/esm/z80-GaXiLdiV.js +103 -0
  556. package/lib/esm/z80-GaXiLdiV.js.map +1 -0
  557. package/lib/theme/_internal/classic-common.css +257 -0
  558. package/lib/theme/common/block-edit.css +120 -0
  559. package/lib/theme/common/code-mirror.css +192 -0
  560. package/lib/theme/common/cursor.css +13 -0
  561. package/lib/theme/common/image-block.css +364 -0
  562. package/lib/theme/common/link-tooltip.css +102 -0
  563. package/lib/theme/common/list-item.css +49 -0
  564. package/lib/theme/common/placeholder.css +7 -0
  565. package/lib/theme/common/prosemirror.css +1 -0
  566. package/lib/theme/common/style.css +10 -0
  567. package/lib/theme/common/table.css +217 -0
  568. package/lib/theme/common/toolbar.css +41 -0
  569. package/lib/theme/crepe/style.css +28 -0
  570. package/lib/theme/crepe-dark/style.css +28 -0
  571. package/lib/theme/frame/style.css +28 -0
  572. package/lib/theme/frame-dark/style.css +28 -0
  573. package/lib/theme/nord/style.css +28 -0
  574. package/lib/theme/nord-dark/style.css +28 -0
  575. package/lib/types/core/crepe.d.ts +21 -0
  576. package/lib/types/core/crepe.d.ts.map +1 -0
  577. package/lib/types/core/index.d.ts +2 -0
  578. package/lib/types/core/index.d.ts.map +1 -0
  579. package/lib/types/core/slice.d.ts +5 -0
  580. package/lib/types/core/slice.d.ts.map +1 -0
  581. package/lib/types/feature/block-edit/handle/component.d.ts +12 -0
  582. package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -0
  583. package/lib/types/feature/block-edit/handle/index.d.ts +12 -0
  584. package/lib/types/feature/block-edit/handle/index.d.ts.map +1 -0
  585. package/lib/types/feature/block-edit/index.d.ts +44 -0
  586. package/lib/types/feature/block-edit/index.d.ts.map +1 -0
  587. package/lib/types/feature/block-edit/menu/component.d.ts +16 -0
  588. package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -0
  589. package/lib/types/feature/block-edit/menu/config.d.ts +12 -0
  590. package/lib/types/feature/block-edit/menu/config.d.ts.map +1 -0
  591. package/lib/types/feature/block-edit/menu/group-builder.d.ts +29 -0
  592. package/lib/types/feature/block-edit/menu/group-builder.d.ts.map +1 -0
  593. package/lib/types/feature/block-edit/menu/index.d.ts +10 -0
  594. package/lib/types/feature/block-edit/menu/index.d.ts.map +1 -0
  595. package/lib/types/feature/block-edit/menu/utils.d.ts +28 -0
  596. package/lib/types/feature/block-edit/menu/utils.d.ts.map +1 -0
  597. package/lib/types/feature/code-mirror/index.d.ts +19 -0
  598. package/lib/types/feature/code-mirror/index.d.ts.map +1 -0
  599. package/lib/types/feature/cursor/index.d.ts +9 -0
  600. package/lib/types/feature/cursor/index.d.ts.map +1 -0
  601. package/lib/types/feature/image-block/index.d.ts +20 -0
  602. package/lib/types/feature/image-block/index.d.ts.map +1 -0
  603. package/lib/types/feature/index.d.ts +35 -0
  604. package/lib/types/feature/index.d.ts.map +1 -0
  605. package/lib/types/feature/link-tooltip/index.d.ts +13 -0
  606. package/lib/types/feature/link-tooltip/index.d.ts.map +1 -0
  607. package/lib/types/feature/list-item/index.d.ts +9 -0
  608. package/lib/types/feature/list-item/index.d.ts.map +1 -0
  609. package/lib/types/feature/placeholder/index.d.ts +11 -0
  610. package/lib/types/feature/placeholder/index.d.ts.map +1 -0
  611. package/lib/types/feature/shared.d.ts +5 -0
  612. package/lib/types/feature/shared.d.ts.map +1 -0
  613. package/lib/types/feature/table/index.d.ts +16 -0
  614. package/lib/types/feature/table/index.d.ts.map +1 -0
  615. package/lib/types/feature/toolbar/component.d.ts +15 -0
  616. package/lib/types/feature/toolbar/component.d.ts.map +1 -0
  617. package/lib/types/feature/toolbar/index.d.ts +12 -0
  618. package/lib/types/feature/toolbar/index.d.ts.map +1 -0
  619. package/lib/types/icons/alignCenter.d.ts +2 -0
  620. package/lib/types/icons/alignCenter.d.ts.map +1 -0
  621. package/lib/types/icons/alignLeft.d.ts +2 -0
  622. package/lib/types/icons/alignLeft.d.ts.map +1 -0
  623. package/lib/types/icons/alignRight.d.ts +2 -0
  624. package/lib/types/icons/alignRight.d.ts.map +1 -0
  625. package/lib/types/icons/bold.d.ts +2 -0
  626. package/lib/types/icons/bold.d.ts.map +1 -0
  627. package/lib/types/icons/bullet.d.ts +2 -0
  628. package/lib/types/icons/bullet.d.ts.map +1 -0
  629. package/lib/types/icons/bulletList.d.ts +2 -0
  630. package/lib/types/icons/bulletList.d.ts.map +1 -0
  631. package/lib/types/icons/caption.d.ts +2 -0
  632. package/lib/types/icons/caption.d.ts.map +1 -0
  633. package/lib/types/icons/checkBoxChecked.d.ts +2 -0
  634. package/lib/types/icons/checkBoxChecked.d.ts.map +1 -0
  635. package/lib/types/icons/checkBoxUnchecked.d.ts +2 -0
  636. package/lib/types/icons/checkBoxUnchecked.d.ts.map +1 -0
  637. package/lib/types/icons/chevronDown.d.ts +2 -0
  638. package/lib/types/icons/chevronDown.d.ts.map +1 -0
  639. package/lib/types/icons/clear.d.ts +2 -0
  640. package/lib/types/icons/clear.d.ts.map +1 -0
  641. package/lib/types/icons/code.d.ts +2 -0
  642. package/lib/types/icons/code.d.ts.map +1 -0
  643. package/lib/types/icons/confirm.d.ts +2 -0
  644. package/lib/types/icons/confirm.d.ts.map +1 -0
  645. package/lib/types/icons/divider.d.ts +2 -0
  646. package/lib/types/icons/divider.d.ts.map +1 -0
  647. package/lib/types/icons/dragHandle.d.ts +2 -0
  648. package/lib/types/icons/dragHandle.d.ts.map +1 -0
  649. package/lib/types/icons/edit.d.ts +2 -0
  650. package/lib/types/icons/edit.d.ts.map +1 -0
  651. package/lib/types/icons/h1.d.ts +2 -0
  652. package/lib/types/icons/h1.d.ts.map +1 -0
  653. package/lib/types/icons/h2.d.ts +2 -0
  654. package/lib/types/icons/h2.d.ts.map +1 -0
  655. package/lib/types/icons/h3.d.ts +2 -0
  656. package/lib/types/icons/h3.d.ts.map +1 -0
  657. package/lib/types/icons/h4.d.ts +2 -0
  658. package/lib/types/icons/h4.d.ts.map +1 -0
  659. package/lib/types/icons/h5.d.ts +2 -0
  660. package/lib/types/icons/h5.d.ts.map +1 -0
  661. package/lib/types/icons/h6.d.ts +2 -0
  662. package/lib/types/icons/h6.d.ts.map +1 -0
  663. package/lib/types/icons/image.d.ts +2 -0
  664. package/lib/types/icons/image.d.ts.map +1 -0
  665. package/lib/types/icons/index.d.ts +36 -0
  666. package/lib/types/icons/index.d.ts.map +1 -0
  667. package/lib/types/icons/italic.d.ts +2 -0
  668. package/lib/types/icons/italic.d.ts.map +1 -0
  669. package/lib/types/icons/link.d.ts +2 -0
  670. package/lib/types/icons/link.d.ts.map +1 -0
  671. package/lib/types/icons/menu.d.ts +2 -0
  672. package/lib/types/icons/menu.d.ts.map +1 -0
  673. package/lib/types/icons/orderedList.d.ts +2 -0
  674. package/lib/types/icons/orderedList.d.ts.map +1 -0
  675. package/lib/types/icons/plus.d.ts +2 -0
  676. package/lib/types/icons/plus.d.ts.map +1 -0
  677. package/lib/types/icons/quote.d.ts +2 -0
  678. package/lib/types/icons/quote.d.ts.map +1 -0
  679. package/lib/types/icons/remove.d.ts +2 -0
  680. package/lib/types/icons/remove.d.ts.map +1 -0
  681. package/lib/types/icons/search.d.ts +2 -0
  682. package/lib/types/icons/search.d.ts.map +1 -0
  683. package/lib/types/icons/strikethrough.d.ts +2 -0
  684. package/lib/types/icons/strikethrough.d.ts.map +1 -0
  685. package/lib/types/icons/table.d.ts +2 -0
  686. package/lib/types/icons/table.d.ts.map +1 -0
  687. package/lib/types/icons/text.d.ts +2 -0
  688. package/lib/types/icons/text.d.ts.map +1 -0
  689. package/lib/types/icons/todoList.d.ts +2 -0
  690. package/lib/types/icons/todoList.d.ts.map +1 -0
  691. package/lib/types/index.d.ts +3 -0
  692. package/lib/types/index.d.ts.map +1 -0
  693. package/lib/types/utils/index.d.ts +5 -0
  694. package/lib/types/utils/index.d.ts.map +1 -0
  695. package/package.json +25 -31
  696. package/src/core/crepe.ts +17 -17
  697. package/src/core/index.ts +0 -3
  698. package/src/core/slice.ts +2 -35
  699. package/src/feature/block-edit/handle/component.ts +13 -30
  700. package/src/feature/block-edit/handle/index.ts +39 -33
  701. package/src/feature/block-edit/index.ts +50 -9
  702. package/src/feature/block-edit/menu/component.ts +19 -12
  703. package/src/feature/block-edit/menu/config.ts +203 -275
  704. package/src/feature/block-edit/menu/group-builder.ts +50 -0
  705. package/src/feature/block-edit/menu/index.ts +20 -21
  706. package/src/feature/block-edit/menu/utils.ts +89 -0
  707. package/src/feature/code-mirror/index.ts +47 -47
  708. package/src/feature/cursor/index.ts +21 -0
  709. package/src/feature/image-block/index.ts +34 -45
  710. package/src/feature/index.ts +28 -7
  711. package/src/feature/link-tooltip/index.ts +23 -14
  712. package/src/feature/list-item/index.ts +22 -14
  713. package/src/feature/placeholder/index.ts +12 -11
  714. package/src/feature/shared.ts +5 -3
  715. package/src/feature/table/index.ts +54 -0
  716. package/src/feature/toolbar/component.ts +29 -12
  717. package/src/feature/toolbar/index.ts +31 -25
  718. package/src/icons/alignCenter.ts +7 -0
  719. package/src/icons/alignLeft.ts +7 -0
  720. package/src/icons/alignRight.ts +7 -0
  721. package/src/icons/bold.ts +7 -0
  722. package/src/icons/bullet.ts +14 -0
  723. package/src/icons/bulletList.ts +14 -0
  724. package/src/icons/caption.ts +7 -0
  725. package/src/icons/checkBoxChecked.ts +14 -0
  726. package/src/icons/checkBoxUnchecked.ts +14 -0
  727. package/src/icons/chevronDown.ts +7 -0
  728. package/src/icons/clear.ts +14 -0
  729. package/src/icons/code.ts +14 -0
  730. package/src/icons/confirm.ts +14 -0
  731. package/src/icons/divider.ts +14 -0
  732. package/src/icons/dragHandle.ts +7 -0
  733. package/src/icons/edit.ts +14 -0
  734. package/src/icons/h1.ts +14 -0
  735. package/src/icons/h2.ts +14 -0
  736. package/src/icons/h3.ts +14 -0
  737. package/src/icons/h4.ts +14 -0
  738. package/src/icons/h5.ts +14 -0
  739. package/src/icons/h6.ts +14 -0
  740. package/src/icons/image.ts +14 -0
  741. package/src/icons/index.ts +35 -0
  742. package/src/icons/italic.ts +7 -0
  743. package/src/icons/link.ts +7 -0
  744. package/src/icons/menu.ts +14 -0
  745. package/src/icons/orderedList.ts +14 -0
  746. package/src/icons/plus.ts +14 -0
  747. package/src/icons/quote.ts +14 -0
  748. package/src/icons/remove.ts +7 -0
  749. package/src/icons/search.ts +7 -0
  750. package/src/icons/strikethrough.ts +7 -0
  751. package/src/icons/table.ts +14 -0
  752. package/src/icons/text.ts +14 -0
  753. package/src/icons/todoList.ts +7 -0
  754. package/src/index.ts +0 -3
  755. package/src/theme/_internal/classic-common.css +220 -0
  756. package/src/theme/common/block-edit.css +138 -0
  757. package/src/theme/common/code-mirror.css +189 -0
  758. package/src/theme/common/cursor.css +15 -0
  759. package/src/theme/common/image-block.css +381 -0
  760. package/src/theme/common/link-tooltip.css +112 -0
  761. package/src/theme/common/list-item.css +43 -0
  762. package/src/theme/common/prosemirror.css +1 -0
  763. package/src/theme/common/style.css +10 -0
  764. package/src/theme/common/table.css +204 -0
  765. package/src/theme/common/toolbar.css +51 -0
  766. package/src/theme/crepe/style.css +28 -0
  767. package/src/theme/crepe-dark/style.css +28 -0
  768. package/src/theme/frame/style.css +28 -0
  769. package/src/theme/frame-dark/style.css +28 -0
  770. package/src/theme/nord/style.css +28 -0
  771. package/src/theme/nord-dark/style.css +28 -0
  772. package/src/utils/index.ts +6 -2
  773. package/src/vite-env.d.ts +0 -1
  774. package/lib/apl-p0IPP13W.js +0 -76
  775. package/lib/asciiarmor-lJsBxlJJ.js +0 -34
  776. package/lib/asn1-Q9v1zIy5.js +0 -102
  777. package/lib/asterisk-foNkeTjy.js +0 -273
  778. package/lib/brainfuck-0XqyXpNS.js +0 -35
  779. package/lib/clike-ak6Z6Yhe.js +0 -639
  780. package/lib/clojure-iYO8U8Sg.js +0 -810
  781. package/lib/clsx-7d8NmkQq.js +0 -21
  782. package/lib/cmake-SVzjkxV_.js +0 -28
  783. package/lib/cobol-APHEnAOX.js +0 -74
  784. package/lib/coffeescript-KqQa0SYG.js +0 -182
  785. package/lib/commonlisp-bwqNqR5V.js +0 -79
  786. package/lib/core/crepe.d.ts +0 -21
  787. package/lib/core/crepe.d.ts.map +0 -1
  788. package/lib/core/index.d.ts +0 -3
  789. package/lib/core/index.d.ts.map +0 -1
  790. package/lib/core/slice.d.ts +0 -12
  791. package/lib/core/slice.d.ts.map +0 -1
  792. package/lib/crystal-BViWuDpA.js +0 -217
  793. package/lib/css-KHXHXfXg.js +0 -1572
  794. package/lib/cypher-XpTt4zQ3.js +0 -69
  795. package/lib/d-fLig6yqY.js +0 -139
  796. package/lib/diff-WoKGLpy6.js +0 -18
  797. package/lib/dockerfile-u6f6Vw2s.js +0 -194
  798. package/lib/dtd-SIJRUW6K.js +0 -91
  799. package/lib/dylan-4HCLhpWP.js +0 -238
  800. package/lib/ebnf-h_0lged5.js +0 -77
  801. package/lib/ecl-Lf4FF0lf.js +0 -133
  802. package/lib/eiffel-qlw8KUyf.js +0 -112
  803. package/lib/elm-QRnB3zXs.js +0 -108
  804. package/lib/erlang-fyVKb7eK.js +0 -488
  805. package/lib/factor-BEeN4upY.js +0 -65
  806. package/lib/fcl-lRek3hEb.js +0 -106
  807. package/lib/feature/block-edit/handle/component.d.ts +0 -9
  808. package/lib/feature/block-edit/handle/component.d.ts.map +0 -1
  809. package/lib/feature/block-edit/handle/index.d.ts +0 -12
  810. package/lib/feature/block-edit/handle/index.d.ts.map +0 -1
  811. package/lib/feature/block-edit/index.d.ts +0 -3
  812. package/lib/feature/block-edit/index.d.ts.map +0 -1
  813. package/lib/feature/block-edit/menu/component.d.ts +0 -14
  814. package/lib/feature/block-edit/menu/component.d.ts.map +0 -1
  815. package/lib/feature/block-edit/menu/config.d.ts +0 -21
  816. package/lib/feature/block-edit/menu/config.d.ts.map +0 -1
  817. package/lib/feature/block-edit/menu/icons.d.ts +0 -14
  818. package/lib/feature/block-edit/menu/icons.d.ts.map +0 -1
  819. package/lib/feature/block-edit/menu/index.d.ts +0 -9
  820. package/lib/feature/block-edit/menu/index.d.ts.map +0 -1
  821. package/lib/feature/code-mirror/index.d.ts +0 -3
  822. package/lib/feature/code-mirror/index.d.ts.map +0 -1
  823. package/lib/feature/gap-cursor/index.d.ts +0 -3
  824. package/lib/feature/gap-cursor/index.d.ts.map +0 -1
  825. package/lib/feature/image-block/index.d.ts +0 -3
  826. package/lib/feature/image-block/index.d.ts.map +0 -1
  827. package/lib/feature/index.d.ts +0 -18
  828. package/lib/feature/index.d.ts.map +0 -1
  829. package/lib/feature/link-tooltip/consts.d.ts +0 -5
  830. package/lib/feature/link-tooltip/consts.d.ts.map +0 -1
  831. package/lib/feature/link-tooltip/index.d.ts +0 -3
  832. package/lib/feature/link-tooltip/index.d.ts.map +0 -1
  833. package/lib/feature/list-item/consts.d.ts +0 -2
  834. package/lib/feature/list-item/consts.d.ts.map +0 -1
  835. package/lib/feature/list-item/index.d.ts +0 -3
  836. package/lib/feature/list-item/index.d.ts.map +0 -1
  837. package/lib/feature/placeholder/index.d.ts +0 -10
  838. package/lib/feature/placeholder/index.d.ts.map +0 -1
  839. package/lib/feature/shared.d.ts +0 -3
  840. package/lib/feature/shared.d.ts.map +0 -1
  841. package/lib/feature/toolbar/component.d.ts +0 -13
  842. package/lib/feature/toolbar/component.d.ts.map +0 -1
  843. package/lib/feature/toolbar/consts.d.ts +0 -5
  844. package/lib/feature/toolbar/consts.d.ts.map +0 -1
  845. package/lib/feature/toolbar/index.d.ts +0 -3
  846. package/lib/feature/toolbar/index.d.ts.map +0 -1
  847. package/lib/forth-ua2bRd8T.js +0 -60
  848. package/lib/fortran-WnF7znuN.js +0 -443
  849. package/lib/gas-wowve1o7.js +0 -183
  850. package/lib/gherkin-m7GIChu3.js +0 -34
  851. package/lib/go-th443Dhb.js +0 -158
  852. package/lib/groovy-tR4RiZnc.js +0 -161
  853. package/lib/haskell-jxVBofv5.js +0 -375
  854. package/lib/haxe-kWPI2tq3.js +0 -390
  855. package/lib/hooks-82sqkbtE.js +0 -21
  856. package/lib/http-3GIFWUlG.js +0 -45
  857. package/lib/icons-HYkfuR-O.js +0 -50
  858. package/lib/idl-PvpMZg-l.js +0 -947
  859. package/lib/index-BSv6537G.js +0 -364
  860. package/lib/index-BoI246Ti.js +0 -507
  861. package/lib/index-DDSXiQ90.js +0 -552
  862. package/lib/index-ECCvmC6D.js +0 -1301
  863. package/lib/index-EI1FcaSv.js +0 -928
  864. package/lib/index-ESoQGvsE.js +0 -288
  865. package/lib/index-GOH7H2i9.js +0 -81
  866. package/lib/index-GjFRg3RJ.js +0 -8
  867. package/lib/index-GzVCh3P9.js +0 -353
  868. package/lib/index-KCykNSJx.js +0 -323
  869. package/lib/index-Ls2I7eOW.js +0 -20986
  870. package/lib/index-P4-KqpEN.js +0 -275
  871. package/lib/index-Qcks_HSE.js +0 -984
  872. package/lib/index-RKThEh9x.js +0 -517
  873. package/lib/index-UqF8o9eD.js +0 -19665
  874. package/lib/index-_VrGF4z-.js +0 -47
  875. package/lib/index-cteyPSwp.js +0 -83
  876. package/lib/index-f0pbmfJP.js +0 -64
  877. package/lib/index-gMYRN2wV.js +0 -107
  878. package/lib/index-jZuF1Iix.js +0 -146
  879. package/lib/index-kyD7hUif.js +0 -141
  880. package/lib/index-oszOFbwW.js +0 -1041
  881. package/lib/index-pC1MPpe2.js +0 -1744
  882. package/lib/index-q3iu4cef.js +0 -78
  883. package/lib/index-qMeqmZtK.js +0 -168
  884. package/lib/index-rs4SJ8Gd.js +0 -253
  885. package/lib/index-w-CiezW1.js +0 -135
  886. package/lib/index-x6C6leag.js +0 -99
  887. package/lib/index-xHADmDT3.js +0 -12
  888. package/lib/index-xa7wUurf.js +0 -8
  889. package/lib/index-xjkoF_Bn.js +0 -317
  890. package/lib/index-yrfirMbY.js +0 -551
  891. package/lib/index-zNGl_CdN.js +0 -8
  892. package/lib/index-zc51oyS8.js +0 -121
  893. package/lib/index.d.ts +0 -4
  894. package/lib/index.d.ts.map +0 -1
  895. package/lib/index.es.js +0 -7
  896. package/lib/javascript-8ZHqHagw.js +0 -758
  897. package/lib/jinja2-vsOFe0qD.js +0 -154
  898. package/lib/julia-dlp_pbN1.js +0 -241
  899. package/lib/livescript-Gf5R-LT6.js +0 -273
  900. package/lib/lua-c5Y_JsBp.js +0 -221
  901. package/lib/mathematica-iiGTGmUs.js +0 -35
  902. package/lib/mbox-ZJh86H8B.js +0 -78
  903. package/lib/meta-tAGyVRPE.js +0 -511
  904. package/lib/mirc-i0qkCa0y.js +0 -73
  905. package/lib/mllike-Dy551fZW.js +0 -275
  906. package/lib/modelica-n6tGqUT9.js +0 -94
  907. package/lib/mscgen-aKSbB7D9.js +0 -104
  908. package/lib/mumps-lNiKA6sp.js +0 -25
  909. package/lib/nginx--YmuCfDj.js +0 -93
  910. package/lib/nsis-zhS8iA09.js +0 -62
  911. package/lib/ntriples-E3jQl3MC.js +0 -79
  912. package/lib/octave-EQvkGIeG.js +0 -144
  913. package/lib/oz-W2cpqFf6.js +0 -152
  914. package/lib/pascal-lCh6ouNZ.js +0 -79
  915. package/lib/perl-PxEQBX0B.js +0 -915
  916. package/lib/pig-Y_bNcrzS.js +0 -56
  917. package/lib/powershell-GaQP-TZr.js +0 -249
  918. package/lib/properties-mbRyn54L.js +0 -26
  919. package/lib/prosemirror-noTDkx-k.js +0 -4
  920. package/lib/protobuf-8CJideyJ.js +0 -49
  921. package/lib/puppet-ABBaChNZ.js +0 -45
  922. package/lib/python-sKdHg3Ka.js +0 -321
  923. package/lib/q-_1yG40Nm.js +0 -89
  924. package/lib/r-Ziz56bHT.js +0 -108
  925. package/lib/rpm-ORjGOHaQ.js +0 -57
  926. package/lib/ruby-jlbYq0dT.js +0 -233
  927. package/lib/sas-2n7xeUuO.js +0 -107
  928. package/lib/schema-ywm7RaKF.js +0 -62
  929. package/lib/scheme-XCs-NPeU.js +0 -126
  930. package/lib/shell-0_1Um7Dq.js +0 -184
  931. package/lib/sieve-7uyJD1x1.js +0 -73
  932. package/lib/simple-mode--HIzBxba.js +0 -95
  933. package/lib/smalltalk-PEFzrlQ-.js +0 -48
  934. package/lib/solr-BLBaHahN.js +0 -41
  935. package/lib/sparql-4F9ZWf1b.js +0 -204
  936. package/lib/spreadsheet-SGSo6blj.js +0 -49
  937. package/lib/sql-tebLBzN0.js +0 -291
  938. package/lib/stex-SFJcFGOO.js +0 -130
  939. package/lib/stylus-rwwWYWFm.js +0 -256
  940. package/lib/swift-eorJ0tCv.js +0 -238
  941. package/lib/tcl-IwXMB8U4.js +0 -82
  942. package/lib/textile-ok2VyjwC.js +0 -299
  943. package/lib/theme/classic/index.d.ts +0 -3
  944. package/lib/theme/classic/index.d.ts.map +0 -1
  945. package/lib/theme/classic-dark/index.d.ts +0 -3
  946. package/lib/theme/classic-dark/index.d.ts.map +0 -1
  947. package/lib/theme/headless/index.d.ts +0 -3
  948. package/lib/theme/headless/index.d.ts.map +0 -1
  949. package/lib/theme/index.d.ts +0 -8
  950. package/lib/theme/index.d.ts.map +0 -1
  951. package/lib/theme/shared.d.ts +0 -3
  952. package/lib/theme/shared.d.ts.map +0 -1
  953. package/lib/tiddlywiki-DLhz8_pc.js +0 -156
  954. package/lib/tiki-DFAqFElY.js +0 -183
  955. package/lib/tippy.esm-4ny8MQOF.js +0 -1813
  956. package/lib/toml-ryxpTZEV.js +0 -49
  957. package/lib/tooltip-plugin-NpyG8C5u.js +0 -122
  958. package/lib/troff-ZzZyvNct.js +0 -36
  959. package/lib/ttcn-6gvkqqpW.js +0 -136
  960. package/lib/ttcn-cfg-oSu-Dq5C.js +0 -98
  961. package/lib/turtle-10ofr5au.js +0 -87
  962. package/lib/utils/index.d.ts +0 -4
  963. package/lib/utils/index.d.ts.map +0 -1
  964. package/lib/vb-a6n6fzrD.js +0 -74
  965. package/lib/vbscript-dgvo8jPt.js +0 -324
  966. package/lib/velocity-CBncCrwO.js +0 -97
  967. package/lib/verilog-KlcACt6C.js +0 -271
  968. package/lib/vhdl-NMd7Gf35.js +0 -117
  969. package/lib/webidl-z1UE5DN_.js +0 -160
  970. package/lib/xquery-hDt5jWTp.js +0 -431
  971. package/lib/yacas-ftgh_qwr.js +0 -74
  972. package/lib/z80-dA1PqWe1.js +0 -62
  973. package/src/feature/block-edit/menu/icons.ts +0 -171
  974. package/src/feature/block-edit/style.css +0 -126
  975. package/src/feature/code-mirror/style.css +0 -159
  976. package/src/feature/gap-cursor/index.ts +0 -31
  977. package/src/feature/image-block/style.css +0 -215
  978. package/src/feature/link-tooltip/consts.ts +0 -47
  979. package/src/feature/link-tooltip/style.css +0 -107
  980. package/src/feature/list-item/consts.ts +0 -15
  981. package/src/feature/list-item/style.css +0 -23
  982. package/src/feature/toolbar/consts.ts +0 -26
  983. package/src/feature/toolbar/style.css +0 -37
  984. package/src/theme/classic/index.ts +0 -12
  985. package/src/theme/classic/style.css +0 -192
  986. package/src/theme/classic-dark/index.ts +0 -12
  987. package/src/theme/classic-dark/style.css +0 -197
  988. package/src/theme/headless/index.ts +0 -9
  989. package/src/theme/index.ts +0 -26
  990. package/src/theme/shared.ts +0 -4
  991. /package/src/{feature/placeholder/style.css → theme/common/placeholder.css} +0 -0
@@ -0,0 +1,1872 @@
1
+ import { P as Parser, o as NodeSet, N as NodeType, K as DefaultBufferLength, n as NodeProp, q as Tree, I as IterMode } from './index-i79QMXpJ.js';
2
+
3
+ /**
4
+ A parse stack. These are used internally by the parser to track
5
+ parsing progress. They also provide some properties and methods
6
+ that external code such as a tokenizer can use to get information
7
+ about the parse state.
8
+ */
9
+ class Stack {
10
+ /**
11
+ @internal
12
+ */
13
+ constructor(
14
+ /**
15
+ The parse that this stack is part of @internal
16
+ */
17
+ p,
18
+ /**
19
+ Holds state, input pos, buffer index triplets for all but the
20
+ top state @internal
21
+ */
22
+ stack,
23
+ /**
24
+ The current parse state @internal
25
+ */
26
+ state,
27
+ // The position at which the next reduce should take place. This
28
+ // can be less than `this.pos` when skipped expressions have been
29
+ // added to the stack (which should be moved outside of the next
30
+ // reduction)
31
+ /**
32
+ @internal
33
+ */
34
+ reducePos,
35
+ /**
36
+ The input position up to which this stack has parsed.
37
+ */
38
+ pos,
39
+ /**
40
+ The dynamic score of the stack, including dynamic precedence
41
+ and error-recovery penalties
42
+ @internal
43
+ */
44
+ score,
45
+ // The output buffer. Holds (type, start, end, size) quads
46
+ // representing nodes created by the parser, where `size` is
47
+ // amount of buffer array entries covered by this node.
48
+ /**
49
+ @internal
50
+ */
51
+ buffer,
52
+ // The base offset of the buffer. When stacks are split, the split
53
+ // instance shared the buffer history with its parent up to
54
+ // `bufferBase`, which is the absolute offset (including the
55
+ // offset of previous splits) into the buffer at which this stack
56
+ // starts writing.
57
+ /**
58
+ @internal
59
+ */
60
+ bufferBase,
61
+ /**
62
+ @internal
63
+ */
64
+ curContext,
65
+ /**
66
+ @internal
67
+ */
68
+ lookAhead = 0,
69
+ // A parent stack from which this was split off, if any. This is
70
+ // set up so that it always points to a stack that has some
71
+ // additional buffer content, never to a stack with an equal
72
+ // `bufferBase`.
73
+ /**
74
+ @internal
75
+ */
76
+ parent) {
77
+ this.p = p;
78
+ this.stack = stack;
79
+ this.state = state;
80
+ this.reducePos = reducePos;
81
+ this.pos = pos;
82
+ this.score = score;
83
+ this.buffer = buffer;
84
+ this.bufferBase = bufferBase;
85
+ this.curContext = curContext;
86
+ this.lookAhead = lookAhead;
87
+ this.parent = parent;
88
+ }
89
+ /**
90
+ @internal
91
+ */
92
+ toString() {
93
+ return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
94
+ }
95
+ // Start an empty stack
96
+ /**
97
+ @internal
98
+ */
99
+ static start(p, state, pos = 0) {
100
+ let cx = p.parser.context;
101
+ return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
102
+ }
103
+ /**
104
+ The stack's current [context](#lr.ContextTracker) value, if
105
+ any. Its type will depend on the context tracker's type
106
+ parameter, or it will be `null` if there is no context
107
+ tracker.
108
+ */
109
+ get context() { return this.curContext ? this.curContext.context : null; }
110
+ // Push a state onto the stack, tracking its start position as well
111
+ // as the buffer base at that point.
112
+ /**
113
+ @internal
114
+ */
115
+ pushState(state, start) {
116
+ this.stack.push(this.state, start, this.bufferBase + this.buffer.length);
117
+ this.state = state;
118
+ }
119
+ // Apply a reduce action
120
+ /**
121
+ @internal
122
+ */
123
+ reduce(action) {
124
+ var _a;
125
+ let depth = action >> 19 /* Action.ReduceDepthShift */, type = action & 65535 /* Action.ValueMask */;
126
+ let { parser } = this.p;
127
+ let dPrec = parser.dynamicPrecedence(type);
128
+ if (dPrec)
129
+ this.score += dPrec;
130
+ if (depth == 0) {
131
+ this.pushState(parser.getGoto(this.state, type, true), this.reducePos);
132
+ // Zero-depth reductions are a special case—they add stuff to
133
+ // the stack without popping anything off.
134
+ if (type < parser.minRepeatTerm)
135
+ this.storeNode(type, this.reducePos, this.reducePos, 4, true);
136
+ this.reduceContext(type, this.reducePos);
137
+ return;
138
+ }
139
+ // Find the base index into `this.stack`, content after which will
140
+ // be dropped. Note that with `StayFlag` reductions we need to
141
+ // consume two extra frames (the dummy parent node for the skipped
142
+ // expression and the state that we'll be staying in, which should
143
+ // be moved to `this.state`).
144
+ let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);
145
+ let start = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start;
146
+ // This is a kludge to try and detect overly deep left-associative
147
+ // trees, which will not increase the parse stack depth and thus
148
+ // won't be caught by the regular stack-depth limit check.
149
+ if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {
150
+ if (start == this.p.lastBigReductionStart) {
151
+ this.p.bigReductionCount++;
152
+ this.p.lastBigReductionSize = size;
153
+ }
154
+ else if (this.p.lastBigReductionSize < size) {
155
+ this.p.bigReductionCount = 1;
156
+ this.p.lastBigReductionStart = start;
157
+ this.p.lastBigReductionSize = size;
158
+ }
159
+ }
160
+ let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;
161
+ // Store normal terms or `R -> R R` repeat reductions
162
+ if (type < parser.minRepeatTerm || (action & 131072 /* Action.RepeatFlag */)) {
163
+ let pos = parser.stateFlag(this.state, 1 /* StateFlag.Skipped */) ? this.pos : this.reducePos;
164
+ this.storeNode(type, start, pos, count + 4, true);
165
+ }
166
+ if (action & 262144 /* Action.StayFlag */) {
167
+ this.state = this.stack[base];
168
+ }
169
+ else {
170
+ let baseStateID = this.stack[base - 3];
171
+ this.state = parser.getGoto(baseStateID, type, true);
172
+ }
173
+ while (this.stack.length > base)
174
+ this.stack.pop();
175
+ this.reduceContext(type, start);
176
+ }
177
+ // Shift a value into the buffer
178
+ /**
179
+ @internal
180
+ */
181
+ storeNode(term, start, end, size = 4, isReduce = false) {
182
+ if (term == 0 /* Term.Err */ &&
183
+ (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
184
+ // Try to omit/merge adjacent error nodes
185
+ let cur = this, top = this.buffer.length;
186
+ if (top == 0 && cur.parent) {
187
+ top = cur.bufferBase - cur.parent.bufferBase;
188
+ cur = cur.parent;
189
+ }
190
+ if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {
191
+ if (start == end)
192
+ return;
193
+ if (cur.buffer[top - 2] >= start) {
194
+ cur.buffer[top - 2] = end;
195
+ return;
196
+ }
197
+ }
198
+ }
199
+ if (!isReduce || this.pos == end) { // Simple case, just append
200
+ this.buffer.push(term, start, end, size);
201
+ }
202
+ else { // There may be skipped nodes that have to be moved forward
203
+ let index = this.buffer.length;
204
+ if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */)
205
+ while (index > 0 && this.buffer[index - 2] > end) {
206
+ // Move this record forward
207
+ this.buffer[index] = this.buffer[index - 4];
208
+ this.buffer[index + 1] = this.buffer[index - 3];
209
+ this.buffer[index + 2] = this.buffer[index - 2];
210
+ this.buffer[index + 3] = this.buffer[index - 1];
211
+ index -= 4;
212
+ if (size > 4)
213
+ size -= 4;
214
+ }
215
+ this.buffer[index] = term;
216
+ this.buffer[index + 1] = start;
217
+ this.buffer[index + 2] = end;
218
+ this.buffer[index + 3] = size;
219
+ }
220
+ }
221
+ // Apply a shift action
222
+ /**
223
+ @internal
224
+ */
225
+ shift(action, type, start, end) {
226
+ if (action & 131072 /* Action.GotoFlag */) {
227
+ this.pushState(action & 65535 /* Action.ValueMask */, this.pos);
228
+ }
229
+ else if ((action & 262144 /* Action.StayFlag */) == 0) { // Regular shift
230
+ let nextState = action, { parser } = this.p;
231
+ if (end > this.pos || type <= parser.maxNode) {
232
+ this.pos = end;
233
+ if (!parser.stateFlag(nextState, 1 /* StateFlag.Skipped */))
234
+ this.reducePos = end;
235
+ }
236
+ this.pushState(nextState, start);
237
+ this.shiftContext(type, start);
238
+ if (type <= parser.maxNode)
239
+ this.buffer.push(type, start, end, 4);
240
+ }
241
+ else { // Shift-and-stay, which means this is a skipped token
242
+ this.pos = end;
243
+ this.shiftContext(type, start);
244
+ if (type <= this.p.parser.maxNode)
245
+ this.buffer.push(type, start, end, 4);
246
+ }
247
+ }
248
+ // Apply an action
249
+ /**
250
+ @internal
251
+ */
252
+ apply(action, next, nextStart, nextEnd) {
253
+ if (action & 65536 /* Action.ReduceFlag */)
254
+ this.reduce(action);
255
+ else
256
+ this.shift(action, next, nextStart, nextEnd);
257
+ }
258
+ // Add a prebuilt (reused) node into the buffer.
259
+ /**
260
+ @internal
261
+ */
262
+ useNode(value, next) {
263
+ let index = this.p.reused.length - 1;
264
+ if (index < 0 || this.p.reused[index] != value) {
265
+ this.p.reused.push(value);
266
+ index++;
267
+ }
268
+ let start = this.pos;
269
+ this.reducePos = this.pos = start + value.length;
270
+ this.pushState(next, start);
271
+ this.buffer.push(index, start, this.reducePos, -1 /* size == -1 means this is a reused value */);
272
+ if (this.curContext)
273
+ this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));
274
+ }
275
+ // Split the stack. Due to the buffer sharing and the fact
276
+ // that `this.stack` tends to stay quite shallow, this isn't very
277
+ // expensive.
278
+ /**
279
+ @internal
280
+ */
281
+ split() {
282
+ let parent = this;
283
+ let off = parent.buffer.length;
284
+ // Because the top of the buffer (after this.pos) may be mutated
285
+ // to reorder reductions and skipped tokens, and shared buffers
286
+ // should be immutable, this copies any outstanding skipped tokens
287
+ // to the new buffer, and puts the base pointer before them.
288
+ while (off > 0 && parent.buffer[off - 2] > parent.reducePos)
289
+ off -= 4;
290
+ let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;
291
+ // Make sure parent points to an actual parent with content, if there is such a parent.
292
+ while (parent && base == parent.bufferBase)
293
+ parent = parent.parent;
294
+ return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
295
+ }
296
+ // Try to recover from an error by 'deleting' (ignoring) one token.
297
+ /**
298
+ @internal
299
+ */
300
+ recoverByDelete(next, nextEnd) {
301
+ let isNode = next <= this.p.parser.maxNode;
302
+ if (isNode)
303
+ this.storeNode(next, this.pos, nextEnd, 4);
304
+ this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4);
305
+ this.pos = this.reducePos = nextEnd;
306
+ this.score -= 190 /* Recover.Delete */;
307
+ }
308
+ /**
309
+ Check if the given term would be able to be shifted (optionally
310
+ after some reductions) on this stack. This can be useful for
311
+ external tokenizers that want to make sure they only provide a
312
+ given token when it applies.
313
+ */
314
+ canShift(term) {
315
+ for (let sim = new SimulatedStack(this);;) {
316
+ let action = this.p.parser.stateSlot(sim.state, 4 /* ParseState.DefaultReduce */) || this.p.parser.hasAction(sim.state, term);
317
+ if (action == 0)
318
+ return false;
319
+ if ((action & 65536 /* Action.ReduceFlag */) == 0)
320
+ return true;
321
+ sim.reduce(action);
322
+ }
323
+ }
324
+ // Apply up to Recover.MaxNext recovery actions that conceptually
325
+ // inserts some missing token or rule.
326
+ /**
327
+ @internal
328
+ */
329
+ recoverByInsert(next) {
330
+ if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */)
331
+ return [];
332
+ let nextStates = this.p.parser.nextStates(this.state);
333
+ if (nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDepth */) {
334
+ let best = [];
335
+ for (let i = 0, s; i < nextStates.length; i += 2) {
336
+ if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))
337
+ best.push(nextStates[i], s);
338
+ }
339
+ if (this.stack.length < 120 /* Recover.DampenInsertStackDepth */)
340
+ for (let i = 0; best.length < 4 /* Recover.MaxNext */ << 1 && i < nextStates.length; i += 2) {
341
+ let s = nextStates[i + 1];
342
+ if (!best.some((v, i) => (i & 1) && v == s))
343
+ best.push(nextStates[i], s);
344
+ }
345
+ nextStates = best;
346
+ }
347
+ let result = [];
348
+ for (let i = 0; i < nextStates.length && result.length < 4 /* Recover.MaxNext */; i += 2) {
349
+ let s = nextStates[i + 1];
350
+ if (s == this.state)
351
+ continue;
352
+ let stack = this.split();
353
+ stack.pushState(s, this.pos);
354
+ stack.storeNode(0 /* Term.Err */, stack.pos, stack.pos, 4, true);
355
+ stack.shiftContext(nextStates[i], this.pos);
356
+ stack.reducePos = this.pos;
357
+ stack.score -= 200 /* Recover.Insert */;
358
+ result.push(stack);
359
+ }
360
+ return result;
361
+ }
362
+ // Force a reduce, if possible. Return false if that can't
363
+ // be done.
364
+ /**
365
+ @internal
366
+ */
367
+ forceReduce() {
368
+ let { parser } = this.p;
369
+ let reduce = parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);
370
+ if ((reduce & 65536 /* Action.ReduceFlag */) == 0)
371
+ return false;
372
+ if (!parser.validAction(this.state, reduce)) {
373
+ let depth = reduce >> 19 /* Action.ReduceDepthShift */, term = reduce & 65535 /* Action.ValueMask */;
374
+ let target = this.stack.length - depth * 3;
375
+ if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {
376
+ let backup = this.findForcedReduction();
377
+ if (backup == null)
378
+ return false;
379
+ reduce = backup;
380
+ }
381
+ this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
382
+ this.score -= 100 /* Recover.Reduce */;
383
+ }
384
+ this.reducePos = this.pos;
385
+ this.reduce(reduce);
386
+ return true;
387
+ }
388
+ /**
389
+ Try to scan through the automaton to find some kind of reduction
390
+ that can be applied. Used when the regular ForcedReduce field
391
+ isn't a valid action. @internal
392
+ */
393
+ findForcedReduction() {
394
+ let { parser } = this.p, seen = [];
395
+ let explore = (state, depth) => {
396
+ if (seen.includes(state))
397
+ return;
398
+ seen.push(state);
399
+ return parser.allActions(state, (action) => {
400
+ if (action & (262144 /* Action.StayFlag */ | 131072 /* Action.GotoFlag */)) ;
401
+ else if (action & 65536 /* Action.ReduceFlag */) {
402
+ let rDepth = (action >> 19 /* Action.ReduceDepthShift */) - depth;
403
+ if (rDepth > 1) {
404
+ let term = action & 65535 /* Action.ValueMask */, target = this.stack.length - rDepth * 3;
405
+ if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0)
406
+ return (rDepth << 19 /* Action.ReduceDepthShift */) | 65536 /* Action.ReduceFlag */ | term;
407
+ }
408
+ }
409
+ else {
410
+ let found = explore(action, depth + 1);
411
+ if (found != null)
412
+ return found;
413
+ }
414
+ });
415
+ };
416
+ return explore(this.state, 0);
417
+ }
418
+ /**
419
+ @internal
420
+ */
421
+ forceAll() {
422
+ while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {
423
+ if (!this.forceReduce()) {
424
+ this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
425
+ break;
426
+ }
427
+ }
428
+ return this;
429
+ }
430
+ /**
431
+ Check whether this state has no further actions (assumed to be a direct descendant of the
432
+ top state, since any other states must be able to continue
433
+ somehow). @internal
434
+ */
435
+ get deadEnd() {
436
+ if (this.stack.length != 3)
437
+ return false;
438
+ let { parser } = this.p;
439
+ return parser.data[parser.stateSlot(this.state, 1 /* ParseState.Actions */)] == 65535 /* Seq.End */ &&
440
+ !parser.stateSlot(this.state, 4 /* ParseState.DefaultReduce */);
441
+ }
442
+ /**
443
+ Restart the stack (put it back in its start state). Only safe
444
+ when this.stack.length == 3 (state is directly below the top
445
+ state). @internal
446
+ */
447
+ restart() {
448
+ this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
449
+ this.state = this.stack[0];
450
+ this.stack.length = 0;
451
+ }
452
+ /**
453
+ @internal
454
+ */
455
+ sameState(other) {
456
+ if (this.state != other.state || this.stack.length != other.stack.length)
457
+ return false;
458
+ for (let i = 0; i < this.stack.length; i += 3)
459
+ if (this.stack[i] != other.stack[i])
460
+ return false;
461
+ return true;
462
+ }
463
+ /**
464
+ Get the parser used by this stack.
465
+ */
466
+ get parser() { return this.p.parser; }
467
+ /**
468
+ Test whether a given dialect (by numeric ID, as exported from
469
+ the terms file) is enabled.
470
+ */
471
+ dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }
472
+ shiftContext(term, start) {
473
+ if (this.curContext)
474
+ this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));
475
+ }
476
+ reduceContext(term, start) {
477
+ if (this.curContext)
478
+ this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));
479
+ }
480
+ /**
481
+ @internal
482
+ */
483
+ emitContext() {
484
+ let last = this.buffer.length - 1;
485
+ if (last < 0 || this.buffer[last] != -3)
486
+ this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
487
+ }
488
+ /**
489
+ @internal
490
+ */
491
+ emitLookAhead() {
492
+ let last = this.buffer.length - 1;
493
+ if (last < 0 || this.buffer[last] != -4)
494
+ this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
495
+ }
496
+ updateContext(context) {
497
+ if (context != this.curContext.context) {
498
+ let newCx = new StackContext(this.curContext.tracker, context);
499
+ if (newCx.hash != this.curContext.hash)
500
+ this.emitContext();
501
+ this.curContext = newCx;
502
+ }
503
+ }
504
+ /**
505
+ @internal
506
+ */
507
+ setLookAhead(lookAhead) {
508
+ if (lookAhead > this.lookAhead) {
509
+ this.emitLookAhead();
510
+ this.lookAhead = lookAhead;
511
+ }
512
+ }
513
+ /**
514
+ @internal
515
+ */
516
+ close() {
517
+ if (this.curContext && this.curContext.tracker.strict)
518
+ this.emitContext();
519
+ if (this.lookAhead > 0)
520
+ this.emitLookAhead();
521
+ }
522
+ }
523
+ class StackContext {
524
+ constructor(tracker, context) {
525
+ this.tracker = tracker;
526
+ this.context = context;
527
+ this.hash = tracker.strict ? tracker.hash(context) : 0;
528
+ }
529
+ }
530
+ // Used to cheaply run some reductions to scan ahead without mutating
531
+ // an entire stack
532
+ class SimulatedStack {
533
+ constructor(start) {
534
+ this.start = start;
535
+ this.state = start.state;
536
+ this.stack = start.stack;
537
+ this.base = this.stack.length;
538
+ }
539
+ reduce(action) {
540
+ let term = action & 65535 /* Action.ValueMask */, depth = action >> 19 /* Action.ReduceDepthShift */;
541
+ if (depth == 0) {
542
+ if (this.stack == this.start.stack)
543
+ this.stack = this.stack.slice();
544
+ this.stack.push(this.state, 0, 0);
545
+ this.base += 3;
546
+ }
547
+ else {
548
+ this.base -= (depth - 1) * 3;
549
+ }
550
+ let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
551
+ this.state = goto;
552
+ }
553
+ }
554
+ // This is given to `Tree.build` to build a buffer, and encapsulates
555
+ // the parent-stack-walking necessary to read the nodes.
556
+ class StackBufferCursor {
557
+ constructor(stack, pos, index) {
558
+ this.stack = stack;
559
+ this.pos = pos;
560
+ this.index = index;
561
+ this.buffer = stack.buffer;
562
+ if (this.index == 0)
563
+ this.maybeNext();
564
+ }
565
+ static create(stack, pos = stack.bufferBase + stack.buffer.length) {
566
+ return new StackBufferCursor(stack, pos, pos - stack.bufferBase);
567
+ }
568
+ maybeNext() {
569
+ let next = this.stack.parent;
570
+ if (next != null) {
571
+ this.index = this.stack.bufferBase - next.bufferBase;
572
+ this.stack = next;
573
+ this.buffer = next.buffer;
574
+ }
575
+ }
576
+ get id() { return this.buffer[this.index - 4]; }
577
+ get start() { return this.buffer[this.index - 3]; }
578
+ get end() { return this.buffer[this.index - 2]; }
579
+ get size() { return this.buffer[this.index - 1]; }
580
+ next() {
581
+ this.index -= 4;
582
+ this.pos -= 4;
583
+ if (this.index == 0)
584
+ this.maybeNext();
585
+ }
586
+ fork() {
587
+ return new StackBufferCursor(this.stack, this.pos, this.index);
588
+ }
589
+ }
590
+
591
+ // See lezer-generator/src/encode.ts for comments about the encoding
592
+ // used here
593
+ function decodeArray(input, Type = Uint16Array) {
594
+ if (typeof input != "string")
595
+ return input;
596
+ let array = null;
597
+ for (let pos = 0, out = 0; pos < input.length;) {
598
+ let value = 0;
599
+ for (;;) {
600
+ let next = input.charCodeAt(pos++), stop = false;
601
+ if (next == 126 /* Encode.BigValCode */) {
602
+ value = 65535 /* Encode.BigVal */;
603
+ break;
604
+ }
605
+ if (next >= 92 /* Encode.Gap2 */)
606
+ next--;
607
+ if (next >= 34 /* Encode.Gap1 */)
608
+ next--;
609
+ let digit = next - 32 /* Encode.Start */;
610
+ if (digit >= 46 /* Encode.Base */) {
611
+ digit -= 46 /* Encode.Base */;
612
+ stop = true;
613
+ }
614
+ value += digit;
615
+ if (stop)
616
+ break;
617
+ value *= 46 /* Encode.Base */;
618
+ }
619
+ if (array)
620
+ array[out++] = value;
621
+ else
622
+ array = new Type(value);
623
+ }
624
+ return array;
625
+ }
626
+
627
+ class CachedToken {
628
+ constructor() {
629
+ this.start = -1;
630
+ this.value = -1;
631
+ this.end = -1;
632
+ this.extended = -1;
633
+ this.lookAhead = 0;
634
+ this.mask = 0;
635
+ this.context = 0;
636
+ }
637
+ }
638
+ const nullToken = new CachedToken;
639
+ /**
640
+ [Tokenizers](#lr.ExternalTokenizer) interact with the input
641
+ through this interface. It presents the input as a stream of
642
+ characters, tracking lookahead and hiding the complexity of
643
+ [ranges](#common.Parser.parse^ranges) from tokenizer code.
644
+ */
645
+ class InputStream {
646
+ /**
647
+ @internal
648
+ */
649
+ constructor(
650
+ /**
651
+ @internal
652
+ */
653
+ input,
654
+ /**
655
+ @internal
656
+ */
657
+ ranges) {
658
+ this.input = input;
659
+ this.ranges = ranges;
660
+ /**
661
+ @internal
662
+ */
663
+ this.chunk = "";
664
+ /**
665
+ @internal
666
+ */
667
+ this.chunkOff = 0;
668
+ /**
669
+ Backup chunk
670
+ */
671
+ this.chunk2 = "";
672
+ this.chunk2Pos = 0;
673
+ /**
674
+ The character code of the next code unit in the input, or -1
675
+ when the stream is at the end of the input.
676
+ */
677
+ this.next = -1;
678
+ /**
679
+ @internal
680
+ */
681
+ this.token = nullToken;
682
+ this.rangeIndex = 0;
683
+ this.pos = this.chunkPos = ranges[0].from;
684
+ this.range = ranges[0];
685
+ this.end = ranges[ranges.length - 1].to;
686
+ this.readNext();
687
+ }
688
+ /**
689
+ @internal
690
+ */
691
+ resolveOffset(offset, assoc) {
692
+ let range = this.range, index = this.rangeIndex;
693
+ let pos = this.pos + offset;
694
+ while (pos < range.from) {
695
+ if (!index)
696
+ return null;
697
+ let next = this.ranges[--index];
698
+ pos -= range.from - next.to;
699
+ range = next;
700
+ }
701
+ while (assoc < 0 ? pos > range.to : pos >= range.to) {
702
+ if (index == this.ranges.length - 1)
703
+ return null;
704
+ let next = this.ranges[++index];
705
+ pos += next.from - range.to;
706
+ range = next;
707
+ }
708
+ return pos;
709
+ }
710
+ /**
711
+ @internal
712
+ */
713
+ clipPos(pos) {
714
+ if (pos >= this.range.from && pos < this.range.to)
715
+ return pos;
716
+ for (let range of this.ranges)
717
+ if (range.to > pos)
718
+ return Math.max(pos, range.from);
719
+ return this.end;
720
+ }
721
+ /**
722
+ Look at a code unit near the stream position. `.peek(0)` equals
723
+ `.next`, `.peek(-1)` gives you the previous character, and so
724
+ on.
725
+
726
+ Note that looking around during tokenizing creates dependencies
727
+ on potentially far-away content, which may reduce the
728
+ effectiveness incremental parsing—when looking forward—or even
729
+ cause invalid reparses when looking backward more than 25 code
730
+ units, since the library does not track lookbehind.
731
+ */
732
+ peek(offset) {
733
+ let idx = this.chunkOff + offset, pos, result;
734
+ if (idx >= 0 && idx < this.chunk.length) {
735
+ pos = this.pos + offset;
736
+ result = this.chunk.charCodeAt(idx);
737
+ }
738
+ else {
739
+ let resolved = this.resolveOffset(offset, 1);
740
+ if (resolved == null)
741
+ return -1;
742
+ pos = resolved;
743
+ if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
744
+ result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
745
+ }
746
+ else {
747
+ let i = this.rangeIndex, range = this.range;
748
+ while (range.to <= pos)
749
+ range = this.ranges[++i];
750
+ this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
751
+ if (pos + this.chunk2.length > range.to)
752
+ this.chunk2 = this.chunk2.slice(0, range.to - pos);
753
+ result = this.chunk2.charCodeAt(0);
754
+ }
755
+ }
756
+ if (pos >= this.token.lookAhead)
757
+ this.token.lookAhead = pos + 1;
758
+ return result;
759
+ }
760
+ /**
761
+ Accept a token. By default, the end of the token is set to the
762
+ current stream position, but you can pass an offset (relative to
763
+ the stream position) to change that.
764
+ */
765
+ acceptToken(token, endOffset = 0) {
766
+ let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;
767
+ if (end == null || end < this.token.start)
768
+ throw new RangeError("Token end out of bounds");
769
+ this.token.value = token;
770
+ this.token.end = end;
771
+ }
772
+ /**
773
+ Accept a token ending at a specific given position.
774
+ */
775
+ acceptTokenTo(token, endPos) {
776
+ this.token.value = token;
777
+ this.token.end = endPos;
778
+ }
779
+ getChunk() {
780
+ if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
781
+ let { chunk, chunkPos } = this;
782
+ this.chunk = this.chunk2;
783
+ this.chunkPos = this.chunk2Pos;
784
+ this.chunk2 = chunk;
785
+ this.chunk2Pos = chunkPos;
786
+ this.chunkOff = this.pos - this.chunkPos;
787
+ }
788
+ else {
789
+ this.chunk2 = this.chunk;
790
+ this.chunk2Pos = this.chunkPos;
791
+ let nextChunk = this.input.chunk(this.pos);
792
+ let end = this.pos + nextChunk.length;
793
+ this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
794
+ this.chunkPos = this.pos;
795
+ this.chunkOff = 0;
796
+ }
797
+ }
798
+ readNext() {
799
+ if (this.chunkOff >= this.chunk.length) {
800
+ this.getChunk();
801
+ if (this.chunkOff == this.chunk.length)
802
+ return this.next = -1;
803
+ }
804
+ return this.next = this.chunk.charCodeAt(this.chunkOff);
805
+ }
806
+ /**
807
+ Move the stream forward N (defaults to 1) code units. Returns
808
+ the new value of [`next`](#lr.InputStream.next).
809
+ */
810
+ advance(n = 1) {
811
+ this.chunkOff += n;
812
+ while (this.pos + n >= this.range.to) {
813
+ if (this.rangeIndex == this.ranges.length - 1)
814
+ return this.setDone();
815
+ n -= this.range.to - this.pos;
816
+ this.range = this.ranges[++this.rangeIndex];
817
+ this.pos = this.range.from;
818
+ }
819
+ this.pos += n;
820
+ if (this.pos >= this.token.lookAhead)
821
+ this.token.lookAhead = this.pos + 1;
822
+ return this.readNext();
823
+ }
824
+ setDone() {
825
+ this.pos = this.chunkPos = this.end;
826
+ this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];
827
+ this.chunk = "";
828
+ return this.next = -1;
829
+ }
830
+ /**
831
+ @internal
832
+ */
833
+ reset(pos, token) {
834
+ if (token) {
835
+ this.token = token;
836
+ token.start = pos;
837
+ token.lookAhead = pos + 1;
838
+ token.value = token.extended = -1;
839
+ }
840
+ else {
841
+ this.token = nullToken;
842
+ }
843
+ if (this.pos != pos) {
844
+ this.pos = pos;
845
+ if (pos == this.end) {
846
+ this.setDone();
847
+ return this;
848
+ }
849
+ while (pos < this.range.from)
850
+ this.range = this.ranges[--this.rangeIndex];
851
+ while (pos >= this.range.to)
852
+ this.range = this.ranges[++this.rangeIndex];
853
+ if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {
854
+ this.chunkOff = pos - this.chunkPos;
855
+ }
856
+ else {
857
+ this.chunk = "";
858
+ this.chunkOff = 0;
859
+ }
860
+ this.readNext();
861
+ }
862
+ return this;
863
+ }
864
+ /**
865
+ @internal
866
+ */
867
+ read(from, to) {
868
+ if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)
869
+ return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);
870
+ if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)
871
+ return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
872
+ if (from >= this.range.from && to <= this.range.to)
873
+ return this.input.read(from, to);
874
+ let result = "";
875
+ for (let r of this.ranges) {
876
+ if (r.from >= to)
877
+ break;
878
+ if (r.to > from)
879
+ result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
880
+ }
881
+ return result;
882
+ }
883
+ }
884
+ /**
885
+ @internal
886
+ */
887
+ class TokenGroup {
888
+ constructor(data, id) {
889
+ this.data = data;
890
+ this.id = id;
891
+ }
892
+ token(input, stack) {
893
+ let { parser } = stack.p;
894
+ readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);
895
+ }
896
+ }
897
+ TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
898
+ /**
899
+ @hide
900
+ */
901
+ class LocalTokenGroup {
902
+ constructor(data, precTable, elseToken) {
903
+ this.precTable = precTable;
904
+ this.elseToken = elseToken;
905
+ this.data = typeof data == "string" ? decodeArray(data) : data;
906
+ }
907
+ token(input, stack) {
908
+ let start = input.pos, skipped = 0;
909
+ for (;;) {
910
+ let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);
911
+ readToken(this.data, input, stack, 0, this.data, this.precTable);
912
+ if (input.token.value > -1)
913
+ break;
914
+ if (this.elseToken == null)
915
+ return;
916
+ if (!atEof)
917
+ skipped++;
918
+ if (nextPos == null)
919
+ break;
920
+ input.reset(nextPos, input.token);
921
+ }
922
+ if (skipped) {
923
+ input.reset(start, input.token);
924
+ input.acceptToken(this.elseToken, skipped);
925
+ }
926
+ }
927
+ }
928
+ LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
929
+ /**
930
+ `@external tokens` declarations in the grammar should resolve to
931
+ an instance of this class.
932
+ */
933
+ class ExternalTokenizer {
934
+ /**
935
+ Create a tokenizer. The first argument is the function that,
936
+ given an input stream, scans for the types of tokens it
937
+ recognizes at the stream's position, and calls
938
+ [`acceptToken`](#lr.InputStream.acceptToken) when it finds
939
+ one.
940
+ */
941
+ constructor(
942
+ /**
943
+ @internal
944
+ */
945
+ token, options = {}) {
946
+ this.token = token;
947
+ this.contextual = !!options.contextual;
948
+ this.fallback = !!options.fallback;
949
+ this.extend = !!options.extend;
950
+ }
951
+ }
952
+ // Tokenizer data is stored a big uint16 array containing, for each
953
+ // state:
954
+ //
955
+ // - A group bitmask, indicating what token groups are reachable from
956
+ // this state, so that paths that can only lead to tokens not in
957
+ // any of the current groups can be cut off early.
958
+ //
959
+ // - The position of the end of the state's sequence of accepting
960
+ // tokens
961
+ //
962
+ // - The number of outgoing edges for the state
963
+ //
964
+ // - The accepting tokens, as (token id, group mask) pairs
965
+ //
966
+ // - The outgoing edges, as (start character, end character, state
967
+ // index) triples, with end character being exclusive
968
+ //
969
+ // This function interprets that data, running through a stream as
970
+ // long as new states with the a matching group mask can be reached,
971
+ // and updating `input.token` when it matches a token.
972
+ function readToken(data, input, stack, group, precTable, precOffset) {
973
+ let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;
974
+ scan: for (;;) {
975
+ if ((groupMask & data[state]) == 0)
976
+ break;
977
+ let accEnd = data[state + 1];
978
+ // Check whether this state can lead to a token in the current group
979
+ // Accept tokens in this state, possibly overwriting
980
+ // lower-precedence / shorter tokens
981
+ for (let i = state + 3; i < accEnd; i += 2)
982
+ if ((data[i + 1] & groupMask) > 0) {
983
+ let term = data[i];
984
+ if (dialect.allows(term) &&
985
+ (input.token.value == -1 || input.token.value == term ||
986
+ overrides(term, input.token.value, precTable, precOffset))) {
987
+ input.acceptToken(term);
988
+ break;
989
+ }
990
+ }
991
+ let next = input.next, low = 0, high = data[state + 2];
992
+ // Special case for EOF
993
+ if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */) {
994
+ state = data[accEnd + high * 3 - 1];
995
+ continue scan;
996
+ }
997
+ // Do a binary search on the state's edges
998
+ for (; low < high;) {
999
+ let mid = (low + high) >> 1;
1000
+ let index = accEnd + mid + (mid << 1);
1001
+ let from = data[index], to = data[index + 1] || 0x10000;
1002
+ if (next < from)
1003
+ high = mid;
1004
+ else if (next >= to)
1005
+ low = mid + 1;
1006
+ else {
1007
+ state = data[index + 2];
1008
+ input.advance();
1009
+ continue scan;
1010
+ }
1011
+ }
1012
+ break;
1013
+ }
1014
+ }
1015
+ function findOffset(data, start, term) {
1016
+ for (let i = start, next; (next = data[i]) != 65535 /* Seq.End */; i++)
1017
+ if (next == term)
1018
+ return i - start;
1019
+ return -1;
1020
+ }
1021
+ function overrides(token, prev, tableData, tableOffset) {
1022
+ let iPrev = findOffset(tableData, tableOffset, prev);
1023
+ return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;
1024
+ }
1025
+
1026
+ // Environment variable used to control console output
1027
+ const verbose = typeof process != "undefined" && process.env && /\bparse\b/.test(process.env.LOG);
1028
+ let stackIDs = null;
1029
+ function cutAt(tree, pos, side) {
1030
+ let cursor = tree.cursor(IterMode.IncludeAnonymous);
1031
+ cursor.moveTo(pos);
1032
+ for (;;) {
1033
+ if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))
1034
+ for (;;) {
1035
+ if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)
1036
+ return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Safety.Margin */))
1037
+ : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Safety.Margin */));
1038
+ if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())
1039
+ break;
1040
+ if (!cursor.parent())
1041
+ return side < 0 ? 0 : tree.length;
1042
+ }
1043
+ }
1044
+ }
1045
+ class FragmentCursor {
1046
+ constructor(fragments, nodeSet) {
1047
+ this.fragments = fragments;
1048
+ this.nodeSet = nodeSet;
1049
+ this.i = 0;
1050
+ this.fragment = null;
1051
+ this.safeFrom = -1;
1052
+ this.safeTo = -1;
1053
+ this.trees = [];
1054
+ this.start = [];
1055
+ this.index = [];
1056
+ this.nextFragment();
1057
+ }
1058
+ nextFragment() {
1059
+ let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
1060
+ if (fr) {
1061
+ this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;
1062
+ this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;
1063
+ while (this.trees.length) {
1064
+ this.trees.pop();
1065
+ this.start.pop();
1066
+ this.index.pop();
1067
+ }
1068
+ this.trees.push(fr.tree);
1069
+ this.start.push(-fr.offset);
1070
+ this.index.push(0);
1071
+ this.nextStart = this.safeFrom;
1072
+ }
1073
+ else {
1074
+ this.nextStart = 1e9;
1075
+ }
1076
+ }
1077
+ // `pos` must be >= any previously given `pos` for this cursor
1078
+ nodeAt(pos) {
1079
+ if (pos < this.nextStart)
1080
+ return null;
1081
+ while (this.fragment && this.safeTo <= pos)
1082
+ this.nextFragment();
1083
+ if (!this.fragment)
1084
+ return null;
1085
+ for (;;) {
1086
+ let last = this.trees.length - 1;
1087
+ if (last < 0) { // End of tree
1088
+ this.nextFragment();
1089
+ return null;
1090
+ }
1091
+ let top = this.trees[last], index = this.index[last];
1092
+ if (index == top.children.length) {
1093
+ this.trees.pop();
1094
+ this.start.pop();
1095
+ this.index.pop();
1096
+ continue;
1097
+ }
1098
+ let next = top.children[index];
1099
+ let start = this.start[last] + top.positions[index];
1100
+ if (start > pos) {
1101
+ this.nextStart = start;
1102
+ return null;
1103
+ }
1104
+ if (next instanceof Tree) {
1105
+ if (start == pos) {
1106
+ if (start < this.safeFrom)
1107
+ return null;
1108
+ let end = start + next.length;
1109
+ if (end <= this.safeTo) {
1110
+ let lookAhead = next.prop(NodeProp.lookAhead);
1111
+ if (!lookAhead || end + lookAhead < this.fragment.to)
1112
+ return next;
1113
+ }
1114
+ }
1115
+ this.index[last]++;
1116
+ if (start + next.length >= Math.max(this.safeFrom, pos)) { // Enter this node
1117
+ this.trees.push(next);
1118
+ this.start.push(start);
1119
+ this.index.push(0);
1120
+ }
1121
+ }
1122
+ else {
1123
+ this.index[last]++;
1124
+ this.nextStart = start + next.length;
1125
+ }
1126
+ }
1127
+ }
1128
+ }
1129
+ class TokenCache {
1130
+ constructor(parser, stream) {
1131
+ this.stream = stream;
1132
+ this.tokens = [];
1133
+ this.mainToken = null;
1134
+ this.actions = [];
1135
+ this.tokens = parser.tokenizers.map(_ => new CachedToken);
1136
+ }
1137
+ getActions(stack) {
1138
+ let actionIndex = 0;
1139
+ let main = null;
1140
+ let { parser } = stack.p, { tokenizers } = parser;
1141
+ let mask = parser.stateSlot(stack.state, 3 /* ParseState.TokenizerMask */);
1142
+ let context = stack.curContext ? stack.curContext.hash : 0;
1143
+ let lookAhead = 0;
1144
+ for (let i = 0; i < tokenizers.length; i++) {
1145
+ if (((1 << i) & mask) == 0)
1146
+ continue;
1147
+ let tokenizer = tokenizers[i], token = this.tokens[i];
1148
+ if (main && !tokenizer.fallback)
1149
+ continue;
1150
+ if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {
1151
+ this.updateCachedToken(token, tokenizer, stack);
1152
+ token.mask = mask;
1153
+ token.context = context;
1154
+ }
1155
+ if (token.lookAhead > token.end + 25 /* Safety.Margin */)
1156
+ lookAhead = Math.max(token.lookAhead, lookAhead);
1157
+ if (token.value != 0 /* Term.Err */) {
1158
+ let startIndex = actionIndex;
1159
+ if (token.extended > -1)
1160
+ actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
1161
+ actionIndex = this.addActions(stack, token.value, token.end, actionIndex);
1162
+ if (!tokenizer.extend) {
1163
+ main = token;
1164
+ if (actionIndex > startIndex)
1165
+ break;
1166
+ }
1167
+ }
1168
+ }
1169
+ while (this.actions.length > actionIndex)
1170
+ this.actions.pop();
1171
+ if (lookAhead)
1172
+ stack.setLookAhead(lookAhead);
1173
+ if (!main && stack.pos == this.stream.end) {
1174
+ main = new CachedToken;
1175
+ main.value = stack.p.parser.eofTerm;
1176
+ main.start = main.end = stack.pos;
1177
+ actionIndex = this.addActions(stack, main.value, main.end, actionIndex);
1178
+ }
1179
+ this.mainToken = main;
1180
+ return this.actions;
1181
+ }
1182
+ getMainToken(stack) {
1183
+ if (this.mainToken)
1184
+ return this.mainToken;
1185
+ let main = new CachedToken, { pos, p } = stack;
1186
+ main.start = pos;
1187
+ main.end = Math.min(pos + 1, p.stream.end);
1188
+ main.value = pos == p.stream.end ? p.parser.eofTerm : 0 /* Term.Err */;
1189
+ return main;
1190
+ }
1191
+ updateCachedToken(token, tokenizer, stack) {
1192
+ let start = this.stream.clipPos(stack.pos);
1193
+ tokenizer.token(this.stream.reset(start, token), stack);
1194
+ if (token.value > -1) {
1195
+ let { parser } = stack.p;
1196
+ for (let i = 0; i < parser.specialized.length; i++)
1197
+ if (parser.specialized[i] == token.value) {
1198
+ let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);
1199
+ if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
1200
+ if ((result & 1) == 0 /* Specialize.Specialize */)
1201
+ token.value = result >> 1;
1202
+ else
1203
+ token.extended = result >> 1;
1204
+ break;
1205
+ }
1206
+ }
1207
+ }
1208
+ else {
1209
+ token.value = 0 /* Term.Err */;
1210
+ token.end = this.stream.clipPos(start + 1);
1211
+ }
1212
+ }
1213
+ putAction(action, token, end, index) {
1214
+ // Don't add duplicate actions
1215
+ for (let i = 0; i < index; i += 3)
1216
+ if (this.actions[i] == action)
1217
+ return index;
1218
+ this.actions[index++] = action;
1219
+ this.actions[index++] = token;
1220
+ this.actions[index++] = end;
1221
+ return index;
1222
+ }
1223
+ addActions(stack, token, end, index) {
1224
+ let { state } = stack, { parser } = stack.p, { data } = parser;
1225
+ for (let set = 0; set < 2; set++) {
1226
+ for (let i = parser.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */);; i += 3) {
1227
+ if (data[i] == 65535 /* Seq.End */) {
1228
+ if (data[i + 1] == 1 /* Seq.Next */) {
1229
+ i = pair(data, i + 2);
1230
+ }
1231
+ else {
1232
+ if (index == 0 && data[i + 1] == 2 /* Seq.Other */)
1233
+ index = this.putAction(pair(data, i + 2), token, end, index);
1234
+ break;
1235
+ }
1236
+ }
1237
+ if (data[i] == token)
1238
+ index = this.putAction(pair(data, i + 1), token, end, index);
1239
+ }
1240
+ }
1241
+ return index;
1242
+ }
1243
+ }
1244
+ class Parse {
1245
+ constructor(parser, input, fragments, ranges) {
1246
+ this.parser = parser;
1247
+ this.input = input;
1248
+ this.ranges = ranges;
1249
+ this.recovering = 0;
1250
+ this.nextStackID = 0x2654; // ♔, ♕, ♖, ♗, ♘, ♙, ♠, ♡, ♢, ♣, ♤, ♥, ♦, ♧
1251
+ this.minStackPos = 0;
1252
+ this.reused = [];
1253
+ this.stoppedAt = null;
1254
+ this.lastBigReductionStart = -1;
1255
+ this.lastBigReductionSize = 0;
1256
+ this.bigReductionCount = 0;
1257
+ this.stream = new InputStream(input, ranges);
1258
+ this.tokens = new TokenCache(parser, this.stream);
1259
+ this.topTerm = parser.top[1];
1260
+ let { from } = ranges[0];
1261
+ this.stacks = [Stack.start(this, parser.top[0], from)];
1262
+ this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4
1263
+ ? new FragmentCursor(fragments, parser.nodeSet) : null;
1264
+ }
1265
+ get parsedPos() {
1266
+ return this.minStackPos;
1267
+ }
1268
+ // Move the parser forward. This will process all parse stacks at
1269
+ // `this.pos` and try to advance them to a further position. If no
1270
+ // stack for such a position is found, it'll start error-recovery.
1271
+ //
1272
+ // When the parse is finished, this will return a syntax tree. When
1273
+ // not, it returns `null`.
1274
+ advance() {
1275
+ let stacks = this.stacks, pos = this.minStackPos;
1276
+ // This will hold stacks beyond `pos`.
1277
+ let newStacks = this.stacks = [];
1278
+ let stopped, stoppedTokens;
1279
+ // If a large amount of reductions happened with the same start
1280
+ // position, force the stack out of that production in order to
1281
+ // avoid creating a tree too deep to recurse through.
1282
+ // (This is an ugly kludge, because unfortunately there is no
1283
+ // straightforward, cheap way to check for this happening, due to
1284
+ // the history of reductions only being available in an
1285
+ // expensive-to-access format in the stack buffers.)
1286
+ if (this.bigReductionCount > 300 /* Rec.MaxLeftAssociativeReductionCount */ && stacks.length == 1) {
1287
+ let [s] = stacks;
1288
+ while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) { }
1289
+ this.bigReductionCount = this.lastBigReductionSize = 0;
1290
+ }
1291
+ // Keep advancing any stacks at `pos` until they either move
1292
+ // forward or can't be advanced. Gather stacks that can't be
1293
+ // advanced further in `stopped`.
1294
+ for (let i = 0; i < stacks.length; i++) {
1295
+ let stack = stacks[i];
1296
+ for (;;) {
1297
+ this.tokens.mainToken = null;
1298
+ if (stack.pos > pos) {
1299
+ newStacks.push(stack);
1300
+ }
1301
+ else if (this.advanceStack(stack, newStacks, stacks)) {
1302
+ continue;
1303
+ }
1304
+ else {
1305
+ if (!stopped) {
1306
+ stopped = [];
1307
+ stoppedTokens = [];
1308
+ }
1309
+ stopped.push(stack);
1310
+ let tok = this.tokens.getMainToken(stack);
1311
+ stoppedTokens.push(tok.value, tok.end);
1312
+ }
1313
+ break;
1314
+ }
1315
+ }
1316
+ if (!newStacks.length) {
1317
+ let finished = stopped && findFinished(stopped);
1318
+ if (finished) {
1319
+ if (verbose)
1320
+ console.log("Finish with " + this.stackID(finished));
1321
+ return this.stackToTree(finished);
1322
+ }
1323
+ if (this.parser.strict) {
1324
+ if (verbose && stopped)
1325
+ console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none"));
1326
+ throw new SyntaxError("No parse at " + pos);
1327
+ }
1328
+ if (!this.recovering)
1329
+ this.recovering = 5 /* Rec.Distance */;
1330
+ }
1331
+ if (this.recovering && stopped) {
1332
+ let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0]
1333
+ : this.runRecovery(stopped, stoppedTokens, newStacks);
1334
+ if (finished) {
1335
+ if (verbose)
1336
+ console.log("Force-finish " + this.stackID(finished));
1337
+ return this.stackToTree(finished.forceAll());
1338
+ }
1339
+ }
1340
+ if (this.recovering) {
1341
+ let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* Rec.MaxRemainingPerStep */;
1342
+ if (newStacks.length > maxRemaining) {
1343
+ newStacks.sort((a, b) => b.score - a.score);
1344
+ while (newStacks.length > maxRemaining)
1345
+ newStacks.pop();
1346
+ }
1347
+ if (newStacks.some(s => s.reducePos > pos))
1348
+ this.recovering--;
1349
+ }
1350
+ else if (newStacks.length > 1) {
1351
+ // Prune stacks that are in the same state, or that have been
1352
+ // running without splitting for a while, to avoid getting stuck
1353
+ // with multiple successful stacks running endlessly on.
1354
+ outer: for (let i = 0; i < newStacks.length - 1; i++) {
1355
+ let stack = newStacks[i];
1356
+ for (let j = i + 1; j < newStacks.length; j++) {
1357
+ let other = newStacks[j];
1358
+ if (stack.sameState(other) ||
1359
+ stack.buffer.length > 500 /* Rec.MinBufferLengthPrune */ && other.buffer.length > 500 /* Rec.MinBufferLengthPrune */) {
1360
+ if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {
1361
+ newStacks.splice(j--, 1);
1362
+ }
1363
+ else {
1364
+ newStacks.splice(i--, 1);
1365
+ continue outer;
1366
+ }
1367
+ }
1368
+ }
1369
+ }
1370
+ if (newStacks.length > 12 /* Rec.MaxStackCount */)
1371
+ newStacks.splice(12 /* Rec.MaxStackCount */, newStacks.length - 12 /* Rec.MaxStackCount */);
1372
+ }
1373
+ this.minStackPos = newStacks[0].pos;
1374
+ for (let i = 1; i < newStacks.length; i++)
1375
+ if (newStacks[i].pos < this.minStackPos)
1376
+ this.minStackPos = newStacks[i].pos;
1377
+ return null;
1378
+ }
1379
+ stopAt(pos) {
1380
+ if (this.stoppedAt != null && this.stoppedAt < pos)
1381
+ throw new RangeError("Can't move stoppedAt forward");
1382
+ this.stoppedAt = pos;
1383
+ }
1384
+ // Returns an updated version of the given stack, or null if the
1385
+ // stack can't advance normally. When `split` and `stacks` are
1386
+ // given, stacks split off by ambiguous operations will be pushed to
1387
+ // `split`, or added to `stacks` if they move `pos` forward.
1388
+ advanceStack(stack, stacks, split) {
1389
+ let start = stack.pos, { parser } = this;
1390
+ let base = verbose ? this.stackID(stack) + " -> " : "";
1391
+ if (this.stoppedAt != null && start > this.stoppedAt)
1392
+ return stack.forceReduce() ? stack : null;
1393
+ if (this.fragments) {
1394
+ let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;
1395
+ for (let cached = this.fragments.nodeAt(start); cached;) {
1396
+ let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;
1397
+ if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {
1398
+ stack.useNode(cached, match);
1399
+ if (verbose)
1400
+ console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);
1401
+ return true;
1402
+ }
1403
+ if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)
1404
+ break;
1405
+ let inner = cached.children[0];
1406
+ if (inner instanceof Tree && cached.positions[0] == 0)
1407
+ cached = inner;
1408
+ else
1409
+ break;
1410
+ }
1411
+ }
1412
+ let defaultReduce = parser.stateSlot(stack.state, 4 /* ParseState.DefaultReduce */);
1413
+ if (defaultReduce > 0) {
1414
+ stack.reduce(defaultReduce);
1415
+ if (verbose)
1416
+ console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* Action.ValueMask */)})`);
1417
+ return true;
1418
+ }
1419
+ if (stack.stack.length >= 8400 /* Rec.CutDepth */) {
1420
+ while (stack.stack.length > 6000 /* Rec.CutTo */ && stack.forceReduce()) { }
1421
+ }
1422
+ let actions = this.tokens.getActions(stack);
1423
+ for (let i = 0; i < actions.length;) {
1424
+ let action = actions[i++], term = actions[i++], end = actions[i++];
1425
+ let last = i == actions.length || !split;
1426
+ let localStack = last ? stack : stack.split();
1427
+ let main = this.tokens.mainToken;
1428
+ localStack.apply(action, term, main ? main.start : localStack.pos, end);
1429
+ if (verbose)
1430
+ console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* Action.ReduceFlag */) == 0 ? "shift"
1431
+ : `reduce of ${parser.getName(action & 65535 /* Action.ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`);
1432
+ if (last)
1433
+ return true;
1434
+ else if (localStack.pos > start)
1435
+ stacks.push(localStack);
1436
+ else
1437
+ split.push(localStack);
1438
+ }
1439
+ return false;
1440
+ }
1441
+ // Advance a given stack forward as far as it will go. Returns the
1442
+ // (possibly updated) stack if it got stuck, or null if it moved
1443
+ // forward and was given to `pushStackDedup`.
1444
+ advanceFully(stack, newStacks) {
1445
+ let pos = stack.pos;
1446
+ for (;;) {
1447
+ if (!this.advanceStack(stack, null, null))
1448
+ return false;
1449
+ if (stack.pos > pos) {
1450
+ pushStackDedup(stack, newStacks);
1451
+ return true;
1452
+ }
1453
+ }
1454
+ }
1455
+ runRecovery(stacks, tokens, newStacks) {
1456
+ let finished = null, restarted = false;
1457
+ for (let i = 0; i < stacks.length; i++) {
1458
+ let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];
1459
+ let base = verbose ? this.stackID(stack) + " -> " : "";
1460
+ if (stack.deadEnd) {
1461
+ if (restarted)
1462
+ continue;
1463
+ restarted = true;
1464
+ stack.restart();
1465
+ if (verbose)
1466
+ console.log(base + this.stackID(stack) + " (restarted)");
1467
+ let done = this.advanceFully(stack, newStacks);
1468
+ if (done)
1469
+ continue;
1470
+ }
1471
+ let force = stack.split(), forceBase = base;
1472
+ for (let j = 0; force.forceReduce() && j < 10 /* Rec.ForceReduceLimit */; j++) {
1473
+ if (verbose)
1474
+ console.log(forceBase + this.stackID(force) + " (via force-reduce)");
1475
+ let done = this.advanceFully(force, newStacks);
1476
+ if (done)
1477
+ break;
1478
+ if (verbose)
1479
+ forceBase = this.stackID(force) + " -> ";
1480
+ }
1481
+ for (let insert of stack.recoverByInsert(token)) {
1482
+ if (verbose)
1483
+ console.log(base + this.stackID(insert) + " (via recover-insert)");
1484
+ this.advanceFully(insert, newStacks);
1485
+ }
1486
+ if (this.stream.end > stack.pos) {
1487
+ if (tokenEnd == stack.pos) {
1488
+ tokenEnd++;
1489
+ token = 0 /* Term.Err */;
1490
+ }
1491
+ stack.recoverByDelete(token, tokenEnd);
1492
+ if (verbose)
1493
+ console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);
1494
+ pushStackDedup(stack, newStacks);
1495
+ }
1496
+ else if (!finished || finished.score < stack.score) {
1497
+ finished = stack;
1498
+ }
1499
+ }
1500
+ return finished;
1501
+ }
1502
+ // Convert the stack's buffer to a syntax tree.
1503
+ stackToTree(stack) {
1504
+ stack.close();
1505
+ return Tree.build({ buffer: StackBufferCursor.create(stack),
1506
+ nodeSet: this.parser.nodeSet,
1507
+ topID: this.topTerm,
1508
+ maxBufferLength: this.parser.bufferLength,
1509
+ reused: this.reused,
1510
+ start: this.ranges[0].from,
1511
+ length: stack.pos - this.ranges[0].from,
1512
+ minRepeatType: this.parser.minRepeatTerm });
1513
+ }
1514
+ stackID(stack) {
1515
+ let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);
1516
+ if (!id)
1517
+ stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));
1518
+ return id + stack;
1519
+ }
1520
+ }
1521
+ function pushStackDedup(stack, newStacks) {
1522
+ for (let i = 0; i < newStacks.length; i++) {
1523
+ let other = newStacks[i];
1524
+ if (other.pos == stack.pos && other.sameState(stack)) {
1525
+ if (newStacks[i].score < stack.score)
1526
+ newStacks[i] = stack;
1527
+ return;
1528
+ }
1529
+ }
1530
+ newStacks.push(stack);
1531
+ }
1532
+ class Dialect {
1533
+ constructor(source, flags, disabled) {
1534
+ this.source = source;
1535
+ this.flags = flags;
1536
+ this.disabled = disabled;
1537
+ }
1538
+ allows(term) { return !this.disabled || this.disabled[term] == 0; }
1539
+ }
1540
+ const id = x => x;
1541
+ /**
1542
+ Context trackers are used to track stateful context (such as
1543
+ indentation in the Python grammar, or parent elements in the XML
1544
+ grammar) needed by external tokenizers. You declare them in a
1545
+ grammar file as `@context exportName from "module"`.
1546
+
1547
+ Context values should be immutable, and can be updated (replaced)
1548
+ on shift or reduce actions.
1549
+
1550
+ The export used in a `@context` declaration should be of this
1551
+ type.
1552
+ */
1553
+ class ContextTracker {
1554
+ /**
1555
+ Define a context tracker.
1556
+ */
1557
+ constructor(spec) {
1558
+ this.start = spec.start;
1559
+ this.shift = spec.shift || id;
1560
+ this.reduce = spec.reduce || id;
1561
+ this.reuse = spec.reuse || id;
1562
+ this.hash = spec.hash || (() => 0);
1563
+ this.strict = spec.strict !== false;
1564
+ }
1565
+ }
1566
+ /**
1567
+ Holds the parse tables for a given grammar, as generated by
1568
+ `lezer-generator`, and provides [methods](#common.Parser) to parse
1569
+ content with.
1570
+ */
1571
+ class LRParser extends Parser {
1572
+ /**
1573
+ @internal
1574
+ */
1575
+ constructor(spec) {
1576
+ super();
1577
+ /**
1578
+ @internal
1579
+ */
1580
+ this.wrappers = [];
1581
+ if (spec.version != 14 /* File.Version */)
1582
+ throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14 /* File.Version */})`);
1583
+ let nodeNames = spec.nodeNames.split(" ");
1584
+ this.minRepeatTerm = nodeNames.length;
1585
+ for (let i = 0; i < spec.repeatNodeCount; i++)
1586
+ nodeNames.push("");
1587
+ let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);
1588
+ let nodeProps = [];
1589
+ for (let i = 0; i < nodeNames.length; i++)
1590
+ nodeProps.push([]);
1591
+ function setProp(nodeID, prop, value) {
1592
+ nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);
1593
+ }
1594
+ if (spec.nodeProps)
1595
+ for (let propSpec of spec.nodeProps) {
1596
+ let prop = propSpec[0];
1597
+ if (typeof prop == "string")
1598
+ prop = NodeProp[prop];
1599
+ for (let i = 1; i < propSpec.length;) {
1600
+ let next = propSpec[i++];
1601
+ if (next >= 0) {
1602
+ setProp(next, prop, propSpec[i++]);
1603
+ }
1604
+ else {
1605
+ let value = propSpec[i + -next];
1606
+ for (let j = -next; j > 0; j--)
1607
+ setProp(propSpec[i++], prop, value);
1608
+ i++;
1609
+ }
1610
+ }
1611
+ }
1612
+ this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({
1613
+ name: i >= this.minRepeatTerm ? undefined : name,
1614
+ id: i,
1615
+ props: nodeProps[i],
1616
+ top: topTerms.indexOf(i) > -1,
1617
+ error: i == 0,
1618
+ skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1
1619
+ })));
1620
+ if (spec.propSources)
1621
+ this.nodeSet = this.nodeSet.extend(...spec.propSources);
1622
+ this.strict = false;
1623
+ this.bufferLength = DefaultBufferLength;
1624
+ let tokenArray = decodeArray(spec.tokenData);
1625
+ this.context = spec.context;
1626
+ this.specializerSpecs = spec.specialized || [];
1627
+ this.specialized = new Uint16Array(this.specializerSpecs.length);
1628
+ for (let i = 0; i < this.specializerSpecs.length; i++)
1629
+ this.specialized[i] = this.specializerSpecs[i].term;
1630
+ this.specializers = this.specializerSpecs.map(getSpecializer);
1631
+ this.states = decodeArray(spec.states, Uint32Array);
1632
+ this.data = decodeArray(spec.stateData);
1633
+ this.goto = decodeArray(spec.goto);
1634
+ this.maxTerm = spec.maxTerm;
1635
+ this.tokenizers = spec.tokenizers.map(value => typeof value == "number" ? new TokenGroup(tokenArray, value) : value);
1636
+ this.topRules = spec.topRules;
1637
+ this.dialects = spec.dialects || {};
1638
+ this.dynamicPrecedences = spec.dynamicPrecedences || null;
1639
+ this.tokenPrecTable = spec.tokenPrec;
1640
+ this.termNames = spec.termNames || null;
1641
+ this.maxNode = this.nodeSet.types.length - 1;
1642
+ this.dialect = this.parseDialect();
1643
+ this.top = this.topRules[Object.keys(this.topRules)[0]];
1644
+ }
1645
+ createParse(input, fragments, ranges) {
1646
+ let parse = new Parse(this, input, fragments, ranges);
1647
+ for (let w of this.wrappers)
1648
+ parse = w(parse, input, fragments, ranges);
1649
+ return parse;
1650
+ }
1651
+ /**
1652
+ Get a goto table entry @internal
1653
+ */
1654
+ getGoto(state, term, loose = false) {
1655
+ let table = this.goto;
1656
+ if (term >= table[0])
1657
+ return -1;
1658
+ for (let pos = table[term + 1];;) {
1659
+ let groupTag = table[pos++], last = groupTag & 1;
1660
+ let target = table[pos++];
1661
+ if (last && loose)
1662
+ return target;
1663
+ for (let end = pos + (groupTag >> 1); pos < end; pos++)
1664
+ if (table[pos] == state)
1665
+ return target;
1666
+ if (last)
1667
+ return -1;
1668
+ }
1669
+ }
1670
+ /**
1671
+ Check if this state has an action for a given terminal @internal
1672
+ */
1673
+ hasAction(state, terminal) {
1674
+ let data = this.data;
1675
+ for (let set = 0; set < 2; set++) {
1676
+ for (let i = this.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */), next;; i += 3) {
1677
+ if ((next = data[i]) == 65535 /* Seq.End */) {
1678
+ if (data[i + 1] == 1 /* Seq.Next */)
1679
+ next = data[i = pair(data, i + 2)];
1680
+ else if (data[i + 1] == 2 /* Seq.Other */)
1681
+ return pair(data, i + 2);
1682
+ else
1683
+ break;
1684
+ }
1685
+ if (next == terminal || next == 0 /* Term.Err */)
1686
+ return pair(data, i + 1);
1687
+ }
1688
+ }
1689
+ return 0;
1690
+ }
1691
+ /**
1692
+ @internal
1693
+ */
1694
+ stateSlot(state, slot) {
1695
+ return this.states[(state * 6 /* ParseState.Size */) + slot];
1696
+ }
1697
+ /**
1698
+ @internal
1699
+ */
1700
+ stateFlag(state, flag) {
1701
+ return (this.stateSlot(state, 0 /* ParseState.Flags */) & flag) > 0;
1702
+ }
1703
+ /**
1704
+ @internal
1705
+ */
1706
+ validAction(state, action) {
1707
+ return !!this.allActions(state, a => a == action ? true : null);
1708
+ }
1709
+ /**
1710
+ @internal
1711
+ */
1712
+ allActions(state, action) {
1713
+ let deflt = this.stateSlot(state, 4 /* ParseState.DefaultReduce */);
1714
+ let result = deflt ? action(deflt) : undefined;
1715
+ for (let i = this.stateSlot(state, 1 /* ParseState.Actions */); result == null; i += 3) {
1716
+ if (this.data[i] == 65535 /* Seq.End */) {
1717
+ if (this.data[i + 1] == 1 /* Seq.Next */)
1718
+ i = pair(this.data, i + 2);
1719
+ else
1720
+ break;
1721
+ }
1722
+ result = action(pair(this.data, i + 1));
1723
+ }
1724
+ return result;
1725
+ }
1726
+ /**
1727
+ Get the states that can follow this one through shift actions or
1728
+ goto jumps. @internal
1729
+ */
1730
+ nextStates(state) {
1731
+ let result = [];
1732
+ for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {
1733
+ if (this.data[i] == 65535 /* Seq.End */) {
1734
+ if (this.data[i + 1] == 1 /* Seq.Next */)
1735
+ i = pair(this.data, i + 2);
1736
+ else
1737
+ break;
1738
+ }
1739
+ if ((this.data[i + 2] & (65536 /* Action.ReduceFlag */ >> 16)) == 0) {
1740
+ let value = this.data[i + 1];
1741
+ if (!result.some((v, i) => (i & 1) && v == value))
1742
+ result.push(this.data[i], value);
1743
+ }
1744
+ }
1745
+ return result;
1746
+ }
1747
+ /**
1748
+ Configure the parser. Returns a new parser instance that has the
1749
+ given settings modified. Settings not provided in `config` are
1750
+ kept from the original parser.
1751
+ */
1752
+ configure(config) {
1753
+ // Hideous reflection-based kludge to make it easy to create a
1754
+ // slightly modified copy of a parser.
1755
+ let copy = Object.assign(Object.create(LRParser.prototype), this);
1756
+ if (config.props)
1757
+ copy.nodeSet = this.nodeSet.extend(...config.props);
1758
+ if (config.top) {
1759
+ let info = this.topRules[config.top];
1760
+ if (!info)
1761
+ throw new RangeError(`Invalid top rule name ${config.top}`);
1762
+ copy.top = info;
1763
+ }
1764
+ if (config.tokenizers)
1765
+ copy.tokenizers = this.tokenizers.map(t => {
1766
+ let found = config.tokenizers.find(r => r.from == t);
1767
+ return found ? found.to : t;
1768
+ });
1769
+ if (config.specializers) {
1770
+ copy.specializers = this.specializers.slice();
1771
+ copy.specializerSpecs = this.specializerSpecs.map((s, i) => {
1772
+ let found = config.specializers.find(r => r.from == s.external);
1773
+ if (!found)
1774
+ return s;
1775
+ let spec = Object.assign(Object.assign({}, s), { external: found.to });
1776
+ copy.specializers[i] = getSpecializer(spec);
1777
+ return spec;
1778
+ });
1779
+ }
1780
+ if (config.contextTracker)
1781
+ copy.context = config.contextTracker;
1782
+ if (config.dialect)
1783
+ copy.dialect = this.parseDialect(config.dialect);
1784
+ if (config.strict != null)
1785
+ copy.strict = config.strict;
1786
+ if (config.wrap)
1787
+ copy.wrappers = copy.wrappers.concat(config.wrap);
1788
+ if (config.bufferLength != null)
1789
+ copy.bufferLength = config.bufferLength;
1790
+ return copy;
1791
+ }
1792
+ /**
1793
+ Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)
1794
+ are registered for this parser.
1795
+ */
1796
+ hasWrappers() {
1797
+ return this.wrappers.length > 0;
1798
+ }
1799
+ /**
1800
+ Returns the name associated with a given term. This will only
1801
+ work for all terms when the parser was generated with the
1802
+ `--names` option. By default, only the names of tagged terms are
1803
+ stored.
1804
+ */
1805
+ getName(term) {
1806
+ return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);
1807
+ }
1808
+ /**
1809
+ The eof term id is always allocated directly after the node
1810
+ types. @internal
1811
+ */
1812
+ get eofTerm() { return this.maxNode + 1; }
1813
+ /**
1814
+ The type of top node produced by the parser.
1815
+ */
1816
+ get topNode() { return this.nodeSet.types[this.top[1]]; }
1817
+ /**
1818
+ @internal
1819
+ */
1820
+ dynamicPrecedence(term) {
1821
+ let prec = this.dynamicPrecedences;
1822
+ return prec == null ? 0 : prec[term] || 0;
1823
+ }
1824
+ /**
1825
+ @internal
1826
+ */
1827
+ parseDialect(dialect) {
1828
+ let values = Object.keys(this.dialects), flags = values.map(() => false);
1829
+ if (dialect)
1830
+ for (let part of dialect.split(" ")) {
1831
+ let id = values.indexOf(part);
1832
+ if (id >= 0)
1833
+ flags[id] = true;
1834
+ }
1835
+ let disabled = null;
1836
+ for (let i = 0; i < values.length; i++)
1837
+ if (!flags[i]) {
1838
+ for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* Seq.End */;)
1839
+ (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;
1840
+ }
1841
+ return new Dialect(dialect, flags, disabled);
1842
+ }
1843
+ /**
1844
+ Used by the output of the parser generator. Not available to
1845
+ user code. @hide
1846
+ */
1847
+ static deserialize(spec) {
1848
+ return new LRParser(spec);
1849
+ }
1850
+ }
1851
+ function pair(data, off) { return data[off] | (data[off + 1] << 16); }
1852
+ function findFinished(stacks) {
1853
+ let best = null;
1854
+ for (let stack of stacks) {
1855
+ let stopped = stack.p.stoppedAt;
1856
+ if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) &&
1857
+ stack.p.parser.stateFlag(stack.state, 2 /* StateFlag.Accepting */) &&
1858
+ (!best || best.score < stack.score))
1859
+ best = stack;
1860
+ }
1861
+ return best;
1862
+ }
1863
+ function getSpecializer(spec) {
1864
+ if (spec.external) {
1865
+ let mask = spec.extend ? 1 /* Specialize.Extend */ : 0 /* Specialize.Specialize */;
1866
+ return (value, stack) => (spec.external(value, stack) << 1) | mask;
1867
+ }
1868
+ return spec.get;
1869
+ }
1870
+
1871
+ export { ContextTracker as C, ExternalTokenizer as E, LRParser as L, LocalTokenGroup as a };
1872
+ //# sourceMappingURL=index-OpUb5xP6.js.map