@shd101wyy/yo 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +80 -0
  3. package/out/cjs/index.cjs +51 -0
  4. package/out/cjs/yo-cli.cjs +2158 -0
  5. package/out/esm/index.mjs +51 -0
  6. package/out/types/src/codegen/async/runtime.d.ts +2 -0
  7. package/out/types/src/codegen/async/state-code-gen.d.ts +10 -0
  8. package/out/types/src/codegen/async/state-machine.d.ts +13 -0
  9. package/out/types/src/codegen/c/collection.d.ts +3 -0
  10. package/out/types/src/codegen/codegen-c.d.ts +12 -0
  11. package/out/types/src/codegen/constants.d.ts +3 -0
  12. package/out/types/src/codegen/expressions/array.d.ts +4 -0
  13. package/out/types/src/codegen/expressions/generation.d.ts +11 -0
  14. package/out/types/src/codegen/expressions/index.d.ts +2 -0
  15. package/out/types/src/codegen/functions/collection.d.ts +5 -0
  16. package/out/types/src/codegen/functions/context.d.ts +57 -0
  17. package/out/types/src/codegen/functions/generation.d.ts +25 -0
  18. package/out/types/src/codegen/functions/index.d.ts +2 -0
  19. package/out/types/src/codegen/index.d.ts +20 -0
  20. package/out/types/src/codegen/parallelism/runtime.d.ts +2 -0
  21. package/out/types/src/codegen/types/collection.d.ts +8 -0
  22. package/out/types/src/codegen/types/generation.d.ts +13 -0
  23. package/out/types/src/codegen/types/index.d.ts +2 -0
  24. package/out/types/src/codegen/utils/fixup.d.ts +2 -0
  25. package/out/types/src/codegen/utils/index.d.ts +77 -0
  26. package/out/types/src/codegen/values/index.d.ts +1 -0
  27. package/out/types/src/emitter.d.ts +11 -0
  28. package/out/types/src/env.d.ts +85 -0
  29. package/out/types/src/error.d.ts +45 -0
  30. package/out/types/src/evaluator/async/await-analysis-types.d.ts +23 -0
  31. package/out/types/src/evaluator/async/await-analysis.d.ts +5 -0
  32. package/out/types/src/evaluator/builtins/alignof.d.ts +8 -0
  33. package/out/types/src/evaluator/builtins/and_or.d.ts +8 -0
  34. package/out/types/src/evaluator/builtins/arc_fns.d.ts +58 -0
  35. package/out/types/src/evaluator/builtins/array_fns.d.ts +0 -0
  36. package/out/types/src/evaluator/builtins/as.d.ts +8 -0
  37. package/out/types/src/evaluator/builtins/async_fns.d.ts +8 -0
  38. package/out/types/src/evaluator/builtins/compt_assert.d.ts +8 -0
  39. package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +8 -0
  40. package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +8 -0
  41. package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +33 -0
  42. package/out/types/src/evaluator/builtins/compt_print.d.ts +8 -0
  43. package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +8 -0
  44. package/out/types/src/evaluator/builtins/consume.d.ts +8 -0
  45. package/out/types/src/evaluator/builtins/drop.d.ts +8 -0
  46. package/out/types/src/evaluator/builtins/dup.d.ts +8 -0
  47. package/out/types/src/evaluator/builtins/expr_fns.d.ts +33 -0
  48. package/out/types/src/evaluator/builtins/future_fns.d.ts +8 -0
  49. package/out/types/src/evaluator/builtins/gc.d.ts +8 -0
  50. package/out/types/src/evaluator/builtins/gensym.d.ts +8 -0
  51. package/out/types/src/evaluator/builtins/impl_constraint.d.ts +8 -0
  52. package/out/types/src/evaluator/builtins/macro_expand.d.ts +8 -0
  53. package/out/types/src/evaluator/builtins/numeric_fns.d.ts +8 -0
  54. package/out/types/src/evaluator/builtins/panic.d.ts +8 -0
  55. package/out/types/src/evaluator/builtins/ptr_fns.d.ts +8 -0
  56. package/out/types/src/evaluator/builtins/quote.d.ts +13 -0
  57. package/out/types/src/evaluator/builtins/rc.d.ts +8 -0
  58. package/out/types/src/evaluator/builtins/sizeof.d.ts +8 -0
  59. package/out/types/src/evaluator/builtins/the.d.ts +8 -0
  60. package/out/types/src/evaluator/builtins/type_fns.d.ts +28 -0
  61. package/out/types/src/evaluator/builtins/va_start.d.ts +8 -0
  62. package/out/types/src/evaluator/builtins/var_fns.d.ts +18 -0
  63. package/out/types/src/evaluator/calls/array.d.ts +13 -0
  64. package/out/types/src/evaluator/calls/array_type.d.ts +11 -0
  65. package/out/types/src/evaluator/calls/closure_type.d.ts +11 -0
  66. package/out/types/src/evaluator/calls/compt_function.d.ts +19 -0
  67. package/out/types/src/evaluator/calls/compt_list_type.d.ts +11 -0
  68. package/out/types/src/evaluator/calls/function.d.ts +16 -0
  69. package/out/types/src/evaluator/calls/function_type.d.ts +15 -0
  70. package/out/types/src/evaluator/calls/helper.d.ts +42 -0
  71. package/out/types/src/evaluator/calls/iso.d.ts +15 -0
  72. package/out/types/src/evaluator/calls/module_type.d.ts +11 -0
  73. package/out/types/src/evaluator/calls/numeric_type.d.ts +15 -0
  74. package/out/types/src/evaluator/calls/pointer.d.ts +8 -0
  75. package/out/types/src/evaluator/calls/pointer_type.d.ts +14 -0
  76. package/out/types/src/evaluator/calls/type.d.ts +12 -0
  77. package/out/types/src/evaluator/context.d.ts +169 -0
  78. package/out/types/src/evaluator/exprs/_expr.d.ts +8 -0
  79. package/out/types/src/evaluator/exprs/assignment.d.ts +9 -0
  80. package/out/types/src/evaluator/exprs/begin.d.ts +10 -0
  81. package/out/types/src/evaluator/exprs/binding.d.ts +12 -0
  82. package/out/types/src/evaluator/exprs/c_include.d.ts +8 -0
  83. package/out/types/src/evaluator/exprs/cond.d.ts +8 -0
  84. package/out/types/src/evaluator/exprs/destructuring_assignment.d.ts +33 -0
  85. package/out/types/src/evaluator/exprs/exists.d.ts +0 -0
  86. package/out/types/src/evaluator/exprs/expr.d.ts +9 -0
  87. package/out/types/src/evaluator/exprs/extern.d.ts +8 -0
  88. package/out/types/src/evaluator/exprs/identifer_and_operator.d.ts +9 -0
  89. package/out/types/src/evaluator/exprs/import.d.ts +9 -0
  90. package/out/types/src/evaluator/exprs/initialization_assignment.d.ts +8 -0
  91. package/out/types/src/evaluator/exprs/match.d.ts +8 -0
  92. package/out/types/src/evaluator/exprs/open.d.ts +8 -0
  93. package/out/types/src/evaluator/exprs/property_access.d.ts +8 -0
  94. package/out/types/src/evaluator/exprs/recur.d.ts +8 -0
  95. package/out/types/src/evaluator/exprs/subtype_of.d.ts +21 -0
  96. package/out/types/src/evaluator/exprs/test.d.ts +8 -0
  97. package/out/types/src/evaluator/exprs/typeof.d.ts +8 -0
  98. package/out/types/src/evaluator/exprs/while.d.ts +8 -0
  99. package/out/types/src/evaluator/index.d.ts +26 -0
  100. package/out/types/src/evaluator/types/array.d.ts +8 -0
  101. package/out/types/src/evaluator/types/closure.d.ts +8 -0
  102. package/out/types/src/evaluator/types/compt_list.d.ts +8 -0
  103. package/out/types/src/evaluator/types/concrete_module.d.ts +8 -0
  104. package/out/types/src/evaluator/types/dyn.d.ts +8 -0
  105. package/out/types/src/evaluator/types/enum.d.ts +8 -0
  106. package/out/types/src/evaluator/types/expr_synthesizer.d.ts +14 -0
  107. package/out/types/src/evaluator/types/field.d.ts +14 -0
  108. package/out/types/src/evaluator/types/fn_module.d.ts +8 -0
  109. package/out/types/src/evaluator/types/function.d.ts +58 -0
  110. package/out/types/src/evaluator/types/future_module.d.ts +8 -0
  111. package/out/types/src/evaluator/types/module.d.ts +19 -0
  112. package/out/types/src/evaluator/types/newtype.d.ts +8 -0
  113. package/out/types/src/evaluator/types/object.d.ts +8 -0
  114. package/out/types/src/evaluator/types/proofs.d.ts +0 -0
  115. package/out/types/src/evaluator/types/slice.d.ts +8 -0
  116. package/out/types/src/evaluator/types/struct.d.ts +8 -0
  117. package/out/types/src/evaluator/types/synthesizer.d.ts +16 -0
  118. package/out/types/src/evaluator/types/tuple.d.ts +18 -0
  119. package/out/types/src/evaluator/types/union.d.ts +8 -0
  120. package/out/types/src/evaluator/types/utils.d.ts +71 -0
  121. package/out/types/src/evaluator/types/validation.d.ts +3 -0
  122. package/out/types/src/evaluator/utils/array-utils.d.ts +15 -0
  123. package/out/types/src/evaluator/utils/closure.d.ts +35 -0
  124. package/out/types/src/evaluator/utils.d.ts +4 -0
  125. package/out/types/src/evaluator/values/anonymous_function.d.ts +8 -0
  126. package/out/types/src/evaluator/values/anonymous_module.d.ts +17 -0
  127. package/out/types/src/evaluator/values/anonymous_struct.d.ts +8 -0
  128. package/out/types/src/evaluator/values/array.d.ts +8 -0
  129. package/out/types/src/evaluator/values/boolean.d.ts +3 -0
  130. package/out/types/src/evaluator/values/char.d.ts +3 -0
  131. package/out/types/src/evaluator/values/compt_list.d.ts +8 -0
  132. package/out/types/src/evaluator/values/dyn.d.ts +8 -0
  133. package/out/types/src/evaluator/values/float.d.ts +4 -0
  134. package/out/types/src/evaluator/values/integer.d.ts +4 -0
  135. package/out/types/src/evaluator/values/module.d.ts +58 -0
  136. package/out/types/src/evaluator/values/string.d.ts +3 -0
  137. package/out/types/src/evaluator/values/tuple.d.ts +32 -0
  138. package/out/types/src/expr.d.ts +456 -0
  139. package/out/types/src/function-value.d.ts +42 -0
  140. package/out/types/src/index.d.ts +4 -0
  141. package/out/types/src/lexer.d.ts +2 -0
  142. package/out/types/src/logger.d.ts +1 -0
  143. package/out/types/src/module-manager.d.ts +30 -0
  144. package/out/types/src/naming-checker.d.ts +4 -0
  145. package/out/types/src/parser.d.ts +33 -0
  146. package/out/types/src/test-runner.d.ts +30 -0
  147. package/out/types/src/tests/codegen.test.d.ts +1 -0
  148. package/out/types/src/tests/fixme.test.d.ts +1 -0
  149. package/out/types/src/tests/module-manager.test.d.ts +1 -0
  150. package/out/types/src/tests/parser.test.d.ts +1 -0
  151. package/out/types/src/tests/sample.test.d.ts +0 -0
  152. package/out/types/src/tests/std.test.d.ts +1 -0
  153. package/out/types/src/token.d.ts +40 -0
  154. package/out/types/src/type-value.d.ts +7 -0
  155. package/out/types/src/types/compatibility.d.ts +16 -0
  156. package/out/types/src/types/creators.d.ts +73 -0
  157. package/out/types/src/types/definitions.d.ts +218 -0
  158. package/out/types/src/types/guards.d.ts +70 -0
  159. package/out/types/src/types/hierarchy.d.ts +4 -0
  160. package/out/types/src/types/index.d.ts +7 -0
  161. package/out/types/src/types/module_field.d.ts +2 -0
  162. package/out/types/src/types/tags.d.ts +45 -0
  163. package/out/types/src/types/utils.d.ts +50 -0
  164. package/out/types/src/unit-value.d.ts +7 -0
  165. package/out/types/src/utils.d.ts +6 -0
  166. package/out/types/src/value-tag.d.ts +29 -0
  167. package/out/types/src/value.d.ts +110 -0
  168. package/out/types/src/yo-cli.d.ts +1 -0
  169. package/out/types/tsconfig.tsbuildinfo +1 -0
  170. package/package.json +57 -0
  171. package/scripts/check-liburing.js +76 -0
  172. package/std/alg/hash.yo +50 -0
  173. package/std/allocator.yo +113 -0
  174. package/std/allocators/c_allocator.yo +118 -0
  175. package/std/async.yo +13 -0
  176. package/std/collections/array_list.yo +415 -0
  177. package/std/collections/hash_map.yo +482 -0
  178. package/std/collections/hash_set.yo +706 -0
  179. package/std/collections/index.yo +11 -0
  180. package/std/collections/linked_list.yo +439 -0
  181. package/std/error.yo +0 -0
  182. package/std/gc.yo +10 -0
  183. package/std/index.yo +12 -0
  184. package/std/io/file.yo +191 -0
  185. package/std/io/index.yo +5 -0
  186. package/std/libc/assert.yo +39 -0
  187. package/std/libc/ctype.yo +57 -0
  188. package/std/libc/errno.yo +182 -0
  189. package/std/libc/float.yo +87 -0
  190. package/std/libc/index.yo +29 -0
  191. package/std/libc/limits.yo +65 -0
  192. package/std/libc/math.yo +679 -0
  193. package/std/libc/signal.yo +101 -0
  194. package/std/libc/stdatomic.yo +213 -0
  195. package/std/libc/stdint.yo +214 -0
  196. package/std/libc/stdio.yo +225 -0
  197. package/std/libc/stdlib.yo +204 -0
  198. package/std/libc/string.yo +151 -0
  199. package/std/libc/time.yo +92 -0
  200. package/std/libc/unistd.yo +130 -0
  201. package/std/monad.yo +152 -0
  202. package/std/prelude.yo +3094 -0
  203. package/std/string/index.yo +8 -0
  204. package/std/string/rune.yo +82 -0
  205. package/std/string/string.yo +288 -0
  206. package/std/sync.yo +95 -0
  207. package/std/thread.yo +36 -0
  208. package/std/time.yo +13 -0
  209. package/std/worker.yo +36 -0
  210. package/vendor/mimalloc/.gitattributes +12 -0
  211. package/vendor/mimalloc/CMakeLists.txt +763 -0
  212. package/vendor/mimalloc/LICENSE +21 -0
  213. package/vendor/mimalloc/SECURITY.md +41 -0
  214. package/vendor/mimalloc/azure-pipelines.yml +251 -0
  215. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.dll +0 -0
  216. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.lib +0 -0
  217. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.dll +0 -0
  218. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.lib +0 -0
  219. package/vendor/mimalloc/bin/mimalloc-redirect.dll +0 -0
  220. package/vendor/mimalloc/bin/mimalloc-redirect.lib +0 -0
  221. package/vendor/mimalloc/bin/mimalloc-redirect32.dll +0 -0
  222. package/vendor/mimalloc/bin/mimalloc-redirect32.lib +0 -0
  223. package/vendor/mimalloc/bin/minject-arm64.exe +0 -0
  224. package/vendor/mimalloc/bin/minject.exe +0 -0
  225. package/vendor/mimalloc/bin/minject32.exe +0 -0
  226. package/vendor/mimalloc/bin/readme.md +118 -0
  227. package/vendor/mimalloc/cmake/JoinPaths.cmake +23 -0
  228. package/vendor/mimalloc/cmake/mimalloc-config-version.cmake +19 -0
  229. package/vendor/mimalloc/cmake/mimalloc-config.cmake +14 -0
  230. package/vendor/mimalloc/contrib/docker/alpine/Dockerfile +23 -0
  231. package/vendor/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile +28 -0
  232. package/vendor/mimalloc/contrib/docker/alpine-x86/Dockerfile +28 -0
  233. package/vendor/mimalloc/contrib/docker/manylinux-x64/Dockerfile +23 -0
  234. package/vendor/mimalloc/contrib/docker/readme.md +10 -0
  235. package/vendor/mimalloc/contrib/vcpkg/portfile.cmake +64 -0
  236. package/vendor/mimalloc/contrib/vcpkg/readme.md +40 -0
  237. package/vendor/mimalloc/contrib/vcpkg/usage +20 -0
  238. package/vendor/mimalloc/contrib/vcpkg/vcpkg-cmake-wrapper.cmake +20 -0
  239. package/vendor/mimalloc/contrib/vcpkg/vcpkg.json +48 -0
  240. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-a.svg +887 -0
  241. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-b.svg +1185 -0
  242. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-a.svg +757 -0
  243. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-b.svg +1028 -0
  244. package/vendor/mimalloc/doc/bench-2020/bench-r5a-1.svg +769 -0
  245. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-a.svg +868 -0
  246. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-b.svg +1157 -0
  247. package/vendor/mimalloc/doc/bench-2020/bench-r5a-2.svg +983 -0
  248. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-1.svg +683 -0
  249. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-2.svg +854 -0
  250. package/vendor/mimalloc/doc/bench-2020/bench-spec-rss.svg +713 -0
  251. package/vendor/mimalloc/doc/bench-2020/bench-spec.svg +713 -0
  252. package/vendor/mimalloc/doc/bench-2020/bench-z4-1.svg +890 -0
  253. package/vendor/mimalloc/doc/bench-2020/bench-z4-2.svg +1146 -0
  254. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-1.svg +796 -0
  255. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-2.svg +974 -0
  256. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-a.svg +952 -0
  257. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-b.svg +1255 -0
  258. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-a.svg +955 -0
  259. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-b.svg +1269 -0
  260. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-a.svg +836 -0
  261. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-b.svg +1131 -0
  262. package/vendor/mimalloc/doc/bench-2021/bench-macmini-2021-01-30.svg +766 -0
  263. package/vendor/mimalloc/doc/doxyfile +2895 -0
  264. package/vendor/mimalloc/doc/ds-logo.jpg +0 -0
  265. package/vendor/mimalloc/doc/ds-logo.png +0 -0
  266. package/vendor/mimalloc/doc/mimalloc-doc.h +1452 -0
  267. package/vendor/mimalloc/doc/mimalloc-doxygen.css +60 -0
  268. package/vendor/mimalloc/doc/mimalloc-logo-100.png +0 -0
  269. package/vendor/mimalloc/doc/mimalloc-logo.png +0 -0
  270. package/vendor/mimalloc/doc/mimalloc-logo.svg +161 -0
  271. package/vendor/mimalloc/doc/spades-logo.png +0 -0
  272. package/vendor/mimalloc/doc/unreal-logo.svg +43 -0
  273. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj +500 -0
  274. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj.filters +108 -0
  275. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj +508 -0
  276. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj.filters +111 -0
  277. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test-dep.vcxproj +355 -0
  278. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test.vcxproj +360 -0
  279. package/vendor/mimalloc/ide/vs2022/mimalloc-test-api.vcxproj +295 -0
  280. package/vendor/mimalloc/ide/vs2022/mimalloc-test-stress.vcxproj +292 -0
  281. package/vendor/mimalloc/ide/vs2022/mimalloc-test.vcxproj +289 -0
  282. package/vendor/mimalloc/ide/vs2022/mimalloc.sln +151 -0
  283. package/vendor/mimalloc/include/mimalloc/atomic.h +557 -0
  284. package/vendor/mimalloc/include/mimalloc/internal.h +1153 -0
  285. package/vendor/mimalloc/include/mimalloc/prim.h +421 -0
  286. package/vendor/mimalloc/include/mimalloc/track.h +145 -0
  287. package/vendor/mimalloc/include/mimalloc/types.h +685 -0
  288. package/vendor/mimalloc/include/mimalloc-new-delete.h +66 -0
  289. package/vendor/mimalloc/include/mimalloc-override.h +68 -0
  290. package/vendor/mimalloc/include/mimalloc-stats.h +103 -0
  291. package/vendor/mimalloc/include/mimalloc.h +612 -0
  292. package/vendor/mimalloc/mimalloc.pc.in +11 -0
  293. package/vendor/mimalloc/readme.md +946 -0
  294. package/vendor/mimalloc/src/alloc-aligned.c +360 -0
  295. package/vendor/mimalloc/src/alloc-override.c +316 -0
  296. package/vendor/mimalloc/src/alloc-posix.c +185 -0
  297. package/vendor/mimalloc/src/alloc.c +692 -0
  298. package/vendor/mimalloc/src/arena-abandon.c +346 -0
  299. package/vendor/mimalloc/src/arena.c +1043 -0
  300. package/vendor/mimalloc/src/bitmap.c +441 -0
  301. package/vendor/mimalloc/src/bitmap.h +119 -0
  302. package/vendor/mimalloc/src/free.c +572 -0
  303. package/vendor/mimalloc/src/heap.c +733 -0
  304. package/vendor/mimalloc/src/init.c +714 -0
  305. package/vendor/mimalloc/src/libc.c +334 -0
  306. package/vendor/mimalloc/src/options.c +663 -0
  307. package/vendor/mimalloc/src/os.c +770 -0
  308. package/vendor/mimalloc/src/page-queue.c +390 -0
  309. package/vendor/mimalloc/src/page.c +1049 -0
  310. package/vendor/mimalloc/src/prim/emscripten/prim.c +249 -0
  311. package/vendor/mimalloc/src/prim/osx/alloc-override-zone.c +461 -0
  312. package/vendor/mimalloc/src/prim/osx/prim.c +9 -0
  313. package/vendor/mimalloc/src/prim/prim.c +76 -0
  314. package/vendor/mimalloc/src/prim/readme.md +9 -0
  315. package/vendor/mimalloc/src/prim/unix/prim.c +934 -0
  316. package/vendor/mimalloc/src/prim/wasi/prim.c +284 -0
  317. package/vendor/mimalloc/src/prim/windows/etw-mimalloc.wprp +61 -0
  318. package/vendor/mimalloc/src/prim/windows/etw.h +905 -0
  319. package/vendor/mimalloc/src/prim/windows/etw.man +0 -0
  320. package/vendor/mimalloc/src/prim/windows/prim.c +878 -0
  321. package/vendor/mimalloc/src/prim/windows/readme.md +17 -0
  322. package/vendor/mimalloc/src/random.c +258 -0
  323. package/vendor/mimalloc/src/segment-map.c +142 -0
  324. package/vendor/mimalloc/src/segment.c +1702 -0
  325. package/vendor/mimalloc/src/static.c +41 -0
  326. package/vendor/mimalloc/src/stats.c +635 -0
  327. package/vendor/mimalloc/test/CMakeLists.txt +56 -0
  328. package/vendor/mimalloc/test/main-override-dep.cpp +51 -0
  329. package/vendor/mimalloc/test/main-override-dep.h +11 -0
  330. package/vendor/mimalloc/test/main-override-static.c +539 -0
  331. package/vendor/mimalloc/test/main-override.c +36 -0
  332. package/vendor/mimalloc/test/main-override.cpp +497 -0
  333. package/vendor/mimalloc/test/main.c +46 -0
  334. package/vendor/mimalloc/test/readme.md +16 -0
  335. package/vendor/mimalloc/test/test-api-fill.c +343 -0
  336. package/vendor/mimalloc/test/test-api.c +466 -0
  337. package/vendor/mimalloc/test/test-stress.c +428 -0
  338. package/vendor/mimalloc/test/test-wrong.c +92 -0
  339. package/vendor/mimalloc/test/testhelper.h +49 -0
