@inkandswitch/patchwork-pkg-base 0.0.17 → 0.0.18

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 (383) hide show
  1. package/init.js +0 -1
  2. package/modules.json +1 -11
  3. package/package.json +1 -1
  4. package/packages/account-picker/dist/AccountPicker-7VBUJTTB.js +0 -8860
  5. package/packages/account-picker/dist/AccountPicker-7VBUJTTB.js.map +0 -7
  6. package/packages/account-picker/dist/AccountPicker-CN73XGEW.css +0 -371
  7. package/packages/account-picker/dist/AccountPicker-CN73XGEW.css.map +0 -7
  8. package/packages/account-picker/dist/chunk-5WRI5ZAA.js +0 -31
  9. package/packages/account-picker/dist/chunk-5WRI5ZAA.js.map +0 -7
  10. package/packages/account-picker/dist/tool.css +0 -371
  11. package/packages/account-picker/dist/tool.css.map +0 -7
  12. package/packages/account-picker/dist/tool.js +0 -19
  13. package/packages/account-picker/dist/tool.js.map +0 -7
  14. package/packages/account-picker/package.json +0 -39
  15. package/packages/codemirror-base/dist/chunk-KMEIRH3R.js +0 -490
  16. package/packages/codemirror-base/dist/chunk-KMEIRH3R.js.map +0 -7
  17. package/packages/codemirror-base/dist/lib/codemirror.js +0 -7
  18. package/packages/codemirror-base/dist/lib/codemirror.js.map +0 -7
  19. package/packages/codemirror-base/dist/main.js +0 -17
  20. package/packages/codemirror-base/dist/main.js.map +0 -7
  21. package/packages/codemirror-base/dist/tool.js +0 -1799
  22. package/packages/codemirror-base/dist/tool.js.map +0 -7
  23. package/packages/codemirror-base/package.json +0 -55
  24. package/packages/codemirror-markdown/dist/apl-QAIM2KBM.js +0 -142
  25. package/packages/codemirror-markdown/dist/apl-QAIM2KBM.js.map +0 -7
  26. package/packages/codemirror-markdown/dist/asciiarmor-G7UKQURA.js +0 -58
  27. package/packages/codemirror-markdown/dist/asciiarmor-G7UKQURA.js.map +0 -7
  28. package/packages/codemirror-markdown/dist/asn1-JTUXKWKT.js +0 -144
  29. package/packages/codemirror-markdown/dist/asn1-JTUXKWKT.js.map +0 -7
  30. package/packages/codemirror-markdown/dist/asterisk-NM6JCXOL.js +0 -351
  31. package/packages/codemirror-markdown/dist/asterisk-NM6JCXOL.js.map +0 -7
  32. package/packages/codemirror-markdown/dist/brainfuck-X7FFM55E.js +0 -55
  33. package/packages/codemirror-markdown/dist/brainfuck-X7FFM55E.js.map +0 -7
  34. package/packages/codemirror-markdown/dist/chunk-46Z6CXSY.js +0 -1062
  35. package/packages/codemirror-markdown/dist/chunk-46Z6CXSY.js.map +0 -7
  36. package/packages/codemirror-markdown/dist/chunk-6JT2ASRP.js +0 -1111
  37. package/packages/codemirror-markdown/dist/chunk-6JT2ASRP.js.map +0 -7
  38. package/packages/codemirror-markdown/dist/chunk-CSJO4DNL.js +0 -1424
  39. package/packages/codemirror-markdown/dist/chunk-CSJO4DNL.js.map +0 -7
  40. package/packages/codemirror-markdown/dist/chunk-FLC3A4DL.js +0 -133
  41. package/packages/codemirror-markdown/dist/chunk-FLC3A4DL.js.map +0 -7
  42. package/packages/codemirror-markdown/dist/chunk-M3X2FRO3.js +0 -998
  43. package/packages/codemirror-markdown/dist/chunk-M3X2FRO3.js.map +0 -7
  44. package/packages/codemirror-markdown/dist/chunk-MAW6NPUW.js +0 -4930
  45. package/packages/codemirror-markdown/dist/chunk-MAW6NPUW.js.map +0 -7
  46. package/packages/codemirror-markdown/dist/chunk-MBTMKYFQ.js +0 -1779
  47. package/packages/codemirror-markdown/dist/chunk-MBTMKYFQ.js.map +0 -7
  48. package/packages/codemirror-markdown/dist/chunk-NEI7FGV4.js +0 -697
  49. package/packages/codemirror-markdown/dist/chunk-NEI7FGV4.js.map +0 -7
  50. package/packages/codemirror-markdown/dist/chunk-PPGERYN5.js +0 -2528
  51. package/packages/codemirror-markdown/dist/chunk-PPGERYN5.js.map +0 -7
  52. package/packages/codemirror-markdown/dist/clike-DOBZTBQN.js +0 -808
  53. package/packages/codemirror-markdown/dist/clike-DOBZTBQN.js.map +0 -7
  54. package/packages/codemirror-markdown/dist/clojure-PTADSDNF.js +0 -851
  55. package/packages/codemirror-markdown/dist/clojure-PTADSDNF.js.map +0 -7
  56. package/packages/codemirror-markdown/dist/cmake-5HAC7YMH.js +0 -73
  57. package/packages/codemirror-markdown/dist/cmake-5HAC7YMH.js.map +0 -7
  58. package/packages/codemirror-markdown/dist/cobol-HAM4C42S.js +0 -131
  59. package/packages/codemirror-markdown/dist/cobol-HAM4C42S.js.map +0 -7
  60. package/packages/codemirror-markdown/dist/coffeescript-IBRKASSJ.js +0 -310
  61. package/packages/codemirror-markdown/dist/coffeescript-IBRKASSJ.js.map +0 -7
  62. package/packages/codemirror-markdown/dist/commonlisp-KMRPB5EW.js +0 -132
  63. package/packages/codemirror-markdown/dist/commonlisp-KMRPB5EW.js.map +0 -7
  64. package/packages/codemirror-markdown/dist/crystal-2MDF4EKJ.js +0 -400
  65. package/packages/codemirror-markdown/dist/crystal-2MDF4EKJ.js.map +0 -7
  66. package/packages/codemirror-markdown/dist/css-VQQXA3AY.js +0 -1795
  67. package/packages/codemirror-markdown/dist/css-VQQXA3AY.js.map +0 -7
  68. package/packages/codemirror-markdown/dist/cypher-ZZEGDGDJ.js +0 -123
  69. package/packages/codemirror-markdown/dist/cypher-ZZEGDGDJ.js.map +0 -7
  70. package/packages/codemirror-markdown/dist/d-5S6PJOOT.js +0 -187
  71. package/packages/codemirror-markdown/dist/d-5S6PJOOT.js.map +0 -7
  72. package/packages/codemirror-markdown/dist/datatype.js +0 -48
  73. package/packages/codemirror-markdown/dist/datatype.js.map +0 -7
  74. package/packages/codemirror-markdown/dist/diff-S77XBOWF.js +0 -27
  75. package/packages/codemirror-markdown/dist/diff-S77XBOWF.js.map +0 -7
  76. package/packages/codemirror-markdown/dist/dist-2C6IPJHB.js +0 -98
  77. package/packages/codemirror-markdown/dist/dist-2C6IPJHB.js.map +0 -7
  78. package/packages/codemirror-markdown/dist/dist-2H653DKD.js +0 -170
  79. package/packages/codemirror-markdown/dist/dist-2H653DKD.js.map +0 -7
  80. package/packages/codemirror-markdown/dist/dist-2O4EI6YQ.js +0 -140
  81. package/packages/codemirror-markdown/dist/dist-2O4EI6YQ.js.map +0 -7
  82. package/packages/codemirror-markdown/dist/dist-2UJRV4FH.js +0 -75
  83. package/packages/codemirror-markdown/dist/dist-2UJRV4FH.js.map +0 -7
  84. package/packages/codemirror-markdown/dist/dist-52S6W6Z3.js +0 -15
  85. package/packages/codemirror-markdown/dist/dist-52S6W6Z3.js.map +0 -7
  86. package/packages/codemirror-markdown/dist/dist-5KN6ODPO.js +0 -340
  87. package/packages/codemirror-markdown/dist/dist-5KN6ODPO.js.map +0 -7
  88. package/packages/codemirror-markdown/dist/dist-BOGB4NCA.js +0 -20
  89. package/packages/codemirror-markdown/dist/dist-BOGB4NCA.js.map +0 -7
  90. package/packages/codemirror-markdown/dist/dist-DZ4PW5HP.js +0 -318
  91. package/packages/codemirror-markdown/dist/dist-DZ4PW5HP.js.map +0 -7
  92. package/packages/codemirror-markdown/dist/dist-FDBKXKIA.js +0 -100
  93. package/packages/codemirror-markdown/dist/dist-FDBKXKIA.js.map +0 -7
  94. package/packages/codemirror-markdown/dist/dist-G2KVVLNT.js +0 -381
  95. package/packages/codemirror-markdown/dist/dist-G2KVVLNT.js.map +0 -7
  96. package/packages/codemirror-markdown/dist/dist-HHNZE2GE.js +0 -193
  97. package/packages/codemirror-markdown/dist/dist-HHNZE2GE.js.map +0 -7
  98. package/packages/codemirror-markdown/dist/dist-HNH74YPL.js +0 -32
  99. package/packages/codemirror-markdown/dist/dist-HNH74YPL.js.map +0 -7
  100. package/packages/codemirror-markdown/dist/dist-LBQUKRIG.js +0 -27
  101. package/packages/codemirror-markdown/dist/dist-LBQUKRIG.js.map +0 -7
  102. package/packages/codemirror-markdown/dist/dist-MFKCWPLQ.js +0 -416
  103. package/packages/codemirror-markdown/dist/dist-MFKCWPLQ.js.map +0 -7
  104. package/packages/codemirror-markdown/dist/dist-NISFJM3T.js +0 -423
  105. package/packages/codemirror-markdown/dist/dist-NISFJM3T.js.map +0 -7
  106. package/packages/codemirror-markdown/dist/dist-Q7P6VH6H.js +0 -786
  107. package/packages/codemirror-markdown/dist/dist-Q7P6VH6H.js.map +0 -7
  108. package/packages/codemirror-markdown/dist/dist-RWF5A5GN.js +0 -451
  109. package/packages/codemirror-markdown/dist/dist-RWF5A5GN.js.map +0 -7
  110. package/packages/codemirror-markdown/dist/dist-UHUU7KLC.js +0 -748
  111. package/packages/codemirror-markdown/dist/dist-UHUU7KLC.js.map +0 -7
  112. package/packages/codemirror-markdown/dist/dist-WJMBFK7W.js +0 -360
  113. package/packages/codemirror-markdown/dist/dist-WJMBFK7W.js.map +0 -7
  114. package/packages/codemirror-markdown/dist/dist-XJYSXJ7H.js +0 -115
  115. package/packages/codemirror-markdown/dist/dist-XJYSXJ7H.js.map +0 -7
  116. package/packages/codemirror-markdown/dist/dist-YY24ZXZD.js +0 -212
  117. package/packages/codemirror-markdown/dist/dist-YY24ZXZD.js.map +0 -7
  118. package/packages/codemirror-markdown/dist/dockerfile-JECCOJWP.js +0 -209
  119. package/packages/codemirror-markdown/dist/dockerfile-JECCOJWP.js.map +0 -7
  120. package/packages/codemirror-markdown/dist/dtd-MNDWTW4Z.js +0 -116
  121. package/packages/codemirror-markdown/dist/dtd-MNDWTW4Z.js.map +0 -7
  122. package/packages/codemirror-markdown/dist/dylan-VQ4IHJDS.js +0 -317
  123. package/packages/codemirror-markdown/dist/dylan-VQ4IHJDS.js.map +0 -7
  124. package/packages/codemirror-markdown/dist/ebnf-IDZBFTCG.js +0 -142
  125. package/packages/codemirror-markdown/dist/ebnf-IDZBFTCG.js.map +0 -7
  126. package/packages/codemirror-markdown/dist/ecl-X3ROY7E6.js +0 -180
  127. package/packages/codemirror-markdown/dist/ecl-X3ROY7E6.js.map +0 -7
  128. package/packages/codemirror-markdown/dist/eiffel-WB3M7Y2E.js +0 -136
  129. package/packages/codemirror-markdown/dist/eiffel-WB3M7Y2E.js.map +0 -7
  130. package/packages/codemirror-markdown/dist/elm-VHXR6ZA3.js +0 -178
  131. package/packages/codemirror-markdown/dist/elm-VHXR6ZA3.js.map +0 -7
  132. package/packages/codemirror-markdown/dist/erlang-7ZBDDQDV.js +0 -676
  133. package/packages/codemirror-markdown/dist/erlang-7ZBDDQDV.js.map +0 -7
  134. package/packages/codemirror-markdown/dist/extensions/embed.js +0 -325
  135. package/packages/codemirror-markdown/dist/extensions/embed.js.map +0 -7
  136. package/packages/codemirror-markdown/dist/extensions/links.js +0 -118
  137. package/packages/codemirror-markdown/dist/extensions/links.js.map +0 -7
  138. package/packages/codemirror-markdown/dist/extensions/markdown.js +0 -3476
  139. package/packages/codemirror-markdown/dist/extensions/markdown.js.map +0 -7
  140. package/packages/codemirror-markdown/dist/factor-IKT2GQE2.js +0 -70
  141. package/packages/codemirror-markdown/dist/factor-IKT2GQE2.js.map +0 -7
  142. package/packages/codemirror-markdown/dist/fcl-CNBUVGUC.js +0 -143
  143. package/packages/codemirror-markdown/dist/fcl-CNBUVGUC.js.map +0 -7
  144. package/packages/codemirror-markdown/dist/forth-4BTPWSFZ.js +0 -118
  145. package/packages/codemirror-markdown/dist/forth-4BTPWSFZ.js.map +0 -7
  146. package/packages/codemirror-markdown/dist/fortran-V6F5DQPK.js +0 -469
  147. package/packages/codemirror-markdown/dist/fortran-V6F5DQPK.js.map +0 -7
  148. package/packages/codemirror-markdown/dist/gas-4DLP6BC4.js +0 -296
  149. package/packages/codemirror-markdown/dist/gas-4DLP6BC4.js.map +0 -7
  150. package/packages/codemirror-markdown/dist/gherkin-OSGPX6HI.js +0 -117
  151. package/packages/codemirror-markdown/dist/gherkin-OSGPX6HI.js.map +0 -7
  152. package/packages/codemirror-markdown/dist/groovy-R2JW63QF.js +0 -225
  153. package/packages/codemirror-markdown/dist/groovy-R2JW63QF.js.map +0 -7
  154. package/packages/codemirror-markdown/dist/haskell-GG7T4J6H.js +0 -461
  155. package/packages/codemirror-markdown/dist/haskell-GG7T4J6H.js.map +0 -7
  156. package/packages/codemirror-markdown/dist/haxe-ESFUJKSE.js +0 -521
  157. package/packages/codemirror-markdown/dist/haxe-ESFUJKSE.js.map +0 -7
  158. package/packages/codemirror-markdown/dist/http-SZLSACOW.js +0 -81
  159. package/packages/codemirror-markdown/dist/http-SZLSACOW.js.map +0 -7
  160. package/packages/codemirror-markdown/dist/idl-V7UH35RP.js +0 -987
  161. package/packages/codemirror-markdown/dist/idl-V7UH35RP.js.map +0 -7
  162. package/packages/codemirror-markdown/dist/javascript-MGRPKFDN.js +0 -13
  163. package/packages/codemirror-markdown/dist/javascript-MGRPKFDN.js.map +0 -7
  164. package/packages/codemirror-markdown/dist/julia-CWCVZVPG.js +0 -409
  165. package/packages/codemirror-markdown/dist/julia-CWCVZVPG.js.map +0 -7
  166. package/packages/codemirror-markdown/dist/livescript-IGKT2FL7.js +0 -303
  167. package/packages/codemirror-markdown/dist/livescript-IGKT2FL7.js.map +0 -7
  168. package/packages/codemirror-markdown/dist/lua-GHK7GCTS.js +0 -258
  169. package/packages/codemirror-markdown/dist/lua-GHK7GCTS.js.map +0 -7
  170. package/packages/codemirror-markdown/dist/main.js +0 -58
  171. package/packages/codemirror-markdown/dist/main.js.map +0 -7
  172. package/packages/codemirror-markdown/dist/mathematica-W5LMQI3M.js +0 -112
  173. package/packages/codemirror-markdown/dist/mathematica-W5LMQI3M.js.map +0 -7
  174. package/packages/codemirror-markdown/dist/mbox-A7CXJ4HZ.js +0 -119
  175. package/packages/codemirror-markdown/dist/mbox-A7CXJ4HZ.js.map +0 -7
  176. package/packages/codemirror-markdown/dist/mirc-WYJEQUBY.js +0 -109
  177. package/packages/codemirror-markdown/dist/mirc-WYJEQUBY.js.map +0 -7
  178. package/packages/codemirror-markdown/dist/mllike-C2YS6SJI.js +0 -340
  179. package/packages/codemirror-markdown/dist/mllike-C2YS6SJI.js.map +0 -7
  180. package/packages/codemirror-markdown/dist/modelica-BMJSLZS7.js +0 -149
  181. package/packages/codemirror-markdown/dist/modelica-BMJSLZS7.js.map +0 -7
  182. package/packages/codemirror-markdown/dist/mscgen-5BORDYHW.js +0 -137
  183. package/packages/codemirror-markdown/dist/mscgen-5BORDYHW.js.map +0 -7
  184. package/packages/codemirror-markdown/dist/mumps-BYE6H7ZX.js +0 -95
  185. package/packages/codemirror-markdown/dist/mumps-BYE6H7ZX.js.map +0 -7
  186. package/packages/codemirror-markdown/dist/nginx-Y54HR7MQ.js +0 -143
  187. package/packages/codemirror-markdown/dist/nginx-Y54HR7MQ.js.map +0 -7
  188. package/packages/codemirror-markdown/dist/nsis-UZLPE2DL.js +0 -67
  189. package/packages/codemirror-markdown/dist/nsis-UZLPE2DL.js.map +0 -7
  190. package/packages/codemirror-markdown/dist/ntriples-SAI3J2VH.js +0 -155
  191. package/packages/codemirror-markdown/dist/ntriples-SAI3J2VH.js.map +0 -7
  192. package/packages/codemirror-markdown/dist/octave-TLUBYOUX.js +0 -213
  193. package/packages/codemirror-markdown/dist/octave-TLUBYOUX.js.map +0 -7
  194. package/packages/codemirror-markdown/dist/oz-F6LNIR6Q.js +0 -233
  195. package/packages/codemirror-markdown/dist/oz-F6LNIR6Q.js.map +0 -7
  196. package/packages/codemirror-markdown/dist/pascal-WINE2FE6.js +0 -107
  197. package/packages/codemirror-markdown/dist/pascal-WINE2FE6.js.map +0 -7
  198. package/packages/codemirror-markdown/dist/perl-NZG3EIBE.js +0 -1107
  199. package/packages/codemirror-markdown/dist/perl-NZG3EIBE.js.map +0 -7
  200. package/packages/codemirror-markdown/dist/pig-U7OFLRCV.js +0 -105
  201. package/packages/codemirror-markdown/dist/pig-U7OFLRCV.js.map +0 -7
  202. package/packages/codemirror-markdown/dist/powershell-ZSUS7P6D.js +0 -330
  203. package/packages/codemirror-markdown/dist/powershell-ZSUS7P6D.js.map +0 -7
  204. package/packages/codemirror-markdown/dist/properties-IJRU6UJW.js +0 -60
  205. package/packages/codemirror-markdown/dist/properties-IJRU6UJW.js.map +0 -7
  206. package/packages/codemirror-markdown/dist/protobuf-2KETQIQ5.js +0 -80
  207. package/packages/codemirror-markdown/dist/protobuf-2KETQIQ5.js.map +0 -7
  208. package/packages/codemirror-markdown/dist/pug-IQCJJAZU.js +0 -410
  209. package/packages/codemirror-markdown/dist/pug-IQCJJAZU.js.map +0 -7
  210. package/packages/codemirror-markdown/dist/puppet-YIIDDH6A.js +0 -139
  211. package/packages/codemirror-markdown/dist/puppet-YIIDDH6A.js.map +0 -7
  212. package/packages/codemirror-markdown/dist/python-A6P3XTMX.js +0 -429
  213. package/packages/codemirror-markdown/dist/python-A6P3XTMX.js.map +0 -7
  214. package/packages/codemirror-markdown/dist/q-2KXN5RX7.js +0 -135
  215. package/packages/codemirror-markdown/dist/q-2KXN5RX7.js.map +0 -7
  216. package/packages/codemirror-markdown/dist/r-BB4MIIBH.js +0 -174
  217. package/packages/codemirror-markdown/dist/r-BB4MIIBH.js.map +0 -7
  218. package/packages/codemirror-markdown/dist/rpm-LMR25AQ3.js +0 -111
  219. package/packages/codemirror-markdown/dist/rpm-LMR25AQ3.js.map +0 -7
  220. package/packages/codemirror-markdown/dist/ruby-TSD6FT73.js +0 -333
  221. package/packages/codemirror-markdown/dist/ruby-TSD6FT73.js.map +0 -7
  222. package/packages/codemirror-markdown/dist/sas-6X4WWIGV.js +0 -209
  223. package/packages/codemirror-markdown/dist/sas-6X4WWIGV.js.map +0 -7
  224. package/packages/codemirror-markdown/dist/scheme-E3I46HBL.js +0 -230
  225. package/packages/codemirror-markdown/dist/scheme-E3I46HBL.js.map +0 -7
  226. package/packages/codemirror-markdown/dist/shell-GX3PRI4I.js +0 -224
  227. package/packages/codemirror-markdown/dist/shell-GX3PRI4I.js.map +0 -7
  228. package/packages/codemirror-markdown/dist/sieve-V65ZPL4F.js +0 -137
  229. package/packages/codemirror-markdown/dist/sieve-V65ZPL4F.js.map +0 -7
  230. package/packages/codemirror-markdown/dist/smalltalk-OVKP2CVW.js +0 -123
  231. package/packages/codemirror-markdown/dist/smalltalk-OVKP2CVW.js.map +0 -7
  232. package/packages/codemirror-markdown/dist/solr-C4DLQJCF.js +0 -71
  233. package/packages/codemirror-markdown/dist/solr-C4DLQJCF.js.map +0 -7
  234. package/packages/codemirror-markdown/dist/sparql-REKUW7B3.js +0 -251
  235. package/packages/codemirror-markdown/dist/sparql-REKUW7B3.js.map +0 -7
  236. package/packages/codemirror-markdown/dist/spreadsheet-S7NN2YTQ.js +0 -89
  237. package/packages/codemirror-markdown/dist/spreadsheet-S7NN2YTQ.js.map +0 -7
  238. package/packages/codemirror-markdown/dist/sql-ML2Q43YF.js +0 -358
  239. package/packages/codemirror-markdown/dist/sql-ML2Q43YF.js.map +0 -7
  240. package/packages/codemirror-markdown/dist/stex-TCOGKBT4.js +0 -233
  241. package/packages/codemirror-markdown/dist/stex-TCOGKBT4.js.map +0 -7
  242. package/packages/codemirror-markdown/dist/stylus-3ONNYZOM.js +0 -591
  243. package/packages/codemirror-markdown/dist/stylus-3ONNYZOM.js.map +0 -7
  244. package/packages/codemirror-markdown/dist/swift-CNWGZ22Y.js +0 -293
  245. package/packages/codemirror-markdown/dist/swift-CNWGZ22Y.js.map +0 -7
  246. package/packages/codemirror-markdown/dist/tcl-77IMAZYE.js +0 -116
  247. package/packages/codemirror-markdown/dist/tcl-77IMAZYE.js.map +0 -7
  248. package/packages/codemirror-markdown/dist/textile-6IWIIKFM.js +0 -416
  249. package/packages/codemirror-markdown/dist/textile-6IWIIKFM.js.map +0 -7
  250. package/packages/codemirror-markdown/dist/tiddlywiki-IJSZMUSA.js +0 -231
  251. package/packages/codemirror-markdown/dist/tiddlywiki-IJSZMUSA.js.map +0 -7
  252. package/packages/codemirror-markdown/dist/tiki-HG37JJIT.js +0 -276
  253. package/packages/codemirror-markdown/dist/tiki-HG37JJIT.js.map +0 -7
  254. package/packages/codemirror-markdown/dist/toml-NINU2IMM.js +0 -78
  255. package/packages/codemirror-markdown/dist/toml-NINU2IMM.js.map +0 -7
  256. package/packages/codemirror-markdown/dist/troff-AOQJ4Q4C.js +0 -63
  257. package/packages/codemirror-markdown/dist/troff-AOQJ4Q4C.js.map +0 -7
  258. package/packages/codemirror-markdown/dist/ttcn-TLOZ3FX3.js +0 -211
  259. package/packages/codemirror-markdown/dist/ttcn-TLOZ3FX3.js.map +0 -7
  260. package/packages/codemirror-markdown/dist/ttcn-cfg-3B6QY7QE.js +0 -141
  261. package/packages/codemirror-markdown/dist/ttcn-cfg-3B6QY7QE.js.map +0 -7
  262. package/packages/codemirror-markdown/dist/turtle-3N5KCGXP.js +0 -132
  263. package/packages/codemirror-markdown/dist/turtle-3N5KCGXP.js.map +0 -7
  264. package/packages/codemirror-markdown/dist/vb-I7M5DRLP.js +0 -204
  265. package/packages/codemirror-markdown/dist/vb-I7M5DRLP.js.map +0 -7
  266. package/packages/codemirror-markdown/dist/vbscript-U2ARSJLD.js +0 -482
  267. package/packages/codemirror-markdown/dist/vbscript-U2ARSJLD.js.map +0 -7
  268. package/packages/codemirror-markdown/dist/velocity-R3AYP5XJ.js +0 -151
  269. package/packages/codemirror-markdown/dist/velocity-R3AYP5XJ.js.map +0 -7
  270. package/packages/codemirror-markdown/dist/verilog-7VEWVDW6.js +0 -456
  271. package/packages/codemirror-markdown/dist/verilog-7VEWVDW6.js.map +0 -7
  272. package/packages/codemirror-markdown/dist/vhdl-JZUPPGBA.js +0 -162
  273. package/packages/codemirror-markdown/dist/vhdl-JZUPPGBA.js.map +0 -7
  274. package/packages/codemirror-markdown/dist/webidl-SLQFEELK.js +0 -206
  275. package/packages/codemirror-markdown/dist/webidl-SLQFEELK.js.map +0 -7
  276. package/packages/codemirror-markdown/dist/xquery-VXP5KJ6N.js +0 -532
  277. package/packages/codemirror-markdown/dist/xquery-VXP5KJ6N.js.map +0 -7
  278. package/packages/codemirror-markdown/dist/yacas-JRBC4BEV.js +0 -132
  279. package/packages/codemirror-markdown/dist/yacas-JRBC4BEV.js.map +0 -7
  280. package/packages/codemirror-markdown/dist/z80-AJF6WLUV.js +0 -95
  281. package/packages/codemirror-markdown/dist/z80-AJF6WLUV.js.map +0 -7
  282. package/packages/codemirror-markdown/example.js +0 -46
  283. package/packages/codemirror-markdown/package.json +0 -62
  284. package/packages/commands/dist/main.js +0 -504
  285. package/packages/commands/dist/main.js.map +0 -7
  286. package/packages/commands/package.json +0 -28
  287. package/packages/contact/dist/ContactAvatar-FP32ZZH2.js +0 -161
  288. package/packages/contact/dist/ContactAvatar-FP32ZZH2.js.map +0 -7
  289. package/packages/contact/dist/ContactViewer-ZHEE6INW.js +0 -60
  290. package/packages/contact/dist/ContactViewer-ZHEE6INW.js.map +0 -7
  291. package/packages/contact/dist/InlineContactAvatar-VZDPEZV2.js +0 -46
  292. package/packages/contact/dist/InlineContactAvatar-VZDPEZV2.js.map +0 -7
  293. package/packages/contact/dist/chunk-MOZI4Y4O.js +0 -54
  294. package/packages/contact/dist/chunk-MOZI4Y4O.js.map +0 -7
  295. package/packages/contact/dist/datatype-ABVDVPWS.js +0 -27
  296. package/packages/contact/dist/datatype-ABVDVPWS.js.map +0 -7
  297. package/packages/contact/dist/tool.css +0 -81
  298. package/packages/contact/dist/tool.css.map +0 -7
  299. package/packages/contact/dist/tool.js +0 -70
  300. package/packages/contact/dist/tool.js.map +0 -7
  301. package/packages/contact/package.json +0 -46
  302. package/packages/folder/dist/datatype-HWGUFBTQ.js +0 -27
  303. package/packages/folder/dist/datatype-HWGUFBTQ.js.map +0 -7
  304. package/packages/folder/dist/index.js +0 -27
  305. package/packages/folder/dist/index.js.map +0 -7
  306. package/packages/folder/dist/tool-62JZAZRP.js +0 -366
  307. package/packages/folder/dist/tool-62JZAZRP.js.map +0 -7
  308. package/packages/folder/package.json +0 -32
  309. package/packages/sideboard/dist/account-bar-OJQC3J6W.js +0 -2
  310. package/packages/sideboard/dist/account-bar-OJQC3J6W.js.map +0 -7
  311. package/packages/sideboard/dist/chunk-32FICX7K.js +0 -26
  312. package/packages/sideboard/dist/chunk-32FICX7K.js.map +0 -7
  313. package/packages/sideboard/dist/chunk-3OYP6TVA.js +0 -2
  314. package/packages/sideboard/dist/chunk-3OYP6TVA.js.map +0 -7
  315. package/packages/sideboard/dist/chunk-FW4363Y4.js +0 -2
  316. package/packages/sideboard/dist/chunk-FW4363Y4.js.map +0 -7
  317. package/packages/sideboard/dist/chunk-QKYKEZU4.js +0 -2
  318. package/packages/sideboard/dist/chunk-QKYKEZU4.js.map +0 -7
  319. package/packages/sideboard/dist/document-list-panel-42LSXXCO.js +0 -2
  320. package/packages/sideboard/dist/document-list-panel-42LSXXCO.js.map +0 -7
  321. package/packages/sideboard/dist/index.css +0 -2
  322. package/packages/sideboard/dist/index.css.map +0 -7
  323. package/packages/sideboard/dist/index.js +0 -2
  324. package/packages/sideboard/dist/index.js.map +0 -7
  325. package/packages/sideboard/dist/sideboard/sideboard.js +0 -2
  326. package/packages/sideboard/dist/sideboard/sideboard.js.map +0 -7
  327. package/packages/sideboard/package.json +0 -56
  328. package/packages/theming/dist/active-theme-K27UXDBG.js +0 -26
  329. package/packages/theming/dist/active-theme-K27UXDBG.js.map +0 -7
  330. package/packages/theming/dist/chunk-K4OOO2TK.js +0 -281
  331. package/packages/theming/dist/chunk-K4OOO2TK.js.map +0 -7
  332. package/packages/theming/dist/chunk-RATW7VZI.js +0 -11
  333. package/packages/theming/dist/chunk-RATW7VZI.js.map +0 -7
  334. package/packages/theming/dist/chunk-U7SC4JPE.js +0 -86
  335. package/packages/theming/dist/chunk-U7SC4JPE.js.map +0 -7
  336. package/packages/theming/dist/codemirror-theme.js +0 -2415
  337. package/packages/theming/dist/codemirror-theme.js.map +0 -7
  338. package/packages/theming/dist/datatype-UUJVIZM7.js +0 -16
  339. package/packages/theming/dist/datatype-UUJVIZM7.js.map +0 -7
  340. package/packages/theming/dist/gloom-JYQPEOHI.css +0 -102
  341. package/packages/theming/dist/lychee-BMLMUNP6.css +0 -114
  342. package/packages/theming/dist/main.js +0 -112
  343. package/packages/theming/dist/main.js.map +0 -7
  344. package/packages/theming/dist/theme-RC7MV6WP.css +0 -691
  345. package/packages/theming/dist/theme-editor-datatype-CIXRKEFF.js +0 -11
  346. package/packages/theming/dist/theme-editor-datatype-CIXRKEFF.js.map +0 -7
  347. package/packages/theming/dist/theme-editor.js +0 -576
  348. package/packages/theming/dist/theme-editor.js.map +0 -7
  349. package/packages/theming/dist/theme-titlebar-P2CODQGF.js +0 -21
  350. package/packages/theming/dist/theme-titlebar-P2CODQGF.js.map +0 -7
  351. package/packages/theming/dist/theme-tray-5L2KGCGD.js +0 -351
  352. package/packages/theming/dist/theme-tray-5L2KGCGD.js.map +0 -7
  353. package/packages/theming/dist/tool.js +0 -405
  354. package/packages/theming/dist/tool.js.map +0 -7
  355. package/packages/theming/package.json +0 -48
  356. package/packages/threepane/dist/IsolatedDocumentArea-LFSDWMIY.js +0 -2
  357. package/packages/threepane/dist/IsolatedDocumentArea-LFSDWMIY.js.map +0 -7
  358. package/packages/threepane/dist/PatchworkFrame-JTNZ6365.js +0 -2
  359. package/packages/threepane/dist/PatchworkFrame-JTNZ6365.js.map +0 -7
  360. package/packages/threepane/dist/chunk-7YXO2YGV.js +0 -2
  361. package/packages/threepane/dist/chunk-7YXO2YGV.js.map +0 -7
  362. package/packages/threepane/dist/chunk-FOMAU6H2.js +0 -972
  363. package/packages/threepane/dist/chunk-FOMAU6H2.js.map +0 -7
  364. package/packages/threepane/dist/chunk-FW4363Y4.js +0 -2
  365. package/packages/threepane/dist/chunk-FW4363Y4.js.map +0 -7
  366. package/packages/threepane/dist/datatypes-FKBTWAO7.js +0 -2
  367. package/packages/threepane/dist/datatypes-FKBTWAO7.js.map +0 -7
  368. package/packages/threepane/dist/index.js +0 -2
  369. package/packages/threepane/dist/index.js.map +0 -7
  370. package/packages/threepane/package.json +0 -42
  371. package/packages/tldraw4/dist/chunk-IKZWERSR.js +0 -38
  372. package/packages/tldraw4/dist/chunk-IKZWERSR.js.map +0 -7
  373. package/packages/tldraw4/dist/chunk-VF5CY24G.js +0 -140894
  374. package/packages/tldraw4/dist/chunk-VF5CY24G.js.map +0 -7
  375. package/packages/tldraw4/dist/datatype.js +0 -46
  376. package/packages/tldraw4/dist/datatype.js.map +0 -7
  377. package/packages/tldraw4/dist/main.css +0 -3202
  378. package/packages/tldraw4/dist/main.css.map +0 -7
  379. package/packages/tldraw4/dist/main.js +0 -42
  380. package/packages/tldraw4/dist/main.js.map +0 -7
  381. package/packages/tldraw4/dist/tool.js +0 -8767
  382. package/packages/tldraw4/dist/tool.js.map +0 -7
  383. package/packages/tldraw4/package.json +0 -62
