functionalscript 0.13.1 → 0.14.1

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 (361) hide show
  1. package/{types → fs}/asn.1/module.f.d.ts +1 -1
  2. package/{types → fs}/asn.1/module.f.js +3 -3
  3. package/{types → fs}/asn.1/test.f.js +2 -2
  4. package/{types → fs}/base128/module.f.d.ts +1 -1
  5. package/{types → fs}/base128/module.f.js +1 -1
  6. package/{types → fs}/base128/test.f.js +2 -2
  7. package/{bnf → fs/bnf}/data/module.f.d.ts +1 -1
  8. package/{cas → fs/cas}/module.f.d.ts +4 -4
  9. package/{cas → fs/cas}/module.f.js +1 -1
  10. package/{types → fs}/cbase32/module.f.d.ts +2 -2
  11. package/{types → fs}/cbase32/module.f.js +1 -1
  12. package/{types → fs}/cbase32/test.f.js +1 -1
  13. package/fs/ci/bun/module.f.d.ts +2 -0
  14. package/fs/ci/bun/module.f.js +20 -0
  15. package/fs/ci/common/module.f.d.ts +43 -0
  16. package/fs/ci/common/module.f.js +32 -0
  17. package/fs/ci/config/module.f.d.ts +25 -0
  18. package/fs/ci/config/module.f.js +34 -0
  19. package/fs/ci/deno/module.f.d.ts +2 -0
  20. package/fs/ci/deno/module.f.js +13 -0
  21. package/{ci → fs/ci}/module.f.d.ts +1 -1
  22. package/fs/ci/module.f.js +43 -0
  23. package/fs/ci/node/module.f.d.ts +6 -0
  24. package/fs/ci/node/module.f.js +36 -0
  25. package/fs/ci/playwright/module.f.d.ts +2 -0
  26. package/fs/ci/playwright/module.f.js +23 -0
  27. package/fs/ci/rust/module.f.d.ts +2 -0
  28. package/fs/ci/rust/module.f.js +49 -0
  29. package/{dev/tf → fs/ci}/test.f.d.ts +2 -1
  30. package/fs/ci/test.f.js +40 -0
  31. package/{crypto → fs/crypto}/secp/module.f.d.ts +1 -2
  32. package/{dev → fs/dev}/module.f.d.ts +2 -0
  33. package/{dev → fs/dev}/module.f.js +5 -0
  34. package/{dev → fs/dev}/tf/all.test.js +7 -5
  35. package/{dev → fs/dev}/tf/module.f.d.ts +1 -1
  36. package/{dev → fs/dev}/tf/module.f.js +12 -9
  37. package/fs/dev/tf/test.f.d.ts +16 -0
  38. package/fs/dev/tf/test.f.js +22 -0
  39. package/fs/dev/version/module.f.d.ts +3 -0
  40. package/{djs → fs/djs}/tokenizer/module.f.js +3 -3
  41. package/{djs/parser-new → fs/djs/tokenizer-new}/test.f.d.ts +2 -1
  42. package/fs/djs/tokenizer-new/test.f.js +894 -0
  43. package/{js → fs/js}/tokenizer/module.f.js +34 -34
  44. package/{json → fs/json}/tokenizer/module.f.js +1 -1
  45. package/{path → fs/path}/module.f.d.ts +1 -1
  46. package/fs/sul/id/module.f.d.ts +33 -0
  47. package/fs/sul/id/module.f.js +94 -0
  48. package/fs/sul/id/test.f.d.ts +21 -0
  49. package/fs/sul/id/test.f.js +75 -0
  50. package/fs/sul/level/hash/module.f.d.ts +38 -0
  51. package/fs/sul/level/hash/module.f.js +43 -0
  52. package/fs/sul/level/hash/test.f.d.ts +14 -0
  53. package/fs/sul/level/hash/test.f.js +112 -0
  54. package/fs/sul/level/literal/module.f.d.ts +64 -0
  55. package/fs/sul/level/literal/module.f.js +88 -0
  56. package/fs/sul/level/literal/test.f.d.ts +12 -0
  57. package/fs/sul/level/literal/test.f.js +722 -0
  58. package/fs/sul/module.f.d.ts +23 -0
  59. package/fs/sul/module.f.js +46 -0
  60. package/fs/sul/test.f.d.ts +10 -0
  61. package/fs/sul/test.f.js +47 -0
  62. package/{text → fs/text}/module.f.d.ts +1 -1
  63. package/{text → fs/text}/utf16/module.f.js +8 -8
  64. package/{text → fs/text}/utf8/module.f.js +2 -2
  65. package/{types → fs/types}/bit_vec/module.f.d.ts +13 -1
  66. package/{types → fs/types}/bit_vec/module.f.js +33 -15
  67. package/{types → fs/types}/effects/module.f.d.ts +1 -0
  68. package/{types → fs/types}/effects/node/virtual/module.f.d.ts +3 -3
  69. package/{types → fs/types}/function/operator/module.f.d.ts +1 -1
  70. package/{types → fs/types}/function/operator/module.f.js +1 -1
  71. package/{types → fs/types}/list/module.f.js +1 -1
  72. package/fs/types/patricia_trie/module.f.d.ts +25 -0
  73. package/fs/types/patricia_trie/module.f.js +35 -0
  74. package/fs/types/patricia_trie/test.f.d.ts +8 -0
  75. package/fs/types/patricia_trie/test.f.js +121 -0
  76. package/{types → fs/types}/rtti/module.f.d.ts +12 -1
  77. package/fs/types/rtti/module.f.js +100 -0
  78. package/fs/types/rtti/parse/module.f.d.ts +32 -0
  79. package/fs/types/rtti/parse/module.f.js +113 -0
  80. package/fs/types/rtti/parse/test.f.d.ts +116 -0
  81. package/fs/types/rtti/parse/test.f.js +345 -0
  82. package/fs/types/rtti/test.f.d.ts +34 -0
  83. package/fs/types/rtti/test.f.js +123 -0
  84. package/fs/types/rtti/validate/module.f.d.ts +80 -0
  85. package/{types → fs/types}/rtti/validate/module.f.js +33 -25
  86. package/{types → fs/types}/rtti/validate/test.f.d.ts +23 -0
  87. package/{types → fs/types}/rtti/validate/test.f.js +67 -0
  88. package/{types → fs/types}/uint8array/module.f.d.ts +2 -2
  89. package/package.json +8 -8
  90. package/ci/module.f.js +0 -183
  91. package/dev/tf/test.f.js +0 -5
  92. package/dev/version/module.f.d.ts +0 -3
  93. package/djs/parser-new/test.f.js +0 -202
  94. package/types/rtti/module.f.js +0 -27
  95. package/types/rtti/test.f.d.ts +0 -6
  96. package/types/rtti/test.f.js +0 -22
  97. package/types/rtti/validate/module.f.d.ts +0 -50
  98. /package/{types → fs}/asn.1/test.f.d.ts +0 -0
  99. /package/{cas → fs/base128}/test.f.d.ts +0 -0
  100. /package/{bnf → fs/bnf}/data/module.f.js +0 -0
  101. /package/{bnf → fs/bnf}/data/test.f.d.ts +0 -0
  102. /package/{bnf → fs/bnf}/data/test.f.js +0 -0
  103. /package/{bnf → fs/bnf}/module.f.d.ts +0 -0
  104. /package/{bnf → fs/bnf}/module.f.js +0 -0
  105. /package/{bnf → fs/bnf}/test.f.d.ts +0 -0
  106. /package/{bnf → fs/bnf}/test.f.js +0 -0
  107. /package/{bnf → fs/bnf}/testlib.f.d.ts +0 -0
  108. /package/{bnf → fs/bnf}/testlib.f.js +0 -0
  109. /package/{types/base128 → fs/cas}/test.f.d.ts +0 -0
  110. /package/{cas → fs/cas}/test.f.js +0 -0
  111. /package/{types → fs}/cbase32/test.f.d.ts +0 -0
  112. /package/{crypto → fs/crypto}/hmac/module.f.d.ts +0 -0
  113. /package/{crypto → fs/crypto}/hmac/module.f.js +0 -0
  114. /package/{crypto → fs/crypto}/hmac/test.f.d.ts +0 -0
  115. /package/{crypto → fs/crypto}/hmac/test.f.js +0 -0
  116. /package/{crypto → fs/crypto}/secp/module.f.js +0 -0
  117. /package/{crypto → fs/crypto}/secp/test.f.d.ts +0 -0
  118. /package/{crypto → fs/crypto}/secp/test.f.js +0 -0
  119. /package/{crypto → fs/crypto}/sha2/module.f.d.ts +0 -0
  120. /package/{crypto → fs/crypto}/sha2/module.f.js +0 -0
  121. /package/{crypto → fs/crypto}/sha2/test.f.d.ts +0 -0
  122. /package/{crypto → fs/crypto}/sha2/test.f.js +0 -0
  123. /package/{crypto → fs/crypto}/sign/module.f.d.ts +0 -0
  124. /package/{crypto → fs/crypto}/sign/module.f.js +0 -0
  125. /package/{crypto → fs/crypto}/sign/test.f.d.ts +0 -0
  126. /package/{crypto → fs/crypto}/sign/test.f.js +0 -0
  127. /package/{dev → fs/dev}/index/module.f.d.ts +0 -0
  128. /package/{dev → fs/dev}/index/module.f.js +0 -0
  129. /package/{dev → fs/dev}/test.f.d.ts +0 -0
  130. /package/{dev → fs/dev}/test.f.js +0 -0
  131. /package/{dev → fs/dev}/tf/all.test.d.ts +0 -0
  132. /package/{dev → fs/dev}/version/module.f.js +0 -0
  133. /package/{dev → fs/dev}/version/test.f.d.ts +0 -0
  134. /package/{dev → fs/dev}/version/test.f.js +0 -0
  135. /package/{djs → fs/djs}/ast/module.f.d.ts +0 -0
  136. /package/{djs → fs/djs}/ast/module.f.js +0 -0
  137. /package/{djs → fs/djs}/ast/test.f.d.ts +0 -0
  138. /package/{djs → fs/djs}/ast/test.f.js +0 -0
  139. /package/{djs → fs/djs}/examples/input.f.d.ts +0 -0
  140. /package/{djs → fs/djs}/examples/input.f.js +0 -0
  141. /package/{djs → fs/djs}/examples/m.f.d.ts +0 -0
  142. /package/{djs → fs/djs}/examples/m.f.js +0 -0
  143. /package/{djs → fs/djs}/module.f.d.ts +0 -0
  144. /package/{djs → fs/djs}/module.f.js +0 -0
  145. /package/{djs → fs/djs}/parser/module.f.d.ts +0 -0
  146. /package/{djs → fs/djs}/parser/module.f.js +0 -0
  147. /package/{djs → fs/djs}/parser/test.f.d.ts +0 -0
  148. /package/{djs → fs/djs}/parser/test.f.js +0 -0
  149. /package/{djs → fs/djs}/serializer/module.f.d.ts +0 -0
  150. /package/{djs → fs/djs}/serializer/module.f.js +0 -0
  151. /package/{djs → fs/djs}/serializer/test.f.d.ts +0 -0
  152. /package/{djs → fs/djs}/serializer/test.f.js +0 -0
  153. /package/{djs → fs/djs}/tokenizer/module.f.d.ts +0 -0
  154. /package/{djs → fs/djs}/tokenizer/test.f.d.ts +0 -0
  155. /package/{djs → fs/djs}/tokenizer/test.f.js +0 -0
  156. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.d.ts +0 -0
  157. /package/{djs/parser-new → fs/djs/tokenizer-new}/module.f.js +0 -0
  158. /package/{djs → fs/djs}/transpiler/module.f.d.ts +0 -0
  159. /package/{djs → fs/djs}/transpiler/module.f.js +0 -0
  160. /package/{djs → fs/djs}/transpiler/test.f.d.ts +0 -0
  161. /package/{djs → fs/djs}/transpiler/test.f.js +0 -0
  162. /package/{fjs → fs/fjs}/module.d.ts +0 -0
  163. /package/{fjs → fs/fjs}/module.f.d.ts +0 -0
  164. /package/{fjs → fs/fjs}/module.f.js +0 -0
  165. /package/{fjs → fs/fjs}/module.js +0 -0
  166. /package/{fsc → fs/fsc}/bnf.f.d.ts +0 -0
  167. /package/{fsc → fs/fsc}/bnf.f.js +0 -0
  168. /package/{fsc → fs/fsc}/json.f.d.ts +0 -0
  169. /package/{fsc → fs/fsc}/json.f.js +0 -0
  170. /package/{fsc → fs/fsc}/module.f.d.ts +0 -0
  171. /package/{fsc → fs/fsc}/module.f.js +0 -0
  172. /package/{fsc → fs/fsc}/test.f.d.ts +0 -0
  173. /package/{fsc → fs/fsc}/test.f.js +0 -0
  174. /package/{fsm → fs/fsm}/module.f.d.ts +0 -0
  175. /package/{fsm → fs/fsm}/module.f.js +0 -0
  176. /package/{fsm → fs/fsm}/test.f.d.ts +0 -0
  177. /package/{fsm → fs/fsm}/test.f.js +0 -0
  178. /package/{html → fs/html}/module.f.d.ts +0 -0
  179. /package/{html → fs/html}/module.f.js +0 -0
  180. /package/{html → fs/html}/test.f.d.ts +0 -0
  181. /package/{html → fs/html}/test.f.js +0 -0
  182. /package/{io → fs/io}/module.d.ts +0 -0
  183. /package/{io → fs/io}/module.f.d.ts +0 -0
  184. /package/{io → fs/io}/module.f.js +0 -0
  185. /package/{io → fs/io}/module.js +0 -0
  186. /package/{io → fs/io}/virtual/module.f.d.ts +0 -0
  187. /package/{io → fs/io}/virtual/module.f.js +0 -0
  188. /package/{js → fs/js}/tokenizer/module.f.d.ts +0 -0
  189. /package/{js → fs/js}/tokenizer/test.f.d.ts +0 -0
  190. /package/{js → fs/js}/tokenizer/test.f.js +0 -0
  191. /package/{json → fs/json}/module.f.d.ts +0 -0
  192. /package/{json → fs/json}/module.f.js +0 -0
  193. /package/{json → fs/json}/parser/module.f.d.ts +0 -0
  194. /package/{json → fs/json}/parser/module.f.js +0 -0
  195. /package/{json → fs/json}/parser/test.f.d.ts +0 -0
  196. /package/{json → fs/json}/parser/test.f.js +0 -0
  197. /package/{json → fs/json}/serializer/module.f.d.ts +0 -0
  198. /package/{json → fs/json}/serializer/module.f.js +0 -0
  199. /package/{json → fs/json}/serializer/test.f.d.ts +0 -0
  200. /package/{json → fs/json}/serializer/test.f.js +0 -0
  201. /package/{json → fs/json}/test.f.d.ts +0 -0
  202. /package/{json → fs/json}/test.f.js +0 -0
  203. /package/{json → fs/json}/tokenizer/module.f.d.ts +0 -0
  204. /package/{json → fs/json}/tokenizer/test.f.d.ts +0 -0
  205. /package/{json → fs/json}/tokenizer/test.f.js +0 -0
  206. /package/{path → fs/path}/module.f.js +0 -0
  207. /package/{path → fs/path}/test.f.d.ts +0 -0
  208. /package/{path → fs/path}/test.f.js +0 -0
  209. /package/{text → fs/text}/ascii/module.f.d.ts +0 -0
  210. /package/{text → fs/text}/ascii/module.f.js +0 -0
  211. /package/{text → fs/text}/ascii/test.f.d.ts +0 -0
  212. /package/{text → fs/text}/ascii/test.f.js +0 -0
  213. /package/{text → fs/text}/module.f.js +0 -0
  214. /package/{text → fs/text}/sgr/module.f.d.ts +0 -0
  215. /package/{text → fs/text}/sgr/module.f.js +0 -0
  216. /package/{text → fs/text}/sgr/test.f.d.ts +0 -0
  217. /package/{text → fs/text}/sgr/test.f.js +0 -0
  218. /package/{text → fs/text}/test.f.d.ts +0 -0
  219. /package/{text → fs/text}/test.f.js +0 -0
  220. /package/{text → fs/text}/utf16/module.f.d.ts +0 -0
  221. /package/{text → fs/text}/utf16/test.f.d.ts +0 -0
  222. /package/{text → fs/text}/utf16/test.f.js +0 -0
  223. /package/{text → fs/text}/utf8/module.f.d.ts +0 -0
  224. /package/{text → fs/text}/utf8/test.f.d.ts +0 -0
  225. /package/{text → fs/text}/utf8/test.f.js +0 -0
  226. /package/{types → fs/types}/array/module.f.d.ts +0 -0
  227. /package/{types → fs/types}/array/module.f.js +0 -0
  228. /package/{types → fs/types}/array/test.f.d.ts +0 -0
  229. /package/{types → fs/types}/array/test.f.js +0 -0
  230. /package/{types → fs/types}/bigfloat/module.f.d.ts +0 -0
  231. /package/{types → fs/types}/bigfloat/module.f.js +0 -0
  232. /package/{types → fs/types}/bigfloat/test.f.d.ts +0 -0
  233. /package/{types → fs/types}/bigfloat/test.f.js +0 -0
  234. /package/{types → fs/types}/bigint/module.f.d.ts +0 -0
  235. /package/{types → fs/types}/bigint/module.f.js +0 -0
  236. /package/{types → fs/types}/bigint/test.f.d.ts +0 -0
  237. /package/{types → fs/types}/bigint/test.f.js +0 -0
  238. /package/{types → fs/types}/bit_vec/test.f.d.ts +0 -0
  239. /package/{types → fs/types}/bit_vec/test.f.js +0 -0
  240. /package/{types → fs/types}/btree/find/module.f.d.ts +0 -0
  241. /package/{types → fs/types}/btree/find/module.f.js +0 -0
  242. /package/{types → fs/types}/btree/find/test.f.d.ts +0 -0
  243. /package/{types → fs/types}/btree/find/test.f.js +0 -0
  244. /package/{types → fs/types}/btree/module.f.d.ts +0 -0
  245. /package/{types → fs/types}/btree/module.f.js +0 -0
  246. /package/{types → fs/types}/btree/remove/module.f.d.ts +0 -0
  247. /package/{types → fs/types}/btree/remove/module.f.js +0 -0
  248. /package/{types → fs/types}/btree/remove/test.f.d.ts +0 -0
  249. /package/{types → fs/types}/btree/remove/test.f.js +0 -0
  250. /package/{types → fs/types}/btree/set/module.f.d.ts +0 -0
  251. /package/{types → fs/types}/btree/set/module.f.js +0 -0
  252. /package/{types → fs/types}/btree/set/test.f.d.ts +0 -0
  253. /package/{types → fs/types}/btree/set/test.f.js +0 -0
  254. /package/{types → fs/types}/btree/test.f.d.ts +0 -0
  255. /package/{types → fs/types}/btree/test.f.js +0 -0
  256. /package/{types → fs/types}/btree/types/module.f.d.ts +0 -0
  257. /package/{types → fs/types}/btree/types/module.f.js +0 -0
  258. /package/{types → fs/types}/byte_set/module.f.d.ts +0 -0
  259. /package/{types → fs/types}/byte_set/module.f.js +0 -0
  260. /package/{types → fs/types}/byte_set/test.f.d.ts +0 -0
  261. /package/{types → fs/types}/byte_set/test.f.js +0 -0
  262. /package/{types → fs/types}/effects/mock/module.f.d.ts +0 -0
  263. /package/{types → fs/types}/effects/mock/module.f.js +0 -0
  264. /package/{types → fs/types}/effects/module.d.ts +0 -0
  265. /package/{types → fs/types}/effects/module.f.js +0 -0
  266. /package/{types → fs/types}/effects/module.js +0 -0
  267. /package/{types → fs/types}/effects/node/module.f.d.ts +0 -0
  268. /package/{types → fs/types}/effects/node/module.f.js +0 -0
  269. /package/{types → fs/types}/effects/node/test.f.d.ts +0 -0
  270. /package/{types → fs/types}/effects/node/test.f.js +0 -0
  271. /package/{types → fs/types}/effects/node/virtual/module.f.js +0 -0
  272. /package/{types → fs/types}/function/compare/module.f.d.ts +0 -0
  273. /package/{types → fs/types}/function/compare/module.f.js +0 -0
  274. /package/{types → fs/types}/function/compare/test.f.d.ts +0 -0
  275. /package/{types → fs/types}/function/compare/test.f.js +0 -0
  276. /package/{types → fs/types}/function/module.f.d.ts +0 -0
  277. /package/{types → fs/types}/function/module.f.js +0 -0
  278. /package/{types → fs/types}/function/test.f.d.ts +0 -0
  279. /package/{types → fs/types}/function/test.f.js +0 -0
  280. /package/{types → fs/types}/list/module.f.d.ts +0 -0
  281. /package/{types → fs/types}/list/test.f.d.ts +0 -0
  282. /package/{types → fs/types}/list/test.f.js +0 -0
  283. /package/{types → fs/types}/map/module.f.d.ts +0 -0
  284. /package/{types → fs/types}/map/module.f.js +0 -0
  285. /package/{types → fs/types}/map/test.f.d.ts +0 -0
  286. /package/{types → fs/types}/map/test.f.js +0 -0
  287. /package/{types → fs/types}/monoid/module.f.d.ts +0 -0
  288. /package/{types → fs/types}/monoid/module.f.js +0 -0
  289. /package/{types → fs/types}/monoid/test.f.d.ts +0 -0
  290. /package/{types → fs/types}/monoid/test.f.js +0 -0
  291. /package/{types → fs/types}/nibble_set/module.f.d.ts +0 -0
  292. /package/{types → fs/types}/nibble_set/module.f.js +0 -0
  293. /package/{types → fs/types}/nibble_set/test.f.d.ts +0 -0
  294. /package/{types → fs/types}/nibble_set/test.f.js +0 -0
  295. /package/{types → fs/types}/nominal/module.f.d.ts +0 -0
  296. /package/{types → fs/types}/nominal/module.f.js +0 -0
  297. /package/{types → fs/types}/nominal/test.f.d.ts +0 -0
  298. /package/{types → fs/types}/nominal/test.f.js +0 -0
  299. /package/{types → fs/types}/nullable/module.f.d.ts +0 -0
  300. /package/{types → fs/types}/nullable/module.f.js +0 -0
  301. /package/{types → fs/types}/nullable/test.f.d.ts +0 -0
  302. /package/{types → fs/types}/nullable/test.f.js +0 -0
  303. /package/{types → fs/types}/number/module.f.d.ts +0 -0
  304. /package/{types → fs/types}/number/module.f.js +0 -0
  305. /package/{types → fs/types}/number/test.f.d.ts +0 -0
  306. /package/{types → fs/types}/number/test.f.js +0 -0
  307. /package/{types → fs/types}/object/module.f.d.ts +0 -0
  308. /package/{types → fs/types}/object/module.f.js +0 -0
  309. /package/{types → fs/types}/object/test.f.d.ts +0 -0
  310. /package/{types → fs/types}/object/test.f.js +0 -0
  311. /package/{types → fs/types}/option/module.f.d.ts +0 -0
  312. /package/{types → fs/types}/option/module.f.js +0 -0
  313. /package/{types → fs/types}/ordered_map/module.f.d.ts +0 -0
  314. /package/{types → fs/types}/ordered_map/module.f.js +0 -0
  315. /package/{types → fs/types}/ordered_map/test.f.d.ts +0 -0
  316. /package/{types → fs/types}/ordered_map/test.f.js +0 -0
  317. /package/{types → fs/types}/prime_field/module.f.d.ts +0 -0
  318. /package/{types → fs/types}/prime_field/module.f.js +0 -0
  319. /package/{types → fs/types}/prime_field/test.f.d.ts +0 -0
  320. /package/{types → fs/types}/prime_field/test.f.js +0 -0
  321. /package/{types → fs/types}/range/module.f.d.ts +0 -0
  322. /package/{types → fs/types}/range/module.f.js +0 -0
  323. /package/{types → fs/types}/range/test.f.d.ts +0 -0
  324. /package/{types → fs/types}/range/test.f.js +0 -0
  325. /package/{types → fs/types}/range_map/module.f.d.ts +0 -0
  326. /package/{types → fs/types}/range_map/module.f.js +0 -0
  327. /package/{types → fs/types}/range_map/test.f.d.ts +0 -0
  328. /package/{types → fs/types}/range_map/test.f.js +0 -0
  329. /package/{types → fs/types}/result/module.d.ts +0 -0
  330. /package/{types → fs/types}/result/module.f.d.ts +0 -0
  331. /package/{types → fs/types}/result/module.f.js +0 -0
  332. /package/{types → fs/types}/result/module.js +0 -0
  333. /package/{types → fs/types}/result/test.f.d.ts +0 -0
  334. /package/{types → fs/types}/result/test.f.js +0 -0
  335. /package/{types → fs/types}/rtti/ts/module.f.d.ts +0 -0
  336. /package/{types → fs/types}/rtti/ts/module.f.js +0 -0
  337. /package/{types → fs/types}/rtti/ts/test.f.d.ts +0 -0
  338. /package/{types → fs/types}/rtti/ts/test.f.js +0 -0
  339. /package/{types → fs/types}/sorted_list/module.f.d.ts +0 -0
  340. /package/{types → fs/types}/sorted_list/module.f.js +0 -0
  341. /package/{types → fs/types}/sorted_list/test.f.d.ts +0 -0
  342. /package/{types → fs/types}/sorted_list/test.f.js +0 -0
  343. /package/{types → fs/types}/sorted_set/module.f.d.ts +0 -0
  344. /package/{types → fs/types}/sorted_set/module.f.js +0 -0
  345. /package/{types → fs/types}/sorted_set/test.f.d.ts +0 -0
  346. /package/{types → fs/types}/sorted_set/test.f.js +0 -0
  347. /package/{types → fs/types}/string/module.f.d.ts +0 -0
  348. /package/{types → fs/types}/string/module.f.js +0 -0
  349. /package/{types → fs/types}/string/test.f.d.ts +0 -0
  350. /package/{types → fs/types}/string/test.f.js +0 -0
  351. /package/{types → fs/types}/string_set/module.f.d.ts +0 -0
  352. /package/{types → fs/types}/string_set/module.f.js +0 -0
  353. /package/{types → fs/types}/string_set/test.f.d.ts +0 -0
  354. /package/{types → fs/types}/string_set/test.f.js +0 -0
  355. /package/{types → fs/types}/ts/module.f.d.ts +0 -0
  356. /package/{types → fs/types}/ts/module.f.js +0 -0
  357. /package/{types → fs/types}/uint8array/module.f.js +0 -0
  358. /package/{types → fs/types}/uint8array/test.f.d.ts +0 -0
  359. /package/{types → fs/types}/uint8array/test.f.js +0 -0
  360. /package/{website → fs/website}/module.f.d.ts +0 -0
  361. /package/{website → fs/website}/module.f.js +0 -0