@@ -0,0 +1,73 @@
1
+ import { Environment, Frame } from "../env";
2
+ import { Expr } from "../expr";
3
+ import { FunctionValue } from "../function-value";
4
+ import { Value } from "../value";
5
+ import { ArrayType, ComptListType, DynType, EnumType, FnModuleType, FunctionForallParameter, FunctionParameter, FunctionParameterExprs, FunctionReturn, FunctionType, FutureModuleType, IsoType, ModuleType, PtrType, SliceType, SomeType, StructType, TupleType, Type, TypeField, TypeHierarchyType, UnionType, VoidType } from "./definitions";
6
+ export declare function createComptIntType(): Type;
7
+ export declare function createComptFloatType(): Type;
8
+ export declare function createComptStringType(): Type;
9
+ export declare function createExprType(): Type;
10
+ export declare function createComptListType(childType: Type): ComptListType;
11
+ export declare function createExprListType(): Type;
12
+ export declare function createBooleanType(): Type;
13
+ export declare function createUsizeType(): Type;
14
+ export declare function createIsizeType(): Type;
15
+ export declare function createU8Type(): Type;
16
+ export declare function createI8Type(): Type;
17
+ export declare function createU16Type(): Type;
18
+ export declare function createI16Type(): Type;
19
+ export declare function createU32Type(): Type;
20
+ export declare function createI32Type(): Type;
21
+ export declare function createU64Type(): Type;
22
+ export declare function createI64Type(): Type;
23
+ export declare function createF32Type(): Type;
24
+ export declare function createF64Type(): Type;
25
+ export declare function createUnitType(): Type;
26
+ export declare function createCharType(): Type;
27
+ export declare function createShortType(): Type;
28
+ export declare function createUShortType(): Type;
29
+ export declare function createIntType(): Type;
30
+ export declare function createUIntType(): Type;
31
+ export declare function createLongType(): Type;
32
+ export declare function createULongType(): Type;
33
+ export declare function createLongLongType(): Type;
34
+ export declare function createULongLongType(): Type;
35
+ export declare function createLongDoubleType(): Type;
36
+ export declare function createType0(baseType?: Type): TypeHierarchyType;
37
+ export declare function createArrayType(childType: Type, length: Value): ArrayType;
38
+ export declare function createSliceType(childType: Type): SliceType;
39
+ export declare function createVoidType(): VoidType;
40
+ export declare function createTupleType(fields: TypeField[]): TupleType;
41
+ export declare function createStructType(env: Environment, isReferenceSemantics?: boolean, isNewtype?: boolean): StructType;
42
+ export declare function createModuleType(env: Environment): ModuleType;
43
+ export declare function createEnumType(env: Environment): EnumType;
44
+ export declare function createUnionType(env: Environment): UnionType;
45
+ export declare function createFunctionType({ parameters, forallParameters, variadicParameter, return_, env, parametersFrame, SelfType, ParentFunctionType, isClosure, }: {
46
+ parameters: FunctionParameter[];
47
+ forallParameters: FunctionForallParameter[];
48
+ variadicParameter: FunctionParameter | undefined;
49
+ return_: FunctionReturn;
50
+ env: Environment;
51
+ parametersFrame: Frame;
52
+ SelfType?: Type;
53
+ ParentFunctionType?: FunctionType;
54
+ isClosure?: boolean;
55
+ }): FunctionType;
56
+ export declare function createPtrType(childType: Type): PtrType;
57
+ export declare function createIsoType(childType: Type, env: Environment): IsoType;
58
+ export declare function createSomeType(type: TypeHierarchyType, variableName: string, id?: string, requiredModules?: ModuleType[], negativeModules?: ModuleType[], recursiveTypeRef?: {
59
+ functionValue: FunctionValue;
60
+ argValues: Value[];
61
+ }): SomeType;
62
+ export declare function createTypeHierarchy(level: number, baseType?: Type): TypeHierarchyType;
63
+ export declare function getFunctionParameterExprs({ expr, labelExpr, typeExpr, defaultValueExpr, assignedValueExpr, }: {
64
+ expr: Expr;
65
+ labelExpr: Expr | undefined;
66
+ typeExpr: Expr | undefined;
67
+ defaultValueExpr: Expr | undefined;
68
+ assignedValueExpr: Expr | undefined;
69
+ }): FunctionParameterExprs;
70
+ export declare function createFnModuleType(fnType: FunctionType, env: Environment): FnModuleType;
71
+ export declare function createFutureModuleType(outputType: Type, env: Environment): FutureModuleType;
72
+ export declare function createDynType(requiredModules: ModuleType[], env: Environment, negativeModules?: ModuleType[]): DynType;
73
+ export declare function clearAllCachedTypes(): void;
@@ -0,0 +1,218 @@
1
+ import { Environment, Frame } from "../env";
2
+ import { Expr } from "../expr";
3
+ import { FunctionValue } from "../function-value";
4
+ import { Value } from "../value";
5
+ import { TypeTag } from "./tags";
6
+ export type TypeId = string;
7
+ export type ExternLanguage = "yo" | "c";
8
+ export interface Type {
9
+ tag: TypeTag;
10
+ id: TypeId;
11
+ typeName?: string;
12
+ isExtern?: ExternLanguage;
13
+ externName?: string;
14
+ cInclude?: string;
15
+ module?: ModuleType;
16
+ definedInModulePath?: string;
17
+ }
18
+ export interface ExprType extends Type {
19
+ tag: TypeTag.Expr;
20
+ id: TypeTag.Expr;
21
+ module: ModuleType;
22
+ }
23
+ export interface ComptListType extends Type {
24
+ tag: TypeTag.ComptList;
25
+ childType: Type;
26
+ module: ModuleType;
27
+ }
28
+ export interface TypeHierarchyType extends Type {
29
+ tag: TypeTag.Type;
30
+ level: number;
31
+ baseType?: Type;
32
+ module: ModuleType;
33
+ }
34
+ export interface SomeType extends Type {
35
+ tag: TypeTag.SomeType;
36
+ name: string;
37
+ parentType: TypeHierarchyType;
38
+ size: undefined;
39
+ functionApplication?: Expr;
40
+ resolvedConcreteType?: Type;
41
+ requiredModules: ModuleType[];
42
+ negativeModules?: ModuleType[];
43
+ module: ModuleType;
44
+ recursiveTypeRef?: {
45
+ functionValue: FunctionValue;
46
+ argValues: Value[];
47
+ };
48
+ }
49
+ export interface ArrayType extends Type {
50
+ tag: TypeTag.Array;
51
+ childType: Type;
52
+ length: Value;
53
+ module: ModuleType;
54
+ }
55
+ export interface SliceType extends Type {
56
+ tag: TypeTag.Slice;
57
+ childType: Type;
58
+ module: ModuleType;
59
+ }
60
+ export interface VoidType extends Type {
61
+ tag: TypeTag.Void;
62
+ module: ModuleType;
63
+ }
64
+ export type ElementExprs = {
65
+ expr: Expr;
66
+ labelExpr?: Expr;
67
+ typeExpr?: Expr;
68
+ defaultValueExpr?: Expr;
69
+ assignedValueExpr?: Expr;
70
+ };
71
+ export interface TypeField {
72
+ type: Type;
73
+ label: string;
74
+ isCompileTimeOnly: boolean;
75
+ defaultValue?: Value;
76
+ assignedValue?: Value;
77
+ exprs: ElementExprs;
78
+ }
79
+ export interface TupleType extends Type {
80
+ tag: TypeTag.Tuple;
81
+ fields: TypeField[];
82
+ module: ModuleType;
83
+ }
84
+ export type FunctionParameterExprs = {
85
+ expr: Expr;
86
+ labelExpr?: Expr;
87
+ typeExpr?: Expr;
88
+ defaultValueExpr?: Expr;
89
+ assignedValueExpr?: Expr;
90
+ };
91
+ export interface FunctionParameter {
92
+ label: string;
93
+ type: Type;
94
+ isCompileTimeOnly: boolean;
95
+ isQuote: boolean;
96
+ isOwningTheGcValue: boolean;
97
+ exprs: FunctionParameterExprs;
98
+ assignedValue?: Value;
99
+ }
100
+ export type FunctionForallParameter = FunctionParameter & {
101
+ isCompileTimeOnly: true;
102
+ };
103
+ export interface StructType extends Type {
104
+ tag: TypeTag.Struct;
105
+ isReferenceSemantics: boolean;
106
+ isNewtype: boolean;
107
+ functionValue?: FunctionValue;
108
+ fields: TypeField[];
109
+ module: ModuleType;
110
+ env: Environment;
111
+ }
112
+ export interface ModuleField {
113
+ type: Type;
114
+ label: string;
115
+ isCompileTimeOnly: true;
116
+ sourceModulePath?: string;
117
+ defaultValue?: Value;
118
+ assignedValue?: Value;
119
+ exprs: ElementExprs;
120
+ }
121
+ export interface ModuleType extends Type {
122
+ tag: TypeTag.Module;
123
+ functionValue?: FunctionValue;
124
+ fields: ModuleField[];
125
+ module: undefined;
126
+ env: Environment;
127
+ receiverType?: Type;
128
+ isNegatedConstraint?: boolean;
129
+ selfConstraints?: ModuleType[];
130
+ negativeSelfConstraints?: ModuleType[];
131
+ isFn?: {
132
+ callType: FunctionType;
133
+ };
134
+ isFuture?: {
135
+ outputType: Type;
136
+ };
137
+ isConcrete?: {
138
+ concreteType: Type;
139
+ };
140
+ definedInModulePath?: string;
141
+ }
142
+ export type FnModuleType = ModuleType & {
143
+ isFn: {
144
+ callType: FunctionType;
145
+ };
146
+ };
147
+ export type FutureModuleType = ModuleType & {
148
+ isFuture: {
149
+ outputType: Type;
150
+ };
151
+ };
152
+ export type ConcreteModuleType = ModuleType & {
153
+ isConcrete: {
154
+ concreteType: Type;
155
+ };
156
+ };
157
+ export interface EnumVariant {
158
+ name: string;
159
+ fields?: TypeField[];
160
+ }
161
+ export interface EnumType extends Type {
162
+ tag: TypeTag.Enum;
163
+ functionValue?: FunctionValue;
164
+ variants: EnumVariant[];
165
+ module: ModuleType;
166
+ env: Environment;
167
+ selectedVariantName?: string;
168
+ requiredVariantNames?: string[];
169
+ }
170
+ export interface UnionType extends Type {
171
+ tag: TypeTag.Union;
172
+ functionValue?: FunctionValue;
173
+ fields: TypeField[];
174
+ module: ModuleType;
175
+ env: Environment;
176
+ }
177
+ export interface FunctionReturn {
178
+ type: Type;
179
+ expr?: Expr;
180
+ isCompileTimeOnly: boolean;
181
+ isUnquote: boolean;
182
+ label: string;
183
+ }
184
+ export interface FunctionType extends Type {
185
+ tag: TypeTag.Function;
186
+ parameters: FunctionParameter[];
187
+ forallParameters: FunctionForallParameter[];
188
+ variadicParameter?: FunctionParameter;
189
+ return: FunctionReturn;
190
+ env: Environment;
191
+ parametersFrame: Frame;
192
+ SelfType?: Type;
193
+ ParentFunctionType?: FunctionType;
194
+ module: ModuleType;
195
+ isClosure?: boolean;
196
+ whereClauseConstraints?: Map<SomeType, {
197
+ requiredModules: ModuleType[];
198
+ negativeModules: ModuleType[];
199
+ }>;
200
+ }
201
+ export interface PtrType extends Type {
202
+ tag: TypeTag.Ptr;
203
+ childType: Type;
204
+ module: ModuleType;
205
+ }
206
+ export interface IsoType extends Type {
207
+ tag: TypeTag.Iso;
208
+ childType: Type;
209
+ module: ModuleType;
210
+ env: Environment;
211
+ }
212
+ export interface DynType extends Type {
213
+ tag: TypeTag.Dyn;
214
+ requiredModules: ModuleType[];
215
+ negativeModules?: ModuleType[];
216
+ module: ModuleType;
217
+ env: Environment;
218
+ }
@@ -0,0 +1,70 @@
1
+ import { ArrayType, ComptListType, ConcreteModuleType, DynType, EnumType, FnModuleType, FunctionType, FutureModuleType, IsoType, ModuleType, PtrType, SliceType, SomeType, StructType, TupleType, Type, TypeHierarchyType, UnionType, VoidType } from "./definitions";
2
+ export declare function isPrimitiveType(type: Type): boolean;
3
+ export declare function isUnitType(type?: Type): boolean;
4
+ export declare function isComptIntType(type?: Type): boolean;
5
+ export declare function isComptFloatType(type?: Type): boolean;
6
+ export declare function isComptStringType(type?: Type): boolean;
7
+ export declare function isComptListType(type?: Type): type is ComptListType;
8
+ export declare function isExprListType(type?: Type): boolean;
9
+ export declare function isBooleanType(type?: Type): boolean;
10
+ export declare function isUsizeType(type?: Type): boolean;
11
+ export declare function isIsizeType(type?: Type): boolean;
12
+ export declare function isU8Type(type?: Type): boolean;
13
+ export declare function isI8Type(type?: Type): boolean;
14
+ export declare function isU16Type(type?: Type): boolean;
15
+ export declare function isI16Type(type?: Type): boolean;
16
+ export declare function isU32Type(type?: Type): boolean;
17
+ export declare function isI32Type(type?: Type): boolean;
18
+ export declare function isU64Type(type?: Type): boolean;
19
+ export declare function isI64Type(type?: Type): boolean;
20
+ export declare function isF32Type(type?: Type): boolean;
21
+ export declare function isF64Type(type?: Type): boolean;
22
+ export declare function isExprType(type?: Type): boolean;
23
+ export declare function isArrayType(type?: Type): type is ArrayType;
24
+ export declare function isSliceType(type?: Type): type is SliceType;
25
+ export declare function isTupleType(type?: Type): type is TupleType;
26
+ export declare function isUnionType(type?: Type): type is UnionType;
27
+ export declare function isEnumType(type?: Type): type is EnumType;
28
+ export declare function isStructType(type?: Type): type is StructType;
29
+ export declare function isObjectType(type?: Type): type is StructType & {
30
+ isReferenceSemantics: true;
31
+ };
32
+ export declare function isNewtypeType(type?: Type): type is StructType & {
33
+ isNewtype: true;
34
+ };
35
+ export declare function isModuleType(type?: Type): type is ModuleType;
36
+ export declare function isFnModuleType(type?: Type): type is FnModuleType;
37
+ export declare function isFunctionType(type?: Type): type is FunctionType;
38
+ export declare function isFunctionTypeAndIsTypeFunction(type?: Type): boolean;
39
+ export declare function isFunctionTypeAndIsMacroFunction(type?: Type): boolean;
40
+ export declare function isFunctionTypeAndReturnsComptValue(type?: Type): boolean;
41
+ export declare function isTypeHierarchyType(type?: Type): type is TypeHierarchyType;
42
+ export declare function isType0(type?: Type): boolean;
43
+ export declare function isSomeType(type?: Type): type is SomeType;
44
+ export declare function isPtrType(type?: Type): type is PtrType;
45
+ export declare function isIsoType(type?: Type): type is IsoType;
46
+ export declare function isDynType(type?: Type): type is DynType;
47
+ export declare function isGcType(type?: Type): boolean;
48
+ export declare function isIntegerType(type?: Type): boolean;
49
+ export declare function isFloatType(type?: Type): boolean;
50
+ export declare function isSignedIntegerType(type?: Type): boolean;
51
+ export declare function isUnsignedIntegerType(type?: Type): boolean;
52
+ export declare function isCharType(type?: Type): boolean;
53
+ export declare function isShortType(type?: Type): boolean;
54
+ export declare function isUShortType(type?: Type): boolean;
55
+ export declare function isIntType(type?: Type): boolean;
56
+ export declare function isUIntType(type?: Type): boolean;
57
+ export declare function isLongType(type?: Type): boolean;
58
+ export declare function isULongType(type?: Type): boolean;
59
+ export declare function isLongLongType(type?: Type): boolean;
60
+ export declare function isULongLongType(type?: Type): boolean;
61
+ export declare function isLongDoubleType(type?: Type): boolean;
62
+ export declare function isVoidType(type?: Type): type is VoidType;
63
+ export declare function isFutureModuleType(type?: Type): type is FutureModuleType;
64
+ export declare function isConcreteModuleType(type?: Type): type is ConcreteModuleType;
65
+ export declare function isCCompatibleType(type?: Type): boolean;
66
+ export declare function isFunctionSpecializable(functionType: FunctionType): boolean;
67
+ export declare function isBoxedType(type: Type): type is StructType & {
68
+ isReferenceSemantics: true;
69
+ __isBoxed: true;
70
+ };
@@ -0,0 +1,4 @@
1
+ import { Token } from "../token";
2
+ import { FunctionParameter, Type, TypeField } from "./definitions";
3
+ export declare function typeOfType(type: Type, checkedTupleElements?: TypeField[]): Type;
4
+ export declare function getFunctionParameterToken(parameter: FunctionParameter): Token;
@@ -0,0 +1,7 @@
1
+ export * from "./compatibility";
2
+ export * from "./creators";
3
+ export * from "./definitions";
4
+ export * from "./guards";
5
+ export * from "./hierarchy";
6
+ export * from "./tags";
7
+ export * from "./utils";
@@ -0,0 +1,2 @@
1
+ import { ModuleType } from "./definitions";
2
+ export declare function addModuleFieldsByCode(module: ModuleType, elements: Record<string, string>): void;
@@ -0,0 +1,45 @@
1
+ export declare enum TypeTag {
2
+ Unit = "unit",
3
+ Bool = "bool",
4
+ Usize = "usize",
5
+ Isize = "isize",
6
+ U8 = "u8",
7
+ I8 = "i8",
8
+ U16 = "u16",
9
+ I16 = "i16",
10
+ U32 = "u32",
11
+ I32 = "i32",
12
+ U64 = "u64",
13
+ I64 = "i64",
14
+ F32 = "f32",
15
+ F64 = "f64",
16
+ ComptInt = "compt_int",
17
+ ComptFloat = "compt_float",
18
+ ComptString = "compt_string",
19
+ Char = "char",
20
+ Short = "short",
21
+ UShort = "ushort",
22
+ Int = "int",
23
+ UInt = "uint",
24
+ Long = "long",
25
+ ULong = "ulong",
26
+ LongLong = "longlong",
27
+ ULongLong = "ulonglong",
28
+ LongDouble = "longdouble",
29
+ Void = "void",
30
+ Type = "Type",
31
+ Array = "Array",
32
+ Tuple = "Tuple",
33
+ Struct = "Struct",
34
+ Enum = "Enum",
35
+ Union = "Union",
36
+ Function = "Function",
37
+ SomeType = "SomeType",
38
+ Slice = "Slice",
39
+ Module = "Module",
40
+ Ptr = "Ptr",
41
+ Iso = "Iso",
42
+ Dyn = "Dyn",
43
+ Expr = "Expr",
44
+ ComptList = "ComptList"
45
+ }
@@ -0,0 +1,50 @@
1
+ import { Environment } from "../env";
2
+ import { Expr } from "../expr";
3
+ import { Token } from "../token";
4
+ import { DynType, FnModuleType, FunctionParameter, FutureModuleType, ModuleType, SomeType, Type, TypeField } from "./definitions";
5
+ export declare function getModuleTypeFromEnv(env: Environment, moduleName: string): ModuleType | undefined;
6
+ export declare function typeImplementsModuleInternal({ targetType, moduleType, env, }: {
7
+ targetType: Type;
8
+ moduleType: ModuleType;
9
+ env: Environment;
10
+ }): boolean;
11
+ export declare function typeImplementsSend(type: Type | undefined, env: Environment): boolean;
12
+ export declare function typeImplementsFn(type: Type | undefined): type is (SomeType | DynType) & {
13
+ isFn: true;
14
+ };
15
+ export declare function extractFnModuleFromType(type: Type): FnModuleType | undefined;
16
+ export declare function typeImplementsFuture(type: Type | undefined): type is (SomeType | DynType) & {
17
+ isFuture: true;
18
+ };
19
+ export declare function extractFutureModuleFromType(type: Type): FutureModuleType | undefined;
20
+ export declare function typeRequiresComptModifier(type?: Type): boolean;
21
+ export declare function typeProhibitsComptModifier(type?: Type): boolean;
22
+ export declare function typeContainsGcType(type?: Type, checkedTypes?: Type[]): boolean;
23
+ export declare function typeContainsSomeType(type?: Type, checkedTypes?: Type[]): boolean;
24
+ export declare function getAllSomeTypes(type: Type): Set<SomeType>;
25
+ export declare function typeRequiresInference(type?: Type): boolean;
26
+ export declare function getValueOfSomeTypeFromEnv(env: Environment, someType: SomeType): Type;
27
+ export declare function convertComptTypeToRuntimeType({ type, expectedType, expr, env, }: {
28
+ type: Type;
29
+ expectedType?: Type;
30
+ expr?: Expr;
31
+ env: Environment;
32
+ }): Type;
33
+ export declare function getIntegerTypeBits(type: Type): number;
34
+ export declare function getIntegerTypeRange(type: Type): {
35
+ min: bigint;
36
+ max: bigint;
37
+ };
38
+ export declare function canComptIntCastTo(targetType: Type): boolean;
39
+ export declare function canComptFloatCastTo(targetType: Type): boolean;
40
+ export declare function functionParameterToString(parameter: FunctionParameter, visited?: Set<string>): string;
41
+ export declare function tupleFieldToString(element: TypeField, visited?: Set<string>): string;
42
+ export declare function typeToString(type: Type, visited?: Set<string>): string;
43
+ export declare function setTargetPointerSize(bits: number): void;
44
+ export declare function getTargetPointerSizeBits(): number;
45
+ export declare function getTargetPointerSizeBytes(): number;
46
+ export declare function getAlignmentOfType(type: Type): number | null;
47
+ export declare function getSizeOfType(type: Type): number | null;
48
+ export declare function prohibitVoidType(type: Type, token: Token): void;
49
+ export declare function canTypeFormGcCycle(type: Type, visitedTypes?: Set<string>): boolean;
50
+ export declare function typeContainsSelfTypeForDynamicDispatchCheck(type: Type, selfType: Type | undefined): boolean;
@@ -0,0 +1,7 @@
1
+ import { Type } from "./types";
2
+ import { ValueTag } from "./value-tag";
3
+ export type UnitValue = {
4
+ tag: ValueTag.Unit;
5
+ type: Type;
6
+ };
7
+ export declare const VUnit: UnitValue;
@@ -0,0 +1,6 @@
1
+ export declare function randomId(): string;
2
+ export declare function generateModuleId(modulePath: string): string;
3
+ export declare function generateNewTempVariableName(modulePath: string): string;
4
+ export declare function isTempVariableName(modulePath: string, variableName: string): boolean;
5
+ export declare function generateVarialeId(modulePath: string, variableName: string): string;
6
+ export declare function hashString(input: string): string;
@@ -0,0 +1,29 @@
1
+ export declare enum ValueTag {
2
+ Type = "Type",
3
+ ComptInt = "ComptInt",
4
+ ComptFloat = "ComptFloat",
5
+ ComptString = "ComptString",
6
+ U8 = "U8",
7
+ I8 = "I8",
8
+ U16 = "U16",
9
+ I16 = "I16",
10
+ U32 = "U32",
11
+ I32 = "I32",
12
+ U64 = "U64",
13
+ I64 = "I64",
14
+ F32 = "F32",
15
+ F64 = "F64",
16
+ Usize = "Usize",
17
+ Isize = "Isize",
18
+ Unit = "Unit",
19
+ Bool = "Bool",
20
+ Array = "Array",
21
+ Function = "Function",
22
+ Tuple = "Tuple",
23
+ Struct = "Struct",
24
+ Enum = "Enum",
25
+ Module = "Module",
26
+ Expr = "Expr",
27
+ ComptList = "ComptList",
28
+ Unknown = "Unknown"
29
+ }
@@ -0,0 +1,110 @@
1
+ import { Environment } from "./env";
2
+ import { Expr } from "./expr";
3
+ import { FunctionValue } from "./function-value";
4
+ import { TypeValue } from "./type-value";
5
+ import { ArrayType, ComptListType, EnumType, ExprType, ModuleType, StructType, TupleType, Type } from "./types";
6
+ import { UnitValue } from "./unit-value";
7
+ import { ValueTag } from "./value-tag";
8
+ export type ComptStringValue = {
9
+ tag: ValueTag.ComptString;
10
+ type: Type;
11
+ value: string;
12
+ };
13
+ export type NumberValue = {
14
+ tag: ValueTag.ComptInt | ValueTag.ComptFloat | ValueTag.U8 | ValueTag.I8 | ValueTag.U16 | ValueTag.I16 | ValueTag.U32 | ValueTag.I32 | ValueTag.U64 | ValueTag.I64 | ValueTag.F32 | ValueTag.F64 | ValueTag.Usize | ValueTag.Isize;
15
+ type: Type;
16
+ value: number;
17
+ };
18
+ export type BooleanValue = {
19
+ tag: ValueTag.Bool;
20
+ type: Type;
21
+ value: boolean;
22
+ };
23
+ export type TupleValue = {
24
+ tag: ValueTag.Tuple;
25
+ type: TupleType;
26
+ fields: Value[];
27
+ };
28
+ export type StructValue = {
29
+ tag: ValueTag.Struct;
30
+ type: StructType;
31
+ fields: Value[];
32
+ };
33
+ export type EnumValue = {
34
+ tag: ValueTag.Enum;
35
+ type: EnumType;
36
+ variantName: string;
37
+ fields: Value[];
38
+ };
39
+ export type ModuleValue = {
40
+ tag: ValueTag.Module;
41
+ type: ModuleType;
42
+ fields: (Value | undefined)[];
43
+ };
44
+ export type ArrayValue = {
45
+ tag: ValueTag.Array;
46
+ type: ArrayType;
47
+ elements: Value[];
48
+ };
49
+ export type ExprValue = {
50
+ tag: ValueTag.Expr;
51
+ type: ExprType;
52
+ value: Expr;
53
+ };
54
+ export type ComptListValue = {
55
+ tag: ValueTag.ComptList;
56
+ type: ComptListType;
57
+ elements: Value[];
58
+ };
59
+ export type UnknownValue = {
60
+ tag: ValueTag.Unknown;
61
+ type: Type;
62
+ variableName?: string;
63
+ };
64
+ export type Value = TypeValue | ComptStringValue | ComptListValue | NumberValue | UnitValue | BooleanValue | ArrayValue | TupleValue | StructValue | EnumValue | ModuleValue | FunctionValue | ExprValue | UnknownValue;
65
+ export declare function valueToString(value?: Value): string;
66
+ export declare function isTypeValue(value?: Value): value is TypeValue;
67
+ export declare function isComptIntValue(value?: Value): value is NumberValue;
68
+ export declare function isComptFloatValue(value?: Value): value is NumberValue;
69
+ export declare function isComptStringValue(value?: Value): value is ComptStringValue;
70
+ export declare function isComptListValue(value?: Value): value is ComptListValue;
71
+ export declare function isExprListValue(value?: Value): value is ComptListValue;
72
+ export declare function isNumberValue(value?: Value): value is NumberValue;
73
+ export declare function isBooleanValue(value?: Value): value is BooleanValue;
74
+ export declare function isFunctionValue(value?: Value): value is FunctionValue;
75
+ export declare function isUnknownValue(value?: Value): value is UnknownValue;
76
+ export declare function isTupleValue(value?: Value): value is TupleValue;
77
+ export declare function isStructValue(value?: Value): value is StructValue;
78
+ export declare function isArrayValue(value?: Value): value is ArrayValue;
79
+ export declare function isEnumValue(value?: Value): value is EnumValue;
80
+ export declare function isModuleValue(value?: Value): value is ModuleValue;
81
+ export declare function isRegionValue(_value?: Value): boolean;
82
+ export declare function isExprValue(value?: Value): value is ExprValue;
83
+ export declare function createTypeValue(value: Type): TypeValue;
84
+ export declare function createComptStringValue(value: string): ComptStringValue;
85
+ export declare function createComptListValue(childType: Type, elements: Value[]): ComptListValue;
86
+ export declare function createNumberValue(tag: NumberValue["tag"], value: number): {
87
+ tag: ValueTag.ComptInt | ValueTag.ComptFloat | ValueTag.U8 | ValueTag.I8 | ValueTag.U16 | ValueTag.I16 | ValueTag.U32 | ValueTag.I32 | ValueTag.U64 | ValueTag.I64 | ValueTag.F32 | ValueTag.F64 | ValueTag.Usize | ValueTag.Isize;
88
+ type: Type;
89
+ value: number;
90
+ };
91
+ export declare function createComptIntValue(value: number): NumberValue;
92
+ export declare function createComptFloatValue(value: number): NumberValue;
93
+ export declare function createBooleanValue(value: boolean): BooleanValue;
94
+ export declare function createUnknownValue(type: Type, variableName?: string, recursiveTypeRef?: {
95
+ functionValue: FunctionValue;
96
+ argValues: Value[];
97
+ }): UnknownValue | TypeValue;
98
+ export declare function createStructValue(type: StructType, fields: Value[]): StructValue;
99
+ export declare function createModuleValue(type: ModuleType, fields: (Value | undefined)[]): ModuleValue;
100
+ export declare function createTupleValue(type: TupleType, fields: Value[]): TupleValue;
101
+ export declare function createEnumValue(type: EnumType, variantName: string, fields: Value[]): EnumValue;
102
+ export declare function createArrayValue(type: ArrayType, elements: Value[]): ArrayValue;
103
+ export declare function createExprValue(expr: Expr): ExprValue;
104
+ export declare function areValuesEqual(expected: {
105
+ value: Value | undefined;
106
+ env: Environment;
107
+ }, given: {
108
+ value: Value | undefined;
109
+ env: Environment;
110
+ }): boolean;
@@ -0,0 +1 @@
1
+ export {};