@@ -1,1779 +0,0 @@
1
- import {
2
- DefaultBufferLength,
3
- IterMode,
4
- NodeProp,
5
- NodeSet,
6
- NodeType,
7
- Parser,
8
- Tree
9
- } from "./chunk-MAW6NPUW.js";
10
-
11
- // ../node_modules/.pnpm/@lezer+lr@1.4.10/node_modules/@lezer/lr/dist/index.js
12
- var Stack = class _Stack {
13
- /**
14
- @internal
15
- */
16
- constructor(p, stack, state, reducePos, pos, score, buffer, bufferBase, curContext, lookAhead = 0, parent) {
17
- this.p = p;
18
- this.stack = stack;
19
- this.state = state;
20
- this.reducePos = reducePos;
21
- this.pos = pos;
22
- this.score = score;
23
- this.buffer = buffer;
24
- this.bufferBase = bufferBase;
25
- this.curContext = curContext;
26
- this.lookAhead = lookAhead;
27
- this.parent = parent;
28
- }
29
- /**
30
- @internal
31
- */
32
- toString() {
33
- return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
34
- }
35
- // Start an empty stack
36
- /**
37
- @internal
38
- */
39
- static start(p, state, pos = 0) {
40
- let cx = p.parser.context;
41
- return new _Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
42
- }
43
- /**
44
- The stack's current [context](#lr.ContextTracker) value, if
45
- any. Its type will depend on the context tracker's type
46
- parameter, or it will be `null` if there is no context
47
- tracker.
48
- */
49
- get context() {
50
- return this.curContext ? this.curContext.context : null;
51
- }
52
- // Push a state onto the stack, tracking its start position as well
53
- // as the buffer base at that point.
54
- /**
55
- @internal
56
- */
57
- pushState(state, start) {
58
- this.stack.push(this.state, start, this.bufferBase + this.buffer.length);
59
- this.state = state;
60
- }
61
- // Apply a reduce action
62
- /**
63
- @internal
64
- */
65
- reduce(action) {
66
- var _a;
67
- let depth = action >> 19, type = action & 65535;
68
- let { parser } = this.p;
69
- let lookaheadRecord = this.reducePos < this.pos - 25 && this.setLookAhead(this.pos);
70
- let dPrec = parser.dynamicPrecedence(type);
71
- if (dPrec)
72
- this.score += dPrec;
73
- if (depth == 0) {
74
- if (type < parser.minRepeatTerm && this.reducePos < this.pos)
75
- this.reducePos = this.pos;
76
- this.pushState(parser.getGoto(this.state, type, true), this.reducePos);
77
- if (type < parser.minRepeatTerm)
78
- this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);
79
- this.reduceContext(type, this.reducePos);
80
- return;
81
- }
82
- let base = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0);
83
- let start = base ? this.stack[base - 2] : this.p.ranges[0].from;
84
- if (type < parser.minRepeatTerm && start == this.reducePos && this.reducePos < this.pos)
85
- this.reducePos = this.pos;
86
- let size = this.reducePos - start;
87
- if (size >= 2e3 && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {
88
- if (start == this.p.lastBigReductionStart) {
89
- this.p.bigReductionCount++;
90
- this.p.lastBigReductionSize = size;
91
- } else if (this.p.lastBigReductionSize < size) {
92
- this.p.bigReductionCount = 1;
93
- this.p.lastBigReductionStart = start;
94
- this.p.lastBigReductionSize = size;
95
- }
96
- }
97
- let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;
98
- if (type < parser.minRepeatTerm || action & 131072) {
99
- let pos = parser.stateFlag(
100
- this.state,
101
- 1
102
- /* StateFlag.Skipped */
103
- ) ? this.pos : this.reducePos;
104
- this.storeNode(type, start, pos, count + 4, true);
105
- }
106
- if (action & 262144) {
107
- this.state = this.stack[base];
108
- } else {
109
- let baseStateID = this.stack[base - 3];
110
- this.state = parser.getGoto(baseStateID, type, true);
111
- }
112
- while (this.stack.length > base)
113
- this.stack.pop();
114
- this.reduceContext(type, start);
115
- }
116
- // Shift a value into the buffer
117
- /**
118
- @internal
119
- */
120
- storeNode(term, start, end, size = 4, mustSink = false) {
121
- if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
122
- let top = this.buffer.length;
123
- if (top > 0 && this.buffer[top - 4] == 0 && this.buffer[top - 1] > -1) {
124
- if (start == end)
125
- return;
126
- if (this.buffer[top - 2] >= start) {
127
- this.buffer[top - 2] = end;
128
- return;
129
- }
130
- }
131
- }
132
- if (!mustSink || this.pos == end) {
133
- this.buffer.push(term, start, end, size);
134
- } else {
135
- let index = this.buffer.length;
136
- if (index > 0 && (this.buffer[index - 4] != 0 || this.buffer[index - 1] < 0)) {
137
- let mustMove = false;
138
- for (let scan = index; scan > 0 && this.buffer[scan - 2] > end; scan -= 4) {
139
- if (this.buffer[scan - 1] >= 0) {
140
- mustMove = true;
141
- break;
142
- }
143
- }
144
- if (mustMove)
145
- while (index > 0 && this.buffer[index - 2] > end) {
146
- this.buffer[index] = this.buffer[index - 4];
147
- this.buffer[index + 1] = this.buffer[index - 3];
148
- this.buffer[index + 2] = this.buffer[index - 2];
149
- this.buffer[index + 3] = this.buffer[index - 1];
150
- index -= 4;
151
- if (size > 4)
152
- size -= 4;
153
- }
154
- }
155
- this.buffer[index] = term;
156
- this.buffer[index + 1] = start;
157
- this.buffer[index + 2] = end;
158
- this.buffer[index + 3] = size;
159
- }
160
- }
161
- // Apply a shift action
162
- /**
163
- @internal
164
- */
165
- shift(action, type, start, end) {
166
- if (action & 131072) {
167
- this.pushState(action & 65535, this.pos);
168
- } else if ((action & 262144) == 0) {
169
- let nextState = action, { parser } = this.p;
170
- this.pos = end;
171
- let skipped = parser.stateFlag(
172
- nextState,
173
- 1
174
- /* StateFlag.Skipped */
175
- );
176
- if (!skipped && (end > start || type <= parser.maxNode))
177
- this.reducePos = end;
178
- this.pushState(nextState, skipped ? start : Math.min(start, this.reducePos));
179
- this.shiftContext(type, start);
180
- if (type <= parser.maxNode)
181
- this.buffer.push(type, start, end, 4);
182
- } else {
183
- this.pos = end;
184
- this.shiftContext(type, start);
185
- if (type <= this.p.parser.maxNode)
186
- this.buffer.push(type, start, end, 4);
187
- }
188
- }
189
- // Apply an action
190
- /**
191
- @internal
192
- */
193
- apply(action, next, nextStart, nextEnd) {
194
- if (action & 65536)
195
- this.reduce(action);
196
- else
197
- this.shift(action, next, nextStart, nextEnd);
198
- }
199
- // Add a prebuilt (reused) node into the buffer.
200
- /**
201
- @internal
202
- */
203
- useNode(value, next) {
204
- let index = this.p.reused.length - 1;
205
- if (index < 0 || this.p.reused[index] != value) {
206
- this.p.reused.push(value);
207
- index++;
208
- }
209
- let start = this.pos;
210
- this.reducePos = this.pos = start + value.length;
211
- this.pushState(next, start);
212
- this.buffer.push(
213
- index,
214
- start,
215
- this.reducePos,
216
- -1
217
- /* size == -1 means this is a reused value */
218
- );
219
- if (this.curContext)
220
- this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));
221
- }
222
- // Split the stack. Due to the buffer sharing and the fact
223
- // that `this.stack` tends to stay quite shallow, this isn't very
224
- // expensive.
225
- /**
226
- @internal
227
- */
228
- split() {
229
- let parent = this;
230
- let off = parent.buffer.length;
231
- if (off && parent.buffer[off - 4] == 0)
232
- off -= 4;
233
- while (off > 0 && parent.buffer[off - 2] > parent.reducePos)
234
- off -= 4;
235
- let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;
236
- while (parent && base == parent.bufferBase)
237
- parent = parent.parent;
238
- return new _Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
239
- }
240
- // Try to recover from an error by 'deleting' (ignoring) one token.
241
- /**
242
- @internal
243
- */
244
- recoverByDelete(next, nextEnd) {
245
- let isNode = next <= this.p.parser.maxNode;
246
- if (isNode)
247
- this.storeNode(next, this.pos, nextEnd, 4);
248
- this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4);
249
- this.pos = this.reducePos = nextEnd;
250
- this.score -= 190;
251
- }
252
- /**
253
- Check if the given term would be able to be shifted (optionally
254
- after some reductions) on this stack. This can be useful for
255
- external tokenizers that want to make sure they only provide a
256
- given token when it applies.
257
- */
258
- canShift(term) {
259
- for (let sim = new SimulatedStack(this); ; ) {
260
- let action = this.p.parser.stateSlot(
261
- sim.state,
262
- 4
263
- /* ParseState.DefaultReduce */
264
- ) || this.p.parser.hasAction(sim.state, term);
265
- if (action == 0)
266
- return false;
267
- if ((action & 65536) == 0)
268
- return true;
269
- sim.reduce(action);
270
- }
271
- }
272
- // Apply up to Recover.MaxNext recovery actions that conceptually
273
- // inserts some missing token or rule.
274
- /**
275
- @internal
276
- */
277
- recoverByInsert(next) {
278
- if (this.stack.length >= 300)
279
- return [];
280
- let nextStates = this.p.parser.nextStates(this.state);
281
- if (nextStates.length > 4 << 1 || this.stack.length >= 120) {
282
- let best = [];
283
- for (let i = 0, s; i < nextStates.length; i += 2) {
284
- if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))
285
- best.push(nextStates[i], s);
286
- }
287
- if (this.stack.length < 120)
288
- for (let i = 0; best.length < 4 << 1 && i < nextStates.length; i += 2) {
289
- let s = nextStates[i + 1];
290
- if (!best.some((v, i2) => i2 & 1 && v == s))
291
- best.push(nextStates[i], s);
292
- }
293
- nextStates = best;
294
- }
295
- let result = [];
296
- for (let i = 0; i < nextStates.length && result.length < 4; i += 2) {
297
- let s = nextStates[i + 1];
298
- if (s == this.state)
299
- continue;
300
- let stack = this.split();
301
- stack.pushState(s, this.pos);
302
- stack.storeNode(0, stack.pos, stack.pos, 4, true);
303
- stack.shiftContext(nextStates[i], this.pos);
304
- stack.reducePos = this.pos;
305
- stack.score -= 200;
306
- result.push(stack);
307
- }
308
- return result;
309
- }
310
- // Force a reduce, if possible. Return false if that can't
311
- // be done.
312
- /**
313
- @internal
314
- */
315
- forceReduce() {
316
- let { parser } = this.p;
317
- let reduce = parser.stateSlot(
318
- this.state,
319
- 5
320
- /* ParseState.ForcedReduce */
321
- );
322
- if ((reduce & 65536) == 0)
323
- return false;
324
- if (!parser.validAction(this.state, reduce)) {
325
- let depth = reduce >> 19, term = reduce & 65535;
326
- let target = this.stack.length - depth * 3;
327
- if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {
328
- let backup = this.findForcedReduction();
329
- if (backup == null)
330
- return false;
331
- reduce = backup;
332
- }
333
- this.storeNode(0, this.pos, this.pos, 4, true);
334
- this.score -= 100;
335
- }
336
- this.reducePos = this.pos;
337
- this.reduce(reduce);
338
- return true;
339
- }
340
- /**
341
- Try to scan through the automaton to find some kind of reduction
342
- that can be applied. Used when the regular ForcedReduce field
343
- isn't a valid action. @internal
344
- */
345
- findForcedReduction() {
346
- let { parser } = this.p, seen = [];
347
- let explore = (state, depth) => {
348
- if (seen.includes(state))
349
- return;
350
- seen.push(state);
351
- return parser.allActions(state, (action) => {
352
- if (action & (262144 | 131072)) ;
353
- else if (action & 65536) {
354
- let rDepth = (action >> 19) - depth;
355
- if (rDepth > 1) {
356
- let term = action & 65535, target = this.stack.length - rDepth * 3;
357
- if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0)
358
- return rDepth << 19 | 65536 | term;
359
- }
360
- } else {
361
- let found = explore(action, depth + 1);
362
- if (found != null)
363
- return found;
364
- }
365
- });
366
- };
367
- return explore(this.state, 0);
368
- }
369
- /**
370
- @internal
371
- */
372
- forceAll() {
373
- while (!this.p.parser.stateFlag(
374
- this.state,
375
- 2
376
- /* StateFlag.Accepting */
377
- )) {
378
- if (!this.forceReduce()) {
379
- this.storeNode(0, this.pos, this.pos, 4, true);
380
- break;
381
- }
382
- }
383
- return this;
384
- }
385
- /**
386
- Check whether this state has no further actions (assumed to be a direct descendant of the
387
- top state, since any other states must be able to continue
388
- somehow). @internal
389
- */
390
- get deadEnd() {
391
- if (this.stack.length != 3)
392
- return false;
393
- let { parser } = this.p;
394
- return parser.data[parser.stateSlot(
395
- this.state,
396
- 1
397
- /* ParseState.Actions */
398
- )] == 65535 && !parser.stateSlot(
399
- this.state,
400
- 4
401
- /* ParseState.DefaultReduce */
402
- );
403
- }
404
- /**
405
- Restart the stack (put it back in its start state). Only safe
406
- when this.stack.length == 3 (state is directly below the top
407
- state). @internal
408
- */
409
- restart() {
410
- this.storeNode(0, this.pos, this.pos, 4, true);
411
- this.state = this.stack[0];
412
- this.stack.length = 0;
413
- }
414
- /**
415
- @internal
416
- */
417
- sameState(other) {
418
- if (this.state != other.state || this.stack.length != other.stack.length)
419
- return false;
420
- for (let i = 0; i < this.stack.length; i += 3)
421
- if (this.stack[i] != other.stack[i])
422
- return false;
423
- return true;
424
- }
425
- /**
426
- Get the parser used by this stack.
427
- */
428
- get parser() {
429
- return this.p.parser;
430
- }
431
- /**
432
- Test whether a given dialect (by numeric ID, as exported from
433
- the terms file) is enabled.
434
- */
435
- dialectEnabled(dialectID) {
436
- return this.p.parser.dialect.flags[dialectID];
437
- }
438
- shiftContext(term, start) {
439
- if (this.curContext)
440
- this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));
441
- }
442
- reduceContext(term, start) {
443
- if (this.curContext)
444
- this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));
445
- }
446
- /**
447
- @internal
448
- */
449
- emitContext() {
450
- let last = this.buffer.length - 1;
451
- if (last < 0 || this.buffer[last] != -3)
452
- this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
453
- }
454
- /**
455
- @internal
456
- */
457
- emitLookAhead() {
458
- let last = this.buffer.length - 1;
459
- if (last < 0 || this.buffer[last] != -4)
460
- this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
461
- }
462
- updateContext(context) {
463
- if (context != this.curContext.context) {
464
- let newCx = new StackContext(this.curContext.tracker, context);
465
- if (newCx.hash != this.curContext.hash)
466
- this.emitContext();
467
- this.curContext = newCx;
468
- }
469
- }
470
- /**
471
- @internal
472
- */
473
- setLookAhead(lookAhead) {
474
- if (lookAhead <= this.lookAhead)
475
- return false;
476
- this.emitLookAhead();
477
- this.lookAhead = lookAhead;
478
- return true;
479
- }
480
- /**
481
- @internal
482
- */
483
- close() {
484
- if (this.curContext && this.curContext.tracker.strict)
485
- this.emitContext();
486
- if (this.lookAhead > 0)
487
- this.emitLookAhead();
488
- }
489
- };
490
- var StackContext = class {
491
- constructor(tracker, context) {
492
- this.tracker = tracker;
493
- this.context = context;
494
- this.hash = tracker.strict ? tracker.hash(context) : 0;
495
- }
496
- };
497
- var SimulatedStack = class {
498
- constructor(start) {
499
- this.start = start;
500
- this.state = start.state;
501
- this.stack = start.stack;
502
- this.base = this.stack.length;
503
- }
504
- reduce(action) {
505
- let term = action & 65535, depth = action >> 19;
506
- if (depth == 0) {
507
- if (this.stack == this.start.stack)
508
- this.stack = this.stack.slice();
509
- this.stack.push(this.state, 0, 0);
510
- this.base += 3;
511
- } else {
512
- this.base -= (depth - 1) * 3;
513
- }
514
- let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
515
- this.state = goto;
516
- }
517
- };
518
- var StackBufferCursor = class _StackBufferCursor {
519
- constructor(stack, pos, index) {
520
- this.stack = stack;
521
- this.pos = pos;
522
- this.index = index;
523
- this.buffer = stack.buffer;
524
- if (this.index == 0)
525
- this.maybeNext();
526
- }
527
- static create(stack, pos = stack.bufferBase + stack.buffer.length) {
528
- return new _StackBufferCursor(stack, pos, pos - stack.bufferBase);
529
- }
530
- maybeNext() {
531
- let next = this.stack.parent;
532
- if (next != null) {
533
- this.index = this.stack.bufferBase - next.bufferBase;
534
- this.stack = next;
535
- this.buffer = next.buffer;
536
- }
537
- }
538
- get id() {
539
- return this.buffer[this.index - 4];
540
- }
541
- get start() {
542
- return this.buffer[this.index - 3];
543
- }
544
- get end() {
545
- return this.buffer[this.index - 2];
546
- }
547
- get size() {
548
- return this.buffer[this.index - 1];
549
- }
550
- next() {
551
- this.index -= 4;
552
- this.pos -= 4;
553
- if (this.index == 0)
554
- this.maybeNext();
555
- }
556
- fork() {
557
- return new _StackBufferCursor(this.stack, this.pos, this.index);
558
- }
559
- };
560
- function decodeArray(input, Type = Uint16Array) {
561
- if (typeof input != "string")
562
- return input;
563
- let array = null;
564
- for (let pos = 0, out = 0; pos < input.length; ) {
565
- let value = 0;
566
- for (; ; ) {
567
- let next = input.charCodeAt(pos++), stop = false;
568
- if (next == 126) {
569
- value = 65535;
570
- break;
571
- }
572
- if (next >= 92)
573
- next--;
574
- if (next >= 34)
575
- next--;
576
- let digit = next - 32;
577
- if (digit >= 46) {
578
- digit -= 46;
579
- stop = true;
580
- }
581
- value += digit;
582
- if (stop)
583
- break;
584
- value *= 46;
585
- }
586
- if (array)
587
- array[out++] = value;
588
- else
589
- array = new Type(value);
590
- }
591
- return array;
592
- }
593
- var CachedToken = class {
594
- constructor() {
595
- this.start = -1;
596
- this.value = -1;
597
- this.end = -1;
598
- this.extended = -1;
599
- this.lookAhead = 0;
600
- this.mask = 0;
601
- this.context = 0;
602
- }
603
- };
604
- var nullToken = new CachedToken();
605
- var InputStream = class {
606
- /**
607
- @internal
608
- */
609
- constructor(input, ranges) {
610
- this.input = input;
611
- this.ranges = ranges;
612
- this.chunk = "";
613
- this.chunkOff = 0;
614
- this.chunk2 = "";
615
- this.chunk2Pos = 0;
616
- this.next = -1;
617
- this.token = nullToken;
618
- this.rangeIndex = 0;
619
- this.pos = this.chunkPos = ranges[0].from;
620
- this.range = ranges[0];
621
- this.end = ranges[ranges.length - 1].to;
622
- this.readNext();
623
- }
624
- /**
625
- @internal
626
- */
627
- resolveOffset(offset, assoc) {
628
- let range = this.range, index = this.rangeIndex;
629
- let pos = this.pos + offset;
630
- while (pos < range.from) {
631
- if (!index)
632
- return null;
633
- let next = this.ranges[--index];
634
- pos -= range.from - next.to;
635
- range = next;
636
- }
637
- while (assoc < 0 ? pos > range.to : pos >= range.to) {
638
- if (index == this.ranges.length - 1)
639
- return null;
640
- let next = this.ranges[++index];
641
- pos += next.from - range.to;
642
- range = next;
643
- }
644
- return pos;
645
- }
646
- /**
647
- @internal
648
- */
649
- clipPos(pos) {
650
- if (pos >= this.range.from && pos < this.range.to)
651
- return pos;
652
- for (let range of this.ranges)
653
- if (range.to > pos)
654
- return Math.max(pos, range.from);
655
- return this.end;
656
- }
657
- /**
658
- Look at a code unit near the stream position. `.peek(0)` equals
659
- `.next`, `.peek(-1)` gives you the previous character, and so
660
- on.
661
-
662
- Note that looking around during tokenizing creates dependencies
663
- on potentially far-away content, which may reduce the
664
- effectiveness incremental parsing—when looking forward—or even
665
- cause invalid reparses when looking backward more than 25 code
666
- units, since the library does not track lookbehind.
667
- */
668
- peek(offset) {
669
- let idx = this.chunkOff + offset, pos, result;
670
- if (idx >= 0 && idx < this.chunk.length) {
671
- pos = this.pos + offset;
672
- result = this.chunk.charCodeAt(idx);
673
- } else {
674
- let resolved = this.resolveOffset(offset, 1);
675
- if (resolved == null)
676
- return -1;
677
- pos = resolved;
678
- if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
679
- result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
680
- } else {
681
- let i = this.rangeIndex, range = this.range;
682
- while (range.to <= pos)
683
- range = this.ranges[++i];
684
- this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
685
- if (pos + this.chunk2.length > range.to)
686
- this.chunk2 = this.chunk2.slice(0, range.to - pos);
687
- result = this.chunk2.charCodeAt(0);
688
- }
689
- }
690
- if (pos >= this.token.lookAhead)
691
- this.token.lookAhead = pos + 1;
692
- return result;
693
- }
694
- /**
695
- Accept a token. By default, the end of the token is set to the
696
- current stream position, but you can pass an offset (relative to
697
- the stream position) to change that.
698
- */
699
- acceptToken(token, endOffset = 0) {
700
- let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;
701
- if (end == null || end < this.token.start)
702
- throw new RangeError("Token end out of bounds");
703
- this.token.value = token;
704
- this.token.end = end;
705
- }
706
- /**
707
- Accept a token ending at a specific given position.
708
- */
709
- acceptTokenTo(token, endPos) {
710
- this.token.value = token;
711
- this.token.end = endPos;
712
- }
713
- getChunk() {
714
- if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
715
- let { chunk, chunkPos } = this;
716
- this.chunk = this.chunk2;
717
- this.chunkPos = this.chunk2Pos;
718
- this.chunk2 = chunk;
719
- this.chunk2Pos = chunkPos;
720
- this.chunkOff = this.pos - this.chunkPos;
721
- } else {
722
- this.chunk2 = this.chunk;
723
- this.chunk2Pos = this.chunkPos;
724
- let nextChunk = this.input.chunk(this.pos);
725
- let end = this.pos + nextChunk.length;
726
- this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
727
- this.chunkPos = this.pos;
728
- this.chunkOff = 0;
729
- }
730
- }
731
- readNext() {
732
- if (this.chunkOff >= this.chunk.length) {
733
- this.getChunk();
734
- if (this.chunkOff == this.chunk.length)
735
- return this.next = -1;
736
- }
737
- return this.next = this.chunk.charCodeAt(this.chunkOff);
738
- }
739
- /**
740
- Move the stream forward N (defaults to 1) code units. Returns
741
- the new value of [`next`](#lr.InputStream.next).
742
- */
743
- advance(n = 1) {
744
- this.chunkOff += n;
745
- while (this.pos + n >= this.range.to) {
746
- if (this.rangeIndex == this.ranges.length - 1)
747
- return this.setDone();
748
- n -= this.range.to - this.pos;
749
- this.range = this.ranges[++this.rangeIndex];
750
- this.pos = this.range.from;
751
- }
752
- this.pos += n;
753
- if (this.pos >= this.token.lookAhead)
754
- this.token.lookAhead = this.pos + 1;
755
- return this.readNext();
756
- }
757
- setDone() {
758
- this.pos = this.chunkPos = this.end;
759
- this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];
760
- this.chunk = "";
761
- return this.next = -1;
762
- }
763
- /**
764
- @internal
765
- */
766
- reset(pos, token) {
767
- if (token) {
768
- this.token = token;
769
- token.start = pos;
770
- token.lookAhead = pos + 1;
771
- token.value = token.extended = -1;
772
- } else {
773
- this.token = nullToken;
774
- }
775
- if (this.pos != pos) {
776
- this.pos = pos;
777
- if (pos == this.end) {
778
- this.setDone();
779
- return this;
780
- }
781
- while (pos < this.range.from)
782
- this.range = this.ranges[--this.rangeIndex];
783
- while (pos >= this.range.to)
784
- this.range = this.ranges[++this.rangeIndex];
785
- if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {
786
- this.chunkOff = pos - this.chunkPos;
787
- } else {
788
- this.chunk = "";
789
- this.chunkOff = 0;
790
- }
791
- this.readNext();
792
- }
793
- return this;
794
- }
795
- /**
796
- @internal
797
- */
798
- read(from, to) {
799
- if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)
800
- return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);
801
- if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)
802
- return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
803
- if (from >= this.range.from && to <= this.range.to)
804
- return this.input.read(from, to);
805
- let result = "";
806
- for (let r of this.ranges) {
807
- if (r.from >= to)
808
- break;
809
- if (r.to > from)
810
- result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
811
- }
812
- return result;
813
- }
814
- };
815
- var TokenGroup = class {
816
- constructor(data, id2) {
817
- this.data = data;
818
- this.id = id2;
819
- }
820
- token(input, stack) {
821
- let { parser } = stack.p;
822
- readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);
823
- }
824
- };
825
- TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
826
- var LocalTokenGroup = class {
827
- constructor(data, precTable, elseToken) {
828
- this.precTable = precTable;
829
- this.elseToken = elseToken;
830
- this.data = typeof data == "string" ? decodeArray(data) : data;
831
- }
832
- token(input, stack) {
833
- let start = input.pos, skipped = 0;
834
- for (; ; ) {
835
- let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);
836
- readToken(this.data, input, stack, 0, this.data, this.precTable);
837
- if (input.token.value > -1)
838
- break;
839
- if (this.elseToken == null)
840
- return;
841
- if (!atEof)
842
- skipped++;
843
- if (nextPos == null)
844
- break;
845
- input.reset(nextPos, input.token);
846
- }
847
- if (skipped) {
848
- input.reset(start, input.token);
849
- input.acceptToken(this.elseToken, skipped);
850
- }
851
- }
852
- };
853
- LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
854
- var ExternalTokenizer = class {
855
- /**
856
- Create a tokenizer. The first argument is the function that,
857
- given an input stream, scans for the types of tokens it
858
- recognizes at the stream's position, and calls
859
- [`acceptToken`](#lr.InputStream.acceptToken) when it finds
860
- one.
861
- */
862
- constructor(token, options = {}) {
863
- this.token = token;
864
- this.contextual = !!options.contextual;
865
- this.fallback = !!options.fallback;
866
- this.extend = !!options.extend;
867
- }
868
- };
869
- function readToken(data, input, stack, group, precTable, precOffset) {
870
- let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;
871
- scan: for (; ; ) {
872
- if ((groupMask & data[state]) == 0)
873
- break;
874
- let accEnd = data[state + 1];
875
- for (let i = state + 3; i < accEnd; i += 2)
876
- if ((data[i + 1] & groupMask) > 0) {
877
- let term = data[i];
878
- if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || overrides(term, input.token.value, precTable, precOffset))) {
879
- input.acceptToken(term);
880
- break;
881
- }
882
- }
883
- let next = input.next, low = 0, high = data[state + 2];
884
- if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535) {
885
- state = data[accEnd + high * 3 - 1];
886
- continue scan;
887
- }
888
- for (; low < high; ) {
889
- let mid = low + high >> 1;
890
- let index = accEnd + mid + (mid << 1);
891
- let from = data[index], to = data[index + 1] || 65536;
892
- if (next < from)
893
- high = mid;
894
- else if (next >= to)
895
- low = mid + 1;
896
- else {
897
- state = data[index + 2];
898
- input.advance();
899
- continue scan;
900
- }
901
- }
902
- break;
903
- }
904
- }
905
- function findOffset(data, start, term) {
906
- for (let i = start, next; (next = data[i]) != 65535; i++)
907
- if (next == term)
908
- return i - start;
909
- return -1;
910
- }
911
- function overrides(token, prev, tableData, tableOffset) {
912
- let iPrev = findOffset(tableData, tableOffset, prev);
913
- return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;
914
- }
915
- var verbose = typeof process != "undefined" && process.env && /\bparse\b/.test(process.env.LOG);
916
- var stackIDs = null;
917
- function cutAt(tree, pos, side) {
918
- let cursor = tree.cursor(IterMode.IncludeAnonymous);
919
- cursor.moveTo(pos);
920
- for (; ; ) {
921
- if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))
922
- for (; ; ) {
923
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)
924
- return side < 0 ? Math.max(0, Math.min(
925
- cursor.to - 1,
926
- pos - 25
927
- /* Lookahead.Margin */
928
- )) : Math.min(tree.length, Math.max(
929
- cursor.from + 1,
930
- pos + 25
931
- /* Lookahead.Margin */
932
- ));
933
- if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())
934
- break;
935
- if (!cursor.parent())
936
- return side < 0 ? 0 : tree.length;
937
- }
938
- }
939
- }
940
- var FragmentCursor = class {
941
- constructor(fragments, nodeSet) {
942
- this.fragments = fragments;
943
- this.nodeSet = nodeSet;
944
- this.i = 0;
945
- this.fragment = null;
946
- this.safeFrom = -1;
947
- this.safeTo = -1;
948
- this.trees = [];
949
- this.start = [];
950
- this.index = [];
951
- this.nextFragment();
952
- }
953
- nextFragment() {
954
- let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
955
- if (fr) {
956
- this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;
957
- this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;
958
- while (this.trees.length) {
959
- this.trees.pop();
960
- this.start.pop();
961
- this.index.pop();
962
- }
963
- this.trees.push(fr.tree);
964
- this.start.push(-fr.offset);
965
- this.index.push(0);
966
- this.nextStart = this.safeFrom;
967
- } else {
968
- this.nextStart = 1e9;
969
- }
970
- }
971
- // `pos` must be >= any previously given `pos` for this cursor
972
- nodeAt(pos) {
973
- if (pos < this.nextStart)
974
- return null;
975
- while (this.fragment && this.safeTo <= pos)
976
- this.nextFragment();
977
- if (!this.fragment)
978
- return null;
979
- for (; ; ) {
980
- let last = this.trees.length - 1;
981
- if (last < 0) {
982
- this.nextFragment();
983
- return null;
984
- }
985
- let top = this.trees[last], index = this.index[last];
986
- if (index == top.children.length) {
987
- this.trees.pop();
988
- this.start.pop();
989
- this.index.pop();
990
- continue;
991
- }
992
- let next = top.children[index];
993
- let start = this.start[last] + top.positions[index];
994
- if (start > pos) {
995
- this.nextStart = start;
996
- return null;
997
- }
998
- if (next instanceof Tree) {
999
- if (start == pos) {
1000
- if (start < this.safeFrom)
1001
- return null;
1002
- let end = start + next.length;
1003
- if (end <= this.safeTo) {
1004
- let lookAhead = next.prop(NodeProp.lookAhead);
1005
- if (!lookAhead || end + lookAhead < this.fragment.to)
1006
- return next;
1007
- }
1008
- }
1009
- this.index[last]++;
1010
- if (start + next.length >= Math.max(this.safeFrom, pos)) {
1011
- this.trees.push(next);
1012
- this.start.push(start);
1013
- this.index.push(0);
1014
- }
1015
- } else {
1016
- this.index[last]++;
1017
- this.nextStart = start + next.length;
1018
- }
1019
- }
1020
- }
1021
- };
1022
- var TokenCache = class {
1023
- constructor(parser, stream) {
1024
- this.stream = stream;
1025
- this.tokens = [];
1026
- this.mainToken = null;
1027
- this.actions = [];
1028
- this.tokens = parser.tokenizers.map((_) => new CachedToken());
1029
- }
1030
- getActions(stack) {
1031
- let actionIndex = 0;
1032
- let main = null;
1033
- let { parser } = stack.p, { tokenizers } = parser;
1034
- let mask = parser.stateSlot(
1035
- stack.state,
1036
- 3
1037
- /* ParseState.TokenizerMask */
1038
- );
1039
- let context = stack.curContext ? stack.curContext.hash : 0;
1040
- let lookAhead = 0;
1041
- for (let i = 0; i < tokenizers.length; i++) {
1042
- if ((1 << i & mask) == 0)
1043
- continue;
1044
- let tokenizer = tokenizers[i], token = this.tokens[i];
1045
- if (main && !tokenizer.fallback)
1046
- continue;
1047
- if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {
1048
- this.updateCachedToken(token, tokenizer, stack);
1049
- token.mask = mask;
1050
- token.context = context;
1051
- }
1052
- if (token.lookAhead > token.end + 25)
1053
- lookAhead = Math.max(token.lookAhead, lookAhead);
1054
- if (token.value != 0) {
1055
- let startIndex = actionIndex;
1056
- if (token.extended > -1)
1057
- actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
1058
- actionIndex = this.addActions(stack, token.value, token.end, actionIndex);
1059
- if (!tokenizer.extend) {
1060
- main = token;
1061
- if (actionIndex > startIndex)
1062
- break;
1063
- }
1064
- }
1065
- }
1066
- while (this.actions.length > actionIndex)
1067
- this.actions.pop();
1068
- if (lookAhead)
1069
- stack.setLookAhead(lookAhead);
1070
- if (!main && stack.pos == this.stream.end) {
1071
- main = new CachedToken();
1072
- main.value = stack.p.parser.eofTerm;
1073
- main.start = main.end = stack.pos;
1074
- actionIndex = this.addActions(stack, main.value, main.end, actionIndex);
1075
- }
1076
- this.mainToken = main;
1077
- return this.actions;
1078
- }
1079
- getMainToken(stack) {
1080
- if (this.mainToken)
1081
- return this.mainToken;
1082
- let main = new CachedToken(), { pos, p } = stack;
1083
- main.start = pos;
1084
- main.end = Math.min(pos + 1, p.stream.end);
1085
- main.value = pos == p.stream.end ? p.parser.eofTerm : 0;
1086
- return main;
1087
- }
1088
- updateCachedToken(token, tokenizer, stack) {
1089
- let start = this.stream.clipPos(stack.pos);
1090
- tokenizer.token(this.stream.reset(start, token), stack);
1091
- if (token.value > -1) {
1092
- let { parser } = stack.p;
1093
- for (let i = 0; i < parser.specialized.length; i++)
1094
- if (parser.specialized[i] == token.value) {
1095
- let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);
1096
- if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
1097
- if ((result & 1) == 0)
1098
- token.value = result >> 1;
1099
- else
1100
- token.extended = result >> 1;
1101
- break;
1102
- }
1103
- }
1104
- } else {
1105
- token.value = 0;
1106
- token.end = this.stream.clipPos(start + 1);
1107
- }
1108
- }
1109
- putAction(action, token, end, index) {
1110
- for (let i = 0; i < index; i += 3)
1111
- if (this.actions[i] == action)
1112
- return index;
1113
- this.actions[index++] = action;
1114
- this.actions[index++] = token;
1115
- this.actions[index++] = end;
1116
- return index;
1117
- }
1118
- addActions(stack, token, end, index) {
1119
- let { state } = stack, { parser } = stack.p, { data } = parser;
1120
- for (let set = 0; set < 2; set++) {
1121
- for (let i = parser.stateSlot(
1122
- state,
1123
- set ? 2 : 1
1124
- /* ParseState.Actions */
1125
- ); ; i += 3) {
1126
- if (data[i] == 65535) {
1127
- if (data[i + 1] == 1) {
1128
- i = pair(data, i + 2);
1129
- } else {
1130
- if (index == 0 && data[i + 1] == 2)
1131
- index = this.putAction(pair(data, i + 2), token, end, index);
1132
- break;
1133
- }
1134
- }
1135
- if (data[i] == token)
1136
- index = this.putAction(pair(data, i + 1), token, end, index);
1137
- }
1138
- }
1139
- return index;
1140
- }
1141
- };
1142
- var Parse = class {
1143
- constructor(parser, input, fragments, ranges) {
1144
- this.parser = parser;
1145
- this.input = input;
1146
- this.ranges = ranges;
1147
- this.recovering = 0;
1148
- this.nextStackID = 9812;
1149
- this.minStackPos = 0;
1150
- this.reused = [];
1151
- this.stoppedAt = null;
1152
- this.lastBigReductionStart = -1;
1153
- this.lastBigReductionSize = 0;
1154
- this.bigReductionCount = 0;
1155
- this.stream = new InputStream(input, ranges);
1156
- this.tokens = new TokenCache(parser, this.stream);
1157
- this.topTerm = parser.top[1];
1158
- let { from } = ranges[0];
1159
- this.stacks = [Stack.start(this, parser.top[0], from)];
1160
- this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4 ? new FragmentCursor(fragments, parser.nodeSet) : null;
1161
- }
1162
- get parsedPos() {
1163
- return this.minStackPos;
1164
- }
1165
- // Move the parser forward. This will process all parse stacks at
1166
- // `this.pos` and try to advance them to a further position. If no
1167
- // stack for such a position is found, it'll start error-recovery.
1168
- //
1169
- // When the parse is finished, this will return a syntax tree. When
1170
- // not, it returns `null`.
1171
- advance() {
1172
- let stacks = this.stacks, pos = this.minStackPos;
1173
- let newStacks = this.stacks = [];
1174
- let stopped, stoppedTokens;
1175
- if (this.bigReductionCount > 300 && stacks.length == 1) {
1176
- let [s] = stacks;
1177
- while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) {
1178
- }
1179
- this.bigReductionCount = this.lastBigReductionSize = 0;
1180
- }
1181
- for (let i = 0; i < stacks.length; i++) {
1182
- let stack = stacks[i];
1183
- for (; ; ) {
1184
- this.tokens.mainToken = null;
1185
- if (stack.pos > pos) {
1186
- newStacks.push(stack);
1187
- } else if (this.advanceStack(stack, newStacks, stacks)) {
1188
- continue;
1189
- } else {
1190
- if (!stopped) {
1191
- stopped = [];
1192
- stoppedTokens = [];
1193
- }
1194
- stopped.push(stack);
1195
- let tok = this.tokens.getMainToken(stack);
1196
- stoppedTokens.push(tok.value, tok.end);
1197
- }
1198
- break;
1199
- }
1200
- }
1201
- if (!newStacks.length) {
1202
- let finished = stopped && findFinished(stopped);
1203
- if (finished) {
1204
- if (verbose)
1205
- console.log("Finish with " + this.stackID(finished));
1206
- return this.stackToTree(finished);
1207
- }
1208
- if (this.parser.strict) {
1209
- if (verbose && stopped)
1210
- console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none"));
1211
- throw new SyntaxError("No parse at " + pos);
1212
- }
1213
- if (!this.recovering)
1214
- this.recovering = 5;
1215
- }
1216
- if (this.recovering && stopped) {
1217
- let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks);
1218
- if (finished) {
1219
- if (verbose)
1220
- console.log("Force-finish " + this.stackID(finished));
1221
- return this.stackToTree(finished.forceAll());
1222
- }
1223
- }
1224
- if (this.recovering) {
1225
- let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3;
1226
- if (newStacks.length > maxRemaining) {
1227
- newStacks.sort((a, b) => b.score - a.score);
1228
- while (newStacks.length > maxRemaining)
1229
- newStacks.pop();
1230
- }
1231
- if (newStacks.some((s) => s.reducePos > pos))
1232
- this.recovering--;
1233
- } else if (newStacks.length > 1) {
1234
- outer: for (let i = 0; i < newStacks.length - 1; i++) {
1235
- let stack = newStacks[i];
1236
- for (let j = i + 1; j < newStacks.length; j++) {
1237
- let other = newStacks[j];
1238
- if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) {
1239
- if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) {
1240
- newStacks.splice(j--, 1);
1241
- } else {
1242
- newStacks.splice(i--, 1);
1243
- continue outer;
1244
- }
1245
- }
1246
- }
1247
- }
1248
- if (newStacks.length > 12) {
1249
- newStacks.sort((a, b) => b.score - a.score);
1250
- newStacks.splice(
1251
- 12,
1252
- newStacks.length - 12
1253
- /* Rec.MaxStackCount */
1254
- );
1255
- }
1256
- }
1257
- this.minStackPos = newStacks[0].pos;
1258
- for (let i = 1; i < newStacks.length; i++)
1259
- if (newStacks[i].pos < this.minStackPos)
1260
- this.minStackPos = newStacks[i].pos;
1261
- return null;
1262
- }
1263
- stopAt(pos) {
1264
- if (this.stoppedAt != null && this.stoppedAt < pos)
1265
- throw new RangeError("Can't move stoppedAt forward");
1266
- this.stoppedAt = pos;
1267
- }
1268
- // Returns an updated version of the given stack, or null if the
1269
- // stack can't advance normally. When `split` and `stacks` are
1270
- // given, stacks split off by ambiguous operations will be pushed to
1271
- // `split`, or added to `stacks` if they move `pos` forward.
1272
- advanceStack(stack, stacks, split) {
1273
- let start = stack.pos, { parser } = this;
1274
- let base = verbose ? this.stackID(stack) + " -> " : "";
1275
- if (this.stoppedAt != null && start > this.stoppedAt)
1276
- return stack.forceReduce() ? stack : null;
1277
- if (this.fragments) {
1278
- let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;
1279
- for (let cached = this.fragments.nodeAt(start); cached; ) {
1280
- let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;
1281
- if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {
1282
- stack.useNode(cached, match);
1283
- if (verbose)
1284
- console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);
1285
- return true;
1286
- }
1287
- if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)
1288
- break;
1289
- let inner = cached.children[0];
1290
- if (inner instanceof Tree && cached.positions[0] == 0)
1291
- cached = inner;
1292
- else
1293
- break;
1294
- }
1295
- }
1296
- let defaultReduce = parser.stateSlot(
1297
- stack.state,
1298
- 4
1299
- /* ParseState.DefaultReduce */
1300
- );
1301
- if (defaultReduce > 0) {
1302
- stack.reduce(defaultReduce);
1303
- if (verbose)
1304
- console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(
1305
- defaultReduce & 65535
1306
- /* Action.ValueMask */
1307
- )})`);
1308
- return true;
1309
- }
1310
- if (stack.stack.length >= 8400) {
1311
- while (stack.stack.length > 6e3 && stack.forceReduce()) {
1312
- }
1313
- }
1314
- let actions = this.tokens.getActions(stack);
1315
- for (let i = 0; i < actions.length; ) {
1316
- let action = actions[i++], term = actions[i++], end = actions[i++];
1317
- let last = i == actions.length || !split;
1318
- let localStack = last ? stack : stack.split();
1319
- let main = this.tokens.mainToken;
1320
- localStack.apply(action, term, main ? main.start : localStack.pos, end);
1321
- if (verbose)
1322
- console.log(base + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser.getName(
1323
- action & 65535
1324
- /* Action.ValueMask */
1325
- )}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`);
1326
- if (last)
1327
- return true;
1328
- else if (localStack.pos > start)
1329
- stacks.push(localStack);
1330
- else
1331
- split.push(localStack);
1332
- }
1333
- return false;
1334
- }
1335
- // Advance a given stack forward as far as it will go. Returns the
1336
- // (possibly updated) stack if it got stuck, or null if it moved
1337
- // forward and was given to `pushStackDedup`.
1338
- advanceFully(stack, newStacks) {
1339
- let pos = stack.pos;
1340
- for (; ; ) {
1341
- if (!this.advanceStack(stack, null, null))
1342
- return false;
1343
- if (stack.pos > pos) {
1344
- pushStackDedup(stack, newStacks);
1345
- return true;
1346
- }
1347
- }
1348
- }
1349
- runRecovery(stacks, tokens, newStacks) {
1350
- let finished = null, restarted = false;
1351
- for (let i = 0; i < stacks.length; i++) {
1352
- let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];
1353
- let base = verbose ? this.stackID(stack) + " -> " : "";
1354
- if (stack.deadEnd) {
1355
- if (restarted)
1356
- continue;
1357
- restarted = true;
1358
- stack.restart();
1359
- if (verbose)
1360
- console.log(base + this.stackID(stack) + " (restarted)");
1361
- let done = this.advanceFully(stack, newStacks);
1362
- if (done)
1363
- continue;
1364
- }
1365
- let force = stack.split(), forceBase = base;
1366
- for (let j = 0; j < 10 && force.forceReduce(); j++) {
1367
- if (verbose)
1368
- console.log(forceBase + this.stackID(force) + " (via force-reduce)");
1369
- let done = this.advanceFully(force, newStacks);
1370
- if (done)
1371
- break;
1372
- if (verbose)
1373
- forceBase = this.stackID(force) + " -> ";
1374
- }
1375
- for (let insert of stack.recoverByInsert(token)) {
1376
- if (verbose)
1377
- console.log(base + this.stackID(insert) + " (via recover-insert)");
1378
- this.advanceFully(insert, newStacks);
1379
- }
1380
- if (this.stream.end > stack.pos) {
1381
- if (tokenEnd == stack.pos) {
1382
- tokenEnd++;
1383
- token = 0;
1384
- }
1385
- stack.recoverByDelete(token, tokenEnd);
1386
- if (verbose)
1387
- console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);
1388
- pushStackDedup(stack, newStacks);
1389
- } else if (!finished || finished.score < force.score) {
1390
- finished = force;
1391
- }
1392
- }
1393
- return finished;
1394
- }
1395
- // Convert the stack's buffer to a syntax tree.
1396
- stackToTree(stack) {
1397
- stack.close();
1398
- return Tree.build({
1399
- buffer: StackBufferCursor.create(stack),
1400
- nodeSet: this.parser.nodeSet,
1401
- topID: this.topTerm,
1402
- maxBufferLength: this.parser.bufferLength,
1403
- reused: this.reused,
1404
- start: this.ranges[0].from,
1405
- length: stack.pos - this.ranges[0].from,
1406
- minRepeatType: this.parser.minRepeatTerm
1407
- });
1408
- }
1409
- stackID(stack) {
1410
- let id2 = (stackIDs || (stackIDs = /* @__PURE__ */ new WeakMap())).get(stack);
1411
- if (!id2)
1412
- stackIDs.set(stack, id2 = String.fromCodePoint(this.nextStackID++));
1413
- return id2 + stack;
1414
- }
1415
- };
1416
- function pushStackDedup(stack, newStacks) {
1417
- for (let i = 0; i < newStacks.length; i++) {
1418
- let other = newStacks[i];
1419
- if (other.pos == stack.pos && other.sameState(stack)) {
1420
- if (newStacks[i].score < stack.score)
1421
- newStacks[i] = stack;
1422
- return;
1423
- }
1424
- }
1425
- newStacks.push(stack);
1426
- }
1427
- var Dialect = class {
1428
- constructor(source, flags, disabled) {
1429
- this.source = source;
1430
- this.flags = flags;
1431
- this.disabled = disabled;
1432
- }
1433
- allows(term) {
1434
- return !this.disabled || this.disabled[term] == 0;
1435
- }
1436
- };
1437
- var id = (x) => x;
1438
- var ContextTracker = class {
1439
- /**
1440
- Define a context tracker.
1441
- */
1442
- constructor(spec) {
1443
- this.start = spec.start;
1444
- this.shift = spec.shift || id;
1445
- this.reduce = spec.reduce || id;
1446
- this.reuse = spec.reuse || id;
1447
- this.hash = spec.hash || (() => 0);
1448
- this.strict = spec.strict !== false;
1449
- }
1450
- };
1451
- var LRParser = class _LRParser extends Parser {
1452
- /**
1453
- @internal
1454
- */
1455
- constructor(spec) {
1456
- super();
1457
- this.wrappers = [];
1458
- if (spec.version != 14)
1459
- throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14})`);
1460
- let nodeNames = spec.nodeNames.split(" ");
1461
- this.minRepeatTerm = nodeNames.length;
1462
- for (let i = 0; i < spec.repeatNodeCount; i++)
1463
- nodeNames.push("");
1464
- let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]);
1465
- let nodeProps = [];
1466
- for (let i = 0; i < nodeNames.length; i++)
1467
- nodeProps.push([]);
1468
- function setProp(nodeID, prop, value) {
1469
- nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);
1470
- }
1471
- if (spec.nodeProps)
1472
- for (let propSpec of spec.nodeProps) {
1473
- let prop = propSpec[0];
1474
- if (typeof prop == "string")
1475
- prop = NodeProp[prop];
1476
- for (let i = 1; i < propSpec.length; ) {
1477
- let next = propSpec[i++];
1478
- if (next >= 0) {
1479
- setProp(next, prop, propSpec[i++]);
1480
- } else {
1481
- let value = propSpec[i + -next];
1482
- for (let j = -next; j > 0; j--)
1483
- setProp(propSpec[i++], prop, value);
1484
- i++;
1485
- }
1486
- }
1487
- }
1488
- this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({
1489
- name: i >= this.minRepeatTerm ? void 0 : name,
1490
- id: i,
1491
- props: nodeProps[i],
1492
- top: topTerms.indexOf(i) > -1,
1493
- error: i == 0,
1494
- skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1
1495
- })));
1496
- if (spec.propSources)
1497
- this.nodeSet = this.nodeSet.extend(...spec.propSources);
1498
- this.strict = false;
1499
- this.bufferLength = DefaultBufferLength;
1500
- let tokenArray = decodeArray(spec.tokenData);
1501
- this.context = spec.context;
1502
- this.specializerSpecs = spec.specialized || [];
1503
- this.specialized = new Uint16Array(this.specializerSpecs.length);
1504
- for (let i = 0; i < this.specializerSpecs.length; i++)
1505
- this.specialized[i] = this.specializerSpecs[i].term;
1506
- this.specializers = this.specializerSpecs.map(getSpecializer);
1507
- this.states = decodeArray(spec.states, Uint32Array);
1508
- this.data = decodeArray(spec.stateData);
1509
- this.goto = decodeArray(spec.goto);
1510
- this.maxTerm = spec.maxTerm;
1511
- this.tokenizers = spec.tokenizers.map((value) => typeof value == "number" ? new TokenGroup(tokenArray, value) : value);
1512
- this.topRules = spec.topRules;
1513
- this.dialects = spec.dialects || {};
1514
- this.dynamicPrecedences = spec.dynamicPrecedences || null;
1515
- this.tokenPrecTable = spec.tokenPrec;
1516
- this.termNames = spec.termNames || null;
1517
- this.maxNode = this.nodeSet.types.length - 1;
1518
- this.dialect = this.parseDialect();
1519
- this.top = this.topRules[Object.keys(this.topRules)[0]];
1520
- }
1521
- createParse(input, fragments, ranges) {
1522
- let parse = new Parse(this, input, fragments, ranges);
1523
- for (let w of this.wrappers)
1524
- parse = w(parse, input, fragments, ranges);
1525
- return parse;
1526
- }
1527
- /**
1528
- Get a goto table entry @internal
1529
- */
1530
- getGoto(state, term, loose = false) {
1531
- let table = this.goto;
1532
- if (term >= table[0])
1533
- return -1;
1534
- for (let pos = table[term + 1]; ; ) {
1535
- let groupTag = table[pos++], last = groupTag & 1;
1536
- let target = table[pos++];
1537
- if (last && loose)
1538
- return target;
1539
- for (let end = pos + (groupTag >> 1); pos < end; pos++)
1540
- if (table[pos] == state)
1541
- return target;
1542
- if (last)
1543
- return -1;
1544
- }
1545
- }
1546
- /**
1547
- Check if this state has an action for a given terminal @internal
1548
- */
1549
- hasAction(state, terminal) {
1550
- let data = this.data;
1551
- for (let set = 0; set < 2; set++) {
1552
- for (let i = this.stateSlot(
1553
- state,
1554
- set ? 2 : 1
1555
- /* ParseState.Actions */
1556
- ), next; ; i += 3) {
1557
- if ((next = data[i]) == 65535) {
1558
- if (data[i + 1] == 1)
1559
- next = data[i = pair(data, i + 2)];
1560
- else if (data[i + 1] == 2)
1561
- return pair(data, i + 2);
1562
- else
1563
- break;
1564
- }
1565
- if (next == terminal || next == 0)
1566
- return pair(data, i + 1);
1567
- }
1568
- }
1569
- return 0;
1570
- }
1571
- /**
1572
- @internal
1573
- */
1574
- stateSlot(state, slot) {
1575
- return this.states[state * 6 + slot];
1576
- }
1577
- /**
1578
- @internal
1579
- */
1580
- stateFlag(state, flag) {
1581
- return (this.stateSlot(
1582
- state,
1583
- 0
1584
- /* ParseState.Flags */
1585
- ) & flag) > 0;
1586
- }
1587
- /**
1588
- @internal
1589
- */
1590
- validAction(state, action) {
1591
- return !!this.allActions(state, (a) => a == action ? true : null);
1592
- }
1593
- /**
1594
- @internal
1595
- */
1596
- allActions(state, action) {
1597
- let deflt = this.stateSlot(
1598
- state,
1599
- 4
1600
- /* ParseState.DefaultReduce */
1601
- );
1602
- let result = deflt ? action(deflt) : void 0;
1603
- for (let i = this.stateSlot(
1604
- state,
1605
- 1
1606
- /* ParseState.Actions */
1607
- ); result == null; i += 3) {
1608
- if (this.data[i] == 65535) {
1609
- if (this.data[i + 1] == 1)
1610
- i = pair(this.data, i + 2);
1611
- else
1612
- break;
1613
- }
1614
- result = action(pair(this.data, i + 1));
1615
- }
1616
- return result;
1617
- }
1618
- /**
1619
- Get the states that can follow this one through shift actions or
1620
- goto jumps. @internal
1621
- */
1622
- nextStates(state) {
1623
- let result = [];
1624
- for (let i = this.stateSlot(
1625
- state,
1626
- 1
1627
- /* ParseState.Actions */
1628
- ); ; i += 3) {
1629
- if (this.data[i] == 65535) {
1630
- if (this.data[i + 1] == 1)
1631
- i = pair(this.data, i + 2);
1632
- else
1633
- break;
1634
- }
1635
- if ((this.data[i + 2] & 65536 >> 16) == 0) {
1636
- let value = this.data[i + 1];
1637
- if (!result.some((v, i2) => i2 & 1 && v == value))
1638
- result.push(this.data[i], value);
1639
- }
1640
- }
1641
- return result;
1642
- }
1643
- /**
1644
- Configure the parser. Returns a new parser instance that has the
1645
- given settings modified. Settings not provided in `config` are
1646
- kept from the original parser.
1647
- */
1648
- configure(config) {
1649
- let copy = Object.assign(Object.create(_LRParser.prototype), this);
1650
- if (config.props)
1651
- copy.nodeSet = this.nodeSet.extend(...config.props);
1652
- if (config.top) {
1653
- let info = this.topRules[config.top];
1654
- if (!info)
1655
- throw new RangeError(`Invalid top rule name ${config.top}`);
1656
- copy.top = info;
1657
- }
1658
- if (config.tokenizers)
1659
- copy.tokenizers = this.tokenizers.map((t) => {
1660
- let found = config.tokenizers.find((r) => r.from == t);
1661
- return found ? found.to : t;
1662
- });
1663
- if (config.specializers) {
1664
- copy.specializers = this.specializers.slice();
1665
- copy.specializerSpecs = this.specializerSpecs.map((s, i) => {
1666
- let found = config.specializers.find((r) => r.from == s.external);
1667
- if (!found)
1668
- return s;
1669
- let spec = Object.assign(Object.assign({}, s), { external: found.to });
1670
- copy.specializers[i] = getSpecializer(spec);
1671
- return spec;
1672
- });
1673
- }
1674
- if (config.contextTracker)
1675
- copy.context = config.contextTracker;
1676
- if (config.dialect)
1677
- copy.dialect = this.parseDialect(config.dialect);
1678
- if (config.strict != null)
1679
- copy.strict = config.strict;
1680
- if (config.wrap)
1681
- copy.wrappers = copy.wrappers.concat(config.wrap);
1682
- if (config.bufferLength != null)
1683
- copy.bufferLength = config.bufferLength;
1684
- return copy;
1685
- }
1686
- /**
1687
- Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)
1688
- are registered for this parser.
1689
- */
1690
- hasWrappers() {
1691
- return this.wrappers.length > 0;
1692
- }
1693
- /**
1694
- Returns the name associated with a given term. This will only
1695
- work for all terms when the parser was generated with the
1696
- `--names` option. By default, only the names of tagged terms are
1697
- stored.
1698
- */
1699
- getName(term) {
1700
- return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);
1701
- }
1702
- /**
1703
- The eof term id is always allocated directly after the node
1704
- types. @internal
1705
- */
1706
- get eofTerm() {
1707
- return this.maxNode + 1;
1708
- }
1709
- /**
1710
- The type of top node produced by the parser.
1711
- */
1712
- get topNode() {
1713
- return this.nodeSet.types[this.top[1]];
1714
- }
1715
- /**
1716
- @internal
1717
- */
1718
- dynamicPrecedence(term) {
1719
- let prec = this.dynamicPrecedences;
1720
- return prec == null ? 0 : prec[term] || 0;
1721
- }
1722
- /**
1723
- @internal
1724
- */
1725
- parseDialect(dialect) {
1726
- let values = Object.keys(this.dialects), flags = values.map(() => false);
1727
- if (dialect)
1728
- for (let part of dialect.split(" ")) {
1729
- let id2 = values.indexOf(part);
1730
- if (id2 >= 0)
1731
- flags[id2] = true;
1732
- }
1733
- let disabled = null;
1734
- for (let i = 0; i < values.length; i++)
1735
- if (!flags[i]) {
1736
- for (let j = this.dialects[values[i]], id2; (id2 = this.data[j++]) != 65535; )
1737
- (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id2] = 1;
1738
- }
1739
- return new Dialect(dialect, flags, disabled);
1740
- }
1741
- /**
1742
- Used by the output of the parser generator. Not available to
1743
- user code. @hide
1744
- */
1745
- static deserialize(spec) {
1746
- return new _LRParser(spec);
1747
- }
1748
- };
1749
- function pair(data, off) {
1750
- return data[off] | data[off + 1] << 16;
1751
- }
1752
- function findFinished(stacks) {
1753
- let best = null;
1754
- for (let stack of stacks) {
1755
- let stopped = stack.p.stoppedAt;
1756
- if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(
1757
- stack.state,
1758
- 2
1759
- /* StateFlag.Accepting */
1760
- ) && (!best || best.score < stack.score))
1761
- best = stack;
1762
- }
1763
- return best;
1764
- }
1765
- function getSpecializer(spec) {
1766
- if (spec.external) {
1767
- let mask = spec.extend ? 1 : 0;
1768
- return (value, stack) => spec.external(value, stack) << 1 | mask;
1769
- }
1770
- return spec.get;
1771
- }
1772
-
1773
- export {
1774
- LocalTokenGroup,
1775
- ExternalTokenizer,
1776
- ContextTracker,
1777
- LRParser
1778
- };
1779
- //# sourceMappingURL=chunk-MBTMKYFQ.js.map