@@ -0,0 +1,894 @@
1
+ import { descentParser } from "../../bnf/data/module.f.js";
2
+ import { stringToCodePointList } from "../../text/utf16/module.f.js";
3
+ import { concat, filter, flat, flatMap, map, stateScan, toArray } from "../../types/list/module.f.js";
4
+ import { jsGrammar } from "./module.f.js";
5
+ const mapCodePoint = (cp) => [cp, undefined];
6
+ const descentParserCpOnly = (m, name, cp) => {
7
+ const cpm = toArray(map(mapCodePoint)(cp));
8
+ return m(name, cpm);
9
+ };
10
+ const tokenizeString = s => {
11
+ const m = descentParser(jsGrammar());
12
+ const cp = toArray(stringToCodePointList(s));
13
+ const mr = descentParserCpOnly(m, '', cp);
14
+ const flatTokens = getTokensFromMatchResult(mr);
15
+ const filterTokens = concat(filter(filterFunc)(flatTokens))(['']);
16
+ const tokens = flat(stateScan(scanFunc)(['', []])(filterTokens));
17
+ const jsTokens = concat(map(toJsToken)(tokens))([{ kind: 'eof' }]);
18
+ const result = toArray(filter(v => v !== null)(jsTokens));
19
+ //return JSON.stringify(toArray(filterTokens))
20
+ return JSON.stringify(result);
21
+ };
22
+ const scanFunc = (input, state) => {
23
+ if (typeof input === 'string') {
24
+ const newState = [input, []];
25
+ if (state[0] === '') {
26
+ return [null, newState];
27
+ }
28
+ const tk = [state[0], toArray(state[1])];
29
+ return [[tk], newState];
30
+ }
31
+ return [null, [state[0], concat(state[1])([input])]];
32
+ };
33
+ const filterFunc = tk => {
34
+ if (typeof tk === 'number')
35
+ return true;
36
+ switch (tk) {
37
+ case '{':
38
+ case '}':
39
+ case '[':
40
+ case ']':
41
+ case ':':
42
+ case ',':
43
+ case 'number':
44
+ case 'string':
45
+ return true;
46
+ default:
47
+ return false;
48
+ }
49
+ };
50
+ const toJsToken = tk => {
51
+ switch (tk[0]) {
52
+ case '{':
53
+ case '}':
54
+ case '[':
55
+ case ']':
56
+ case ':':
57
+ case ',':
58
+ return { kind: tk[0] };
59
+ default:
60
+ return null;
61
+ }
62
+ };
63
+ const getTokensFromAstRuleOrCodePoint = value => {
64
+ if (value instanceof Array)
65
+ return [value[0]];
66
+ return getTokensFromAstRule(value);
67
+ };
68
+ const getTokensFromAstSequence = seq => {
69
+ return flatMap(getTokensFromAstRuleOrCodePoint)(seq);
70
+ };
71
+ const tagToToken = tag => {
72
+ switch (typeof tag) {
73
+ case 'string': return tag;
74
+ case 'undefined': return 'undefined';
75
+ default: return 'true';
76
+ }
77
+ };
78
+ const getTokensFromAstRule = ast => {
79
+ const token = tagToToken(ast.tag);
80
+ if (ast.sequence.length === 0)
81
+ return [token];
82
+ return { first: token, tail: getTokensFromAstSequence(ast.sequence) };
83
+ };
84
+ const getTokensFromMatchResult = mr => {
85
+ return getTokensFromAstRule(mr[0]);
86
+ };
87
+ export default {
88
+ isValid: [() => {
89
+ const m = descentParser(jsGrammar());
90
+ const expect = (s, expected) => {
91
+ const cp = toArray(stringToCodePointList(s));
92
+ const mr = descentParserCpOnly(m, '', cp);
93
+ const success = mr[1] && mr[2] === cp.length;
94
+ if (success !== expected) {
95
+ throw JSON.stringify([s, mr]);
96
+ }
97
+ };
98
+ expect('"', false);
99
+ expect(' true ', true);
100
+ expect(' tr2ue ', true);
101
+ expect(' 2true ', true);
102
+ expect(' true" ', false);
103
+ expect(' "Hello" ', true);
104
+ expect(' "Hello ', false);
105
+ expect(' "Hello\\n\\r\\"" ', true);
106
+ expect(' 56.7e+5 ', true);
107
+ expect(' -56.7e+5 ', true);
108
+ expect(' h-56.7e+5 ', true);
109
+ expect(' -56.7e+5 3', true);
110
+ expect(' [] ', true);
111
+ expect(' {} ', true);
112
+ expect(' [[[]]] ', true);
113
+ expect(' [1] ', true);
114
+ expect(' [ 12, false, "a"] ', true);
115
+ expect(' [ 12, false2, "a"] ', true);
116
+ expect(' { "q": [ 12, false, [{"b" : "c"}], "a"] } ', true);
117
+ expect(' { "q": [ 12, false, [{}], "a"] } ', true);
118
+ expect(' { "q": [ 12, false, [}], "a"] } ', true);
119
+ expect(' [{ "q": [ 12, false, [{}], "a"] }] ', true);
120
+ expect(' [{ "q": [ 12, false, [}], "a"] }] ', true);
121
+ expect('. + ++ +=', true);
122
+ expect('//12\n', true);
123
+ expect('/*12*/', true);
124
+ expect('/* 1*2 */', true);
125
+ }
126
+ ],
127
+ tokenizer: [
128
+ () => {
129
+ const m = descentParser(jsGrammar());
130
+ const cp = toArray(stringToCodePointList('tr'));
131
+ const mr = descentParserCpOnly(m, '', cp);
132
+ const seq = mr[0].sequence[0];
133
+ if (seq instanceof Array)
134
+ throw JSON.stringify(mr);
135
+ if (seq.tag !== 'id')
136
+ throw JSON.stringify(mr);
137
+ },
138
+ () => {
139
+ const m = descentParser(jsGrammar());
140
+ const cp = toArray(stringToCodePointList('"tr"'));
141
+ const mr = descentParserCpOnly(m, '', cp);
142
+ const seq = mr[0].sequence[0];
143
+ if (seq instanceof Array)
144
+ throw JSON.stringify(mr);
145
+ if (seq.tag !== 'string')
146
+ throw JSON.stringify(mr);
147
+ },
148
+ () => {
149
+ const m = descentParser(jsGrammar());
150
+ const cp = toArray(stringToCodePointList('56.7e+5'));
151
+ const mr = descentParserCpOnly(m, '', cp);
152
+ const seq = mr[0].sequence[0];
153
+ if (seq instanceof Array)
154
+ throw JSON.stringify(mr);
155
+ if (seq.tag !== 'number')
156
+ throw JSON.stringify(mr);
157
+ },
158
+ () => {
159
+ const m = descentParser(jsGrammar());
160
+ const cp = toArray(stringToCodePointList('56n'));
161
+ const mr = descentParserCpOnly(m, '', cp);
162
+ const seq = mr[0].sequence[0];
163
+ if (seq instanceof Array)
164
+ throw JSON.stringify(mr);
165
+ if (seq.tag !== 'number')
166
+ throw JSON.stringify(mr);
167
+ },
168
+ () => {
169
+ const m = descentParser(jsGrammar());
170
+ const cp = toArray(stringToCodePointList('*'));
171
+ const mr = descentParserCpOnly(m, '', cp);
172
+ const seq = mr[0].sequence[0];
173
+ if (seq instanceof Array)
174
+ throw JSON.stringify(mr);
175
+ if (seq.tag !== '*')
176
+ throw JSON.stringify(mr);
177
+ },
178
+ () => {
179
+ const m = descentParser(jsGrammar());
180
+ const cp = toArray(stringToCodePointList('**'));
181
+ const mr = descentParserCpOnly(m, '', cp);
182
+ const seq = mr[0].sequence[0];
183
+ if (seq instanceof Array)
184
+ throw JSON.stringify(mr);
185
+ if (seq.tag !== '**')
186
+ throw JSON.stringify(mr);
187
+ },
188
+ () => {
189
+ const m = descentParser(jsGrammar());
190
+ const cp = toArray(stringToCodePointList('=>'));
191
+ const mr = descentParserCpOnly(m, '', cp);
192
+ const seq = mr[0].sequence[0];
193
+ if (seq instanceof Array)
194
+ throw JSON.stringify(mr);
195
+ if (seq.tag !== '=>')
196
+ throw JSON.stringify(mr);
197
+ },
198
+ () => {
199
+ const m = descentParser(jsGrammar());
200
+ const cp = toArray(stringToCodePointList('=='));
201
+ const mr = descentParserCpOnly(m, '', cp);
202
+ const seq = mr[0].sequence[0];
203
+ if (seq instanceof Array)
204
+ throw JSON.stringify(mr);
205
+ if (seq.tag !== '==')
206
+ throw JSON.stringify(mr);
207
+ },
208
+ () => {
209
+ const m = descentParser(jsGrammar());
210
+ const cp = toArray(stringToCodePointList('==='));
211
+ const mr = descentParserCpOnly(m, '', cp);
212
+ const seq = mr[0].sequence[0];
213
+ if (seq instanceof Array)
214
+ throw JSON.stringify(mr);
215
+ if (seq.tag !== '===')
216
+ throw JSON.stringify(mr);
217
+ },
218
+ () => {
219
+ const m = descentParser(jsGrammar());
220
+ const cp = toArray(stringToCodePointList('='));
221
+ const mr = descentParserCpOnly(m, '', cp);
222
+ const seq = mr[0].sequence[0];
223
+ if (seq instanceof Array)
224
+ throw JSON.stringify(mr);
225
+ if (seq.tag !== '=')
226
+ throw JSON.stringify(mr);
227
+ },
228
+ () => {
229
+ const m = descentParser(jsGrammar());
230
+ const cp = toArray(stringToCodePointList(' '));
231
+ const mr = descentParserCpOnly(m, '', cp);
232
+ const seq = mr[0].sequence[0];
233
+ if (seq instanceof Array)
234
+ throw JSON.stringify(mr);
235
+ if (seq.tag !== ' ')
236
+ throw JSON.stringify(mr);
237
+ },
238
+ () => {
239
+ const m = descentParser(jsGrammar());
240
+ const cp = toArray(stringToCodePointList('\n'));
241
+ const mr = descentParserCpOnly(m, '', cp);
242
+ const seq = mr[0].sequence[0];
243
+ if (seq instanceof Array)
244
+ throw JSON.stringify(mr);
245
+ if (seq.tag !== '\n')
246
+ throw JSON.stringify(mr);
247
+ },
248
+ () => {
249
+ const m = descentParser(jsGrammar());
250
+ const cp = toArray(stringToCodePointList('/\n'));
251
+ const mr = descentParserCpOnly(m, '', cp);
252
+ const seq = mr[0].sequence[0];
253
+ if (seq instanceof Array)
254
+ throw JSON.stringify(mr);
255
+ if (seq.tag !== '/')
256
+ throw JSON.stringify(mr);
257
+ },
258
+ () => {
259
+ const m = descentParser(jsGrammar());
260
+ const cp = toArray(stringToCodePointList('//\n'));
261
+ const mr = descentParserCpOnly(m, '', cp);
262
+ const seq = mr[0].sequence[0];
263
+ if (seq instanceof Array)
264
+ throw JSON.stringify(mr);
265
+ if (seq.tag !== 'comment')
266
+ throw JSON.stringify(mr);
267
+ },
268
+ () => {
269
+ const m = descentParser(jsGrammar());
270
+ const cp = toArray(stringToCodePointList('/*1*/'));
271
+ const mr = descentParserCpOnly(m, '', cp);
272
+ const seq = mr[0].sequence[0];
273
+ if (seq instanceof Array)
274
+ throw JSON.stringify(mr);
275
+ if (seq.tag !== 'comment')
276
+ throw JSON.stringify(mr);
277
+ }
278
+ ],
279
+ djs: [
280
+ () => {
281
+ const result = tokenizeString('');
282
+ if (result !== '[{"kind":"eof"}]') {
283
+ throw result;
284
+ }
285
+ },
286
+ () => {
287
+ const result = tokenizeString('{');
288
+ if (result !== '[{"kind":"{"},{"kind":"eof"}]') {
289
+ throw result;
290
+ }
291
+ },
292
+ () => {
293
+ const result = tokenizeString('}');
294
+ if (result !== '[{"kind":"}"},{"kind":"eof"}]') {
295
+ throw result;
296
+ }
297
+ },
298
+ () => {
299
+ const result = tokenizeString(':');
300
+ if (result !== '[{"kind":":"},{"kind":"eof"}]') {
301
+ throw result;
302
+ }
303
+ },
304
+ () => {
305
+ const result = tokenizeString(',');
306
+ if (result !== '[{"kind":","},{"kind":"eof"}]') {
307
+ throw result;
308
+ }
309
+ },
310
+ () => {
311
+ const result = tokenizeString('[');
312
+ if (result !== '[{"kind":"["},{"kind":"eof"}]') {
313
+ throw result;
314
+ }
315
+ },
316
+ () => {
317
+ const result = tokenizeString(']');
318
+ if (result !== '[{"kind":"]"},{"kind":"eof"}]') {
319
+ throw result;
320
+ }
321
+ },
322
+ // () => {
323
+ // const result = tokenizeString('ᄑ')
324
+ // if (result !== '[{"kind":"error","message":"unexpected character"},{"kind":"eof"}]') { throw result }
325
+ // },
326
+ // () => {
327
+ // const result = tokenizeString('{ \t\n\r}')
328
+ // if (result !== '[{"kind":"{"},{"kind":"nl"},{"kind":"}"},{"kind":"eof"}]') { throw result }
329
+ // },
330
+ // () => {
331
+ // const result = tokenizeString('""')
332
+ // if (result !== '[{"kind":"string","value":""},{"kind":"eof"}]') { throw result }
333
+ // },
334
+ // () => {
335
+ // const result = tokenizeString('"value"')
336
+ // if (result !== '[{"kind":"string","value":"value"},{"kind":"eof"}]') { throw result }
337
+ // },
338
+ // () => {
339
+ // const result = tokenizeString('"value')
340
+ // if (result !== '[{"kind":"error","message":"\\" are missing"},{"kind":"eof"}]') { throw result }
341
+ // },
342
+ // () => {
343
+ // const result = tokenizeString('"value1" "value2"')
344
+ // if (result !== '[{"kind":"string","value":"value1"},{"kind":"ws"},{"kind":"string","value":"value2"},{"kind":"eof"}]') { throw result }
345
+ // },
346
+ // () => {
347
+ // const result = tokenizeString('"')
348
+ // if (result !== '[{"kind":"error","message":"\\" are missing"},{"kind":"eof"}]') { throw result }
349
+ // },
350
+ // () => {
351
+ // const result = tokenizeString('"\\\\"')
352
+ // if (result !== '[{"kind":"string","value":"\\\\"},{"kind":"eof"}]') { throw result }
353
+ // },
354
+ // () => {
355
+ // const result = tokenizeString('"\\""')
356
+ // if (result !== '[{"kind":"string","value":"\\""},{"kind":"eof"}]') { throw result }
357
+ // },
358
+ // () => {
359
+ // const result = tokenizeString('"\\/"')
360
+ // if (result !== '[{"kind":"string","value":"/"},{"kind":"eof"}]') { throw result }
361
+ // },
362
+ // () => {
363
+ // const result = tokenizeString('"\\x"')
364
+ // if (result !== '[{"kind":"error","message":"unescaped character"},{"kind":"string","value":"x"},{"kind":"eof"}]') { throw result }
365
+ // },
366
+ // () => {
367
+ // const result = tokenizeString('"\\')
368
+ // if (result !== '[{"kind":"error","message":"\\" are missing"},{"kind":"eof"}]') { throw result }
369
+ // },
370
+ // () => {
371
+ // const result = tokenizeString('"\r"')
372
+ // if (result !== '[{"kind":"error","message":"unterminated string literal"},{"kind":"nl"},{"kind":"error","message":"\\" are missing"},{"kind":"eof"}]') { throw result }
373
+ // },
374
+ // () => {
375
+ // const result = tokenizeString('"\n null')
376
+ // if (result !== '[{"kind":"error","message":"unterminated string literal"},{"kind":"nl"},{"kind":"null"},{"kind":"eof"}]') { throw result }
377
+ // },
378
+ // () => {
379
+ // const result = tokenizeString('"\\b\\f\\n\\r\\t"')
380
+ // if (result !== '[{"kind":"string","value":"\\b\\f\\n\\r\\t"},{"kind":"eof"}]') { throw result }
381
+ // },
382
+ // () => {
383
+ // const result = tokenizeString('"\\u1234"')
384
+ // if (result !== '[{"kind":"string","value":"ሴ"},{"kind":"eof"}]') { throw result }
385
+ // },
386
+ // () => {
387
+ // const result = tokenizeString('"\\uaBcDEeFf"')
388
+ // if (result !== '[{"kind":"string","value":"ꯍEeFf"},{"kind":"eof"}]') { throw result }
389
+ // },
390
+ // () => {
391
+ // const result = tokenizeString('"\\uEeFg"')
392
+ // if (result !== '[{"kind":"error","message":"invalid hex value"},{"kind":"string","value":"g"},{"kind":"eof"}]') { throw result }
393
+ // },
394
+ // () => {
395
+ // const result = tokenizeString('0')
396
+ // if (result !== '[{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
397
+ // },
398
+ // () => {
399
+ // const result = tokenizeString('[0]')
400
+ // if (result !== '[{"kind":"["},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"]"},{"kind":"eof"}]') { throw result }
401
+ // },
402
+ // () => {
403
+ // const result = tokenizeString('00')
404
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
405
+ // },
406
+ // () => {
407
+ // const result = tokenizeString('0abc,')
408
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"abc"},{"kind":","},{"kind":"eof"}]') { throw result }
409
+ // },
410
+ // () => {
411
+ // const result = tokenizeString('123456789012345678901234567890')
412
+ // if (result !== '[{"bf":[123456789012345678901234567890n,0],"kind":"number","value":"123456789012345678901234567890"},{"kind":"eof"}]') { throw result }
413
+ // },
414
+ // () => {
415
+ // const result = tokenizeString('{90}')
416
+ // if (result !== '[{"kind":"{"},{"bf":[90n,0],"kind":"number","value":"90"},{"kind":"}"},{"kind":"eof"}]') { throw result }
417
+ // },
418
+ // () => {
419
+ // const result = tokenizeString('1 2')
420
+ // if (result !== '[{"bf":[1n,0],"kind":"number","value":"1"},{"kind":"ws"},{"bf":[2n,0],"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
421
+ // },
422
+ // () => {
423
+ // const result = tokenizeString('0. 2')
424
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"ws"},{"bf":[2n,0],"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
425
+ // },
426
+ // () => {
427
+ // const result = tokenizeString('10-0')
428
+ // if (result !== '[{"bf":[10n,0],"kind":"number","value":"10"},{"kind":"-"},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
429
+ // },
430
+ // () => {
431
+ // const result = tokenizeString('9a:')
432
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"a"},{"kind":":"},{"kind":"eof"}]') { throw result }
433
+ // },
434
+ // () => {
435
+ // const result = tokenizeString('-10')
436
+ // if (result !== '[{"kind":"-"},{"bf":[10n,0],"kind":"number","value":"10"},{"kind":"eof"}]') { throw result }
437
+ // },
438
+ // () => {
439
+ // const result = tokenizeString('-0')
440
+ // if (result !== '[{"kind":"-"},{"bf":[0n,0],"kind":"number","value":"0"},{"kind":"eof"}]') { throw result }
441
+ // },
442
+ // () => {
443
+ // const result = tokenizeString('-00')
444
+ // if (result !== '[{"kind":"-"},{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
445
+ // },
446
+ // () => {
447
+ // const result = tokenizeString('-.123')
448
+ // if (result !== '[{"kind":"-"},{"kind":"."},{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"eof"}]') { throw result }
449
+ // },
450
+ // () => {
451
+ // const result = tokenizeString('0.01')
452
+ // if (result !== '[{"bf":[1n,-2],"kind":"number","value":"0.01"},{"kind":"eof"}]') { throw result }
453
+ // },
454
+ // () => {
455
+ // const result = tokenizeString('-0.9')
456
+ // if (result !== '[{"kind":"-"},{"bf":[9n,-1],"kind":"number","value":"0.9"},{"kind":"eof"}]') { throw result }
457
+ // },
458
+ // () => {
459
+ // const result = tokenizeString('-0.')
460
+ // if (result !== '[{"kind":"-"},{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
461
+ // },
462
+ // () => {
463
+ // const result = tokenizeString('-0.]')
464
+ // if (result !== '[{"kind":"-"},{"kind":"error","message":"invalid number"},{"kind":"]"},{"kind":"eof"}]') { throw result }
465
+ // },
466
+ // () => {
467
+ // const result = tokenizeString('12.34')
468
+ // if (result !== '[{"bf":[1234n,-2],"kind":"number","value":"12.34"},{"kind":"eof"}]') { throw result }
469
+ // },
470
+ // () => {
471
+ // const result = tokenizeString('-12.00')
472
+ // if (result !== '[{"kind":"-"},{"bf":[1200n,-2],"kind":"number","value":"12.00"},{"kind":"eof"}]') { throw result }
473
+ // },
474
+ // () => {
475
+ // const result = tokenizeString('-12.')
476
+ // if (result !== '[{"kind":"-"},{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
477
+ // },
478
+ // () => {
479
+ // const result = tokenizeString('12.]')
480
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"]"},{"kind":"eof"}]') { throw result }
481
+ // },
482
+ // () => {
483
+ // const result = tokenizeString('0e1')
484
+ // if (result !== '[{"bf":[0n,1],"kind":"number","value":"0e1"},{"kind":"eof"}]') { throw result }
485
+ // },
486
+ // () => {
487
+ // const result = tokenizeString('0e+2')
488
+ // if (result !== '[{"bf":[0n,2],"kind":"number","value":"0e+2"},{"kind":"eof"}]') { throw result }
489
+ // },
490
+ // () => {
491
+ // const result = tokenizeString('0e-0')
492
+ // if (result !== '[{"bf":[0n,0],"kind":"number","value":"0e-0"},{"kind":"eof"}]') { throw result }
493
+ // },
494
+ // () => {
495
+ // const result = tokenizeString('12e0000')
496
+ // if (result !== '[{"bf":[12n,0],"kind":"number","value":"12e0000"},{"kind":"eof"}]') { throw result }
497
+ // },
498
+ // () => {
499
+ // const result = tokenizeString('-12e-0001')
500
+ // if (result !== '[{"kind":"-"},{"bf":[12n,-1],"kind":"number","value":"12e-0001"},{"kind":"eof"}]') { throw result }
501
+ // },
502
+ // () => {
503
+ // const result = tokenizeString('-12.34e1234')
504
+ // if (result !== '[{"kind":"-"},{"bf":[1234n,1232],"kind":"number","value":"12.34e1234"},{"kind":"eof"}]') { throw result }
505
+ // },
506
+ // () => {
507
+ // const result = tokenizeString('0e')
508
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
509
+ // },
510
+ // () => {
511
+ // const result = tokenizeString('0e-')
512
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"eof"}]') { throw result }
513
+ // },
514
+ // () => {
515
+ // const result = tokenizeString('ABCdef1234567890$_')
516
+ // if (result !== '[{"kind":"id","value":"ABCdef1234567890$_"},{"kind":"eof"}]') { throw result }
517
+ // },
518
+ // () => {
519
+ // const result = tokenizeString('{ABCdef1234567890$_}')
520
+ // if (result !== '[{"kind":"{"},{"kind":"id","value":"ABCdef1234567890$_"},{"kind":"}"},{"kind":"eof"}]') { throw result }
521
+ // },
522
+ // () => {
523
+ // const result = tokenizeString('123 _123')
524
+ // if (result !== '[{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"_123"},{"kind":"eof"}]') { throw result }
525
+ // },
526
+ // () => {
527
+ // const result = tokenizeString('123 $123')
528
+ // if (result !== '[{"bf":[123n,0],"kind":"number","value":"123"},{"kind":"ws"},{"kind":"id","value":"$123"},{"kind":"eof"}]') { throw result }
529
+ // },
530
+ // () => {
531
+ // const result = tokenizeString('123_123')
532
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"_123"},{"kind":"eof"}]') { throw result }
533
+ // },
534
+ // () => {
535
+ // const result = tokenizeString('123$123')
536
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"$123"},{"kind":"eof"}]') { throw result }
537
+ // },
538
+ // () => {
539
+ // const result = tokenizeString('1234567890n')
540
+ // if (result !== '[{"kind":"bigint","value":1234567890n},{"kind":"eof"}]') { throw result }
541
+ // },
542
+ // () => {
543
+ // const result = tokenizeString('0n')
544
+ // if (result !== '[{"kind":"bigint","value":0n},{"kind":"eof"}]') { throw result }
545
+ // },
546
+ // () => {
547
+ // const result = tokenizeString('[-1234567890n]')
548
+ // if (result !== '[{"kind":"["},{"kind":"-"},{"kind":"bigint","value":1234567890n},{"kind":"]"},{"kind":"eof"}]') { throw result }
549
+ // },
550
+ // () => {
551
+ // const result = tokenizeString('123.456n')
552
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"n"},{"kind":"eof"}]') { throw result }
553
+ // },
554
+ // () => {
555
+ // const result = tokenizeString('123e456n')
556
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"n"},{"kind":"eof"}]') { throw result }
557
+ // },
558
+ // () => {
559
+ // const result = tokenizeString('1234567890na')
560
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"a"},{"kind":"eof"}]') { throw result }
561
+ // },
562
+ // () => {
563
+ // const result = tokenizeString('1234567890nn')
564
+ // if (result !== '[{"kind":"error","message":"invalid number"},{"kind":"id","value":"n"},{"kind":"eof"}]') { throw result }
565
+ // },
566
+ ],
567
+ // operators:
568
+ // [
569
+ // () => {
570
+ // const result = tokenizeString('=')
571
+ // if (result !== '[{"kind":"="},{"kind":"eof"}]') { throw result }
572
+ // },
573
+ // () => {
574
+ // const result = tokenizeString('=a')
575
+ // if (result !== '[{"kind":"="},{"kind":"id","value":"a"},{"kind":"eof"}]') { throw result }
576
+ // },
577
+ // () => {
578
+ // const result = tokenizeString('-')
579
+ // if (result !== '[{"kind":"-"},{"kind":"eof"}]') { throw result }
580
+ // },
581
+ // () => {
582
+ // const result = tokenizeString('1*2')
583
+ // if (result !== '[{"bf":[1n,0],"kind":"number","value":"1"},{"kind":"*"},{"bf":[2n,0],"kind":"number","value":"2"},{"kind":"eof"}]') { throw result }
584
+ // },
585
+ // () => {
586
+ // const result = tokenizeString('( )')
587
+ // if (result !== '[{"kind":"("},{"kind":"ws"},{"kind":")"},{"kind":"eof"}]') { throw result }
588
+ // },
589
+ // () => {
590
+ // const result = tokenizeString('== != === !== > >= < <=')
591
+ // if (result !== '[{"kind":"=="},{"kind":"ws"},{"kind":"!="},{"kind":"ws"},{"kind":"==="},{"kind":"ws"},{"kind":"!=="},{"kind":"ws"},{"kind":">"},{"kind":"ws"},{"kind":">="},{"kind":"ws"},{"kind":"<"},{"kind":"ws"},{"kind":"<="},{"kind":"eof"}]') { throw result }
592
+ // },
593
+ // () => {
594
+ // const result = tokenizeString('+ - * / % ++ -- **')
595
+ // if (result !== '[{"kind":"+"},{"kind":"ws"},{"kind":"-"},{"kind":"ws"},{"kind":"*"},{"kind":"ws"},{"kind":"/"},{"kind":"ws"},{"kind":"%"},{"kind":"ws"},{"kind":"++"},{"kind":"ws"},{"kind":"--"},{"kind":"ws"},{"kind":"**"},{"kind":"eof"}]') { throw result }
596
+ // },
597
+ // () => {
598
+ // const result = tokenizeString('= += -= *= /= %= **=')
599
+ // if (result !== '[{"kind":"="},{"kind":"ws"},{"kind":"+="},{"kind":"ws"},{"kind":"-="},{"kind":"ws"},{"kind":"*="},{"kind":"ws"},{"kind":"/="},{"kind":"ws"},{"kind":"%="},{"kind":"ws"},{"kind":"**="},{"kind":"eof"}]') { throw result }
600
+ // },
601
+ // () => {
602
+ // const result = tokenizeString('& | ^ ~ << >> >>>')
603
+ // if (result !== '[{"kind":"&"},{"kind":"ws"},{"kind":"|"},{"kind":"ws"},{"kind":"^"},{"kind":"ws"},{"kind":"~"},{"kind":"ws"},{"kind":"<<"},{"kind":"ws"},{"kind":">>"},{"kind":"ws"},{"kind":">>>"},{"kind":"eof"}]') { throw result }
604
+ // },
605
+ // () => {
606
+ // const result = tokenizeString('&= |= ^= <<= >>= >>>=')
607
+ // if (result !== '[{"kind":"&="},{"kind":"ws"},{"kind":"|="},{"kind":"ws"},{"kind":"^="},{"kind":"ws"},{"kind":"<<="},{"kind":"ws"},{"kind":">>="},{"kind":"ws"},{"kind":">>>="},{"kind":"eof"}]') { throw result }
608
+ // },
609
+ // () => {
610
+ // const result = tokenizeString('&& || ! ??')
611
+ // if (result !== '[{"kind":"&&"},{"kind":"ws"},{"kind":"||"},{"kind":"ws"},{"kind":"!"},{"kind":"ws"},{"kind":"??"},{"kind":"eof"}]') { throw result }
612
+ // },
613
+ // () => {
614
+ // const result = tokenizeString('&&= ||= ??=')
615
+ // if (result !== '[{"kind":"&&="},{"kind":"ws"},{"kind":"||="},{"kind":"ws"},{"kind":"??="},{"kind":"eof"}]') { throw result }
616
+ // },
617
+ // () => {
618
+ // const result = tokenizeString('? ?. . =>')
619
+ // if (result !== '[{"kind":"?"},{"kind":"ws"},{"kind":"?."},{"kind":"ws"},{"kind":"."},{"kind":"ws"},{"kind":"=>"},{"kind":"eof"}]') { throw result }
620
+ // },
621
+ // ],
622
+ // ws: [
623
+ // () => {
624
+ // const result = tokenizeString(' ')
625
+ // if (result !== '[{"kind":"ws"},{"kind":"eof"}]') { throw result }
626
+ // },
627
+ // () => {
628
+ // const result = tokenizeString('\t')
629
+ // if (result !== '[{"kind":"ws"},{"kind":"eof"}]') { throw result }
630
+ // },
631
+ // () => {
632
+ // const result = tokenizeString(' \t')
633
+ // if (result !== '[{"kind":"ws"},{"kind":"eof"}]') { throw result }
634
+ // },
635
+ // () => {
636
+ // const result = tokenizeString('\n')
637
+ // if (result !== '[{"kind":"nl"},{"kind":"eof"}]') { throw result }
638
+ // },
639
+ // () => {
640
+ // const result = tokenizeString('\r')
641
+ // if (result !== '[{"kind":"nl"},{"kind":"eof"}]') { throw result }
642
+ // },
643
+ // () => {
644
+ // const result = tokenizeString(' \t\n\r ')
645
+ // if (result !== '[{"kind":"nl"},{"kind":"eof"}]') { throw result }
646
+ // },
647
+ // ],
648
+ // id: [
649
+ // () => {
650
+ // const result = tokenizeString('err')
651
+ // if (result !== '[{"kind":"id","value":"err"},{"kind":"eof"}]') { throw result }
652
+ // },
653
+ // () => {
654
+ // const result = tokenizeString('{e}')
655
+ // if (result !== '[{"kind":"{"},{"kind":"id","value":"e"},{"kind":"}"},{"kind":"eof"}]') { throw result }
656
+ // },
657
+ // () => {
658
+ // const result = tokenizeString('tru')
659
+ // if (result !== '[{"kind":"id","value":"tru"},{"kind":"eof"}]') { throw result }
660
+ // },
661
+ // ],
662
+ // keywords: [
663
+ // () => {
664
+ // const result = tokenizeString('true')
665
+ // if (result !== '[{"kind":"true"},{"kind":"eof"}]') { throw result }
666
+ // },
667
+ // () => {
668
+ // const result = tokenizeString('false')
669
+ // if (result !== '[{"kind":"false"},{"kind":"eof"}]') { throw result }
670
+ // },
671
+ // () => {
672
+ // const result = tokenizeString('null')
673
+ // if (result !== '[{"kind":"null"},{"kind":"eof"}]') { throw result }
674
+ // },
675
+ // () => {
676
+ // const result = tokenizeString('undefined')
677
+ // if (result !== '[{"kind":"undefined"},{"kind":"eof"}]') { throw result }
678
+ // },
679
+ // () => {
680
+ // const result = tokenizeString('[null]')
681
+ // if (result !== '[{"kind":"["},{"kind":"null"},{"kind":"]"},{"kind":"eof"}]') { throw result }
682
+ // },
683
+ // () => {
684
+ // const result = tokenizeString('arguments')
685
+ // if (result !== '[{"kind":"arguments"},{"kind":"eof"}]') { throw result }
686
+ // },
687
+ // () => {
688
+ // const result = tokenizeString('await')
689
+ // if (result !== '[{"kind":"await"},{"kind":"eof"}]') { throw result }
690
+ // },
691
+ // () => {
692
+ // const result = tokenizeString('break')
693
+ // if (result !== '[{"kind":"break"},{"kind":"eof"}]') { throw result }
694
+ // },
695
+ // () => {
696
+ // const result = tokenizeString('case')
697
+ // if (result !== '[{"kind":"case"},{"kind":"eof"}]') { throw result }
698
+ // },
699
+ // () => {
700
+ // const result = tokenizeString('catch')
701
+ // if (result !== '[{"kind":"catch"},{"kind":"eof"}]') { throw result }
702
+ // },
703
+ // () => {
704
+ // const result = tokenizeString('class')
705
+ // if (result !== '[{"kind":"class"},{"kind":"eof"}]') { throw result }
706
+ // },
707
+ // () => {
708
+ // const result = tokenizeString('const')
709
+ // if (result !== '[{"kind":"const"},{"kind":"eof"}]') { throw result }
710
+ // },
711
+ // () => {
712
+ // const result = tokenizeString('continue')
713
+ // if (result !== '[{"kind":"continue"},{"kind":"eof"}]') { throw result }
714
+ // },
715
+ // () => {
716
+ // const result = tokenizeString('debugger')
717
+ // if (result !== '[{"kind":"debugger"},{"kind":"eof"}]') { throw result }
718
+ // },
719
+ // () => {
720
+ // const result = tokenizeString('default')
721
+ // if (result !== '[{"kind":"default"},{"kind":"eof"}]') { throw result }
722
+ // },
723
+ // () => {
724
+ // const result = tokenizeString('delete')
725
+ // if (result !== '[{"kind":"delete"},{"kind":"eof"}]') { throw result }
726
+ // },
727
+ // () => {
728
+ // const result = tokenizeString('do')
729
+ // if (result !== '[{"kind":"do"},{"kind":"eof"}]') { throw result }
730
+ // },
731
+ // () => {
732
+ // const result = tokenizeString('else')
733
+ // if (result !== '[{"kind":"else"},{"kind":"eof"}]') { throw result }
734
+ // },
735
+ // () => {
736
+ // const result = tokenizeString('enum')
737
+ // if (result !== '[{"kind":"enum"},{"kind":"eof"}]') { throw result }
738
+ // },
739
+ // () => {
740
+ // const result = tokenizeString('eval')
741
+ // if (result !== '[{"kind":"eval"},{"kind":"eof"}]') { throw result }
742
+ // },
743
+ // () => {
744
+ // const result = tokenizeString('export')
745
+ // if (result !== '[{"kind":"export"},{"kind":"eof"}]') { throw result }
746
+ // },
747
+ // () => {
748
+ // const result = tokenizeString('extends')
749
+ // if (result !== '[{"kind":"extends"},{"kind":"eof"}]') { throw result }
750
+ // },
751
+ // () => {
752
+ // const result = tokenizeString('finally')
753
+ // if (result !== '[{"kind":"finally"},{"kind":"eof"}]') { throw result }
754
+ // },
755
+ // () => {
756
+ // const result = tokenizeString('for')
757
+ // if (result !== '[{"kind":"for"},{"kind":"eof"}]') { throw result }
758
+ // },
759
+ // () => {
760
+ // const result = tokenizeString('function')
761
+ // if (result !== '[{"kind":"function"},{"kind":"eof"}]') { throw result }
762
+ // },
763
+ // () => {
764
+ // const result = tokenizeString('if')
765
+ // if (result !== '[{"kind":"if"},{"kind":"eof"}]') { throw result }
766
+ // },
767
+ // () => {
768
+ // const result = tokenizeString('implements')
769
+ // if (result !== '[{"kind":"implements"},{"kind":"eof"}]') { throw result }
770
+ // },
771
+ // () => {
772
+ // const result = tokenizeString('import')
773
+ // if (result !== '[{"kind":"import"},{"kind":"eof"}]') { throw result }
774
+ // },
775
+ // () => {
776
+ // const result = tokenizeString('in')
777
+ // if (result !== '[{"kind":"in"},{"kind":"eof"}]') { throw result }
778
+ // },
779
+ // () => {
780
+ // const result = tokenizeString('instanceof')
781
+ // if (result !== '[{"kind":"instanceof"},{"kind":"eof"}]') { throw result }
782
+ // },
783
+ // () => {
784
+ // const result = tokenizeString('interface')
785
+ // if (result !== '[{"kind":"interface"},{"kind":"eof"}]') { throw result }
786
+ // },
787
+ // () => {
788
+ // const result = tokenizeString('let')
789
+ // if (result !== '[{"kind":"let"},{"kind":"eof"}]') { throw result }
790
+ // },
791
+ // () => {
792
+ // const result = tokenizeString('new')
793
+ // if (result !== '[{"kind":"new"},{"kind":"eof"}]') { throw result }
794
+ // },
795
+ // () => {
796
+ // const result = tokenizeString('package')
797
+ // if (result !== '[{"kind":"package"},{"kind":"eof"}]') { throw result }
798
+ // },
799
+ // () => {
800
+ // const result = tokenizeString('private')
801
+ // if (result !== '[{"kind":"private"},{"kind":"eof"}]') { throw result }
802
+ // },
803
+ // () => {
804
+ // const result = tokenizeString('protected')
805
+ // if (result !== '[{"kind":"protected"},{"kind":"eof"}]') { throw result }
806
+ // },
807
+ // () => {
808
+ // const result = tokenizeString('public')
809
+ // if (result !== '[{"kind":"public"},{"kind":"eof"}]') { throw result }
810
+ // },
811
+ // () => {
812
+ // const result = tokenizeString('return')
813
+ // if (result !== '[{"kind":"return"},{"kind":"eof"}]') { throw result }
814
+ // },
815
+ // () => {
816
+ // const result = tokenizeString('static')
817
+ // if (result !== '[{"kind":"static"},{"kind":"eof"}]') { throw result }
818
+ // },
819
+ // () => {
820
+ // const result = tokenizeString('super')
821
+ // if (result !== '[{"kind":"super"},{"kind":"eof"}]') { throw result }
822
+ // },
823
+ // () => {
824
+ // const result = tokenizeString('switch')
825
+ // if (result !== '[{"kind":"switch"},{"kind":"eof"}]') { throw result }
826
+ // },
827
+ // () => {
828
+ // const result = tokenizeString('this')
829
+ // if (result !== '[{"kind":"this"},{"kind":"eof"}]') { throw result }
830
+ // },
831
+ // () => {
832
+ // const result = tokenizeString('throw')
833
+ // if (result !== '[{"kind":"throw"},{"kind":"eof"}]') { throw result }
834
+ // },
835
+ // () => {
836
+ // const result = tokenizeString('try')
837
+ // if (result !== '[{"kind":"try"},{"kind":"eof"}]') { throw result }
838
+ // },
839
+ // () => {
840
+ // const result = tokenizeString('typeof')
841
+ // if (result !== '[{"kind":"typeof"},{"kind":"eof"}]') { throw result }
842
+ // },
843
+ // () => {
844
+ // const result = tokenizeString('var')
845
+ // if (result !== '[{"kind":"var"},{"kind":"eof"}]') { throw result }
846
+ // },
847
+ // () => {
848
+ // const result = tokenizeString('void')
849
+ // if (result !== '[{"kind":"void"},{"kind":"eof"}]') { throw result }
850
+ // },
851
+ // () => {
852
+ // const result = tokenizeString('while')
853
+ // if (result !== '[{"kind":"while"},{"kind":"eof"}]') { throw result }
854
+ // },
855
+ // () => {
856
+ // const result = tokenizeString('with')
857
+ // if (result !== '[{"kind":"with"},{"kind":"eof"}]') { throw result }
858
+ // },
859
+ // () => {
860
+ // const result = tokenizeString('yield')
861
+ // if (result !== '[{"kind":"yield"},{"kind":"eof"}]') { throw result }
862
+ // },
863
+ // ],
864
+ // comments: [
865
+ // () => {
866
+ // const result = tokenizeString('//singleline comment')
867
+ // if (result !== '[{"kind":"//","value":"singleline comment"},{"kind":"eof"}]') { throw result }
868
+ // },
869
+ // () => {
870
+ // const result = tokenizeString('true//singleline comment\nfalse')
871
+ // if (result !== '[{"kind":"true"},{"kind":"//","value":"singleline comment"},{"kind":"nl"},{"kind":"false"},{"kind":"eof"}]') { throw result }
872
+ // },
873
+ // () => {
874
+ // const result = tokenizeString('/* multiline comment */')
875
+ // if (result !== '[{"kind":"/*","value":" multiline comment "},{"kind":"eof"}]') { throw result }
876
+ // },
877
+ // () => {
878
+ // const result = tokenizeString('/* multiline comment *')
879
+ // if (result !== '[{"kind":"error","message":"*/ expected"},{"kind":"eof"}]') { throw result }
880
+ // },
881
+ // () => {
882
+ // const result = tokenizeString('/* multiline comment ')
883
+ // if (result !== '[{"kind":"error","message":"*/ expected"},{"kind":"eof"}]') { throw result }
884
+ // },
885
+ // () => {
886
+ // const result = tokenizeString('/* multiline comment \n * **/')
887
+ // if (result !== '[{"kind":"/*","value":" multiline comment \\n * *"},{"kind":"nl"},{"kind":"eof"}]') { throw result }
888
+ // },
889
+ // () => {
890
+ // const result = tokenizeString('/* multiline comment *\n * **/')
891
+ // if (result !== '[{"kind":"/*","value":" multiline comment *\\n * *"},{"kind":"nl"},{"kind":"eof"}]') { throw result }
892
+ // },
893
+ // ],
894
+ };