redscript-mc 2.6.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3762) hide show
  1. package/.github/workflows/ci.yml +11 -0
  2. package/CHANGELOG.md +89 -0
  3. package/README-benchmarks.md +48 -0
  4. package/README-vscode-test.md +251 -0
  5. package/README.md +3 -75
  6. package/README.zh.md +165 -147
  7. package/RELEASE_NOTES.md +74 -0
  8. package/ROADMAP.md +138 -124
  9. package/benchmarks/_shared.ts +468 -0
  10. package/benchmarks/baseline.json +2816 -0
  11. package/benchmarks/baseline.md +13 -0
  12. package/benchmarks/compiler-perf.report.json +207 -0
  13. package/benchmarks/compiler-perf.ts +76 -0
  14. package/benchmarks/results.md +13 -0
  15. package/benchmarks/stdlib-complexity.report.json +2606 -0
  16. package/benchmarks/stdlib-complexity.ts +54 -0
  17. package/benchmarks/stdlib-size.md +57 -0
  18. package/benchmarks/stdlib-size.ts +91 -0
  19. package/coverage-report.md +177 -0
  20. package/dist/__tests__/cli.test.d.ts +1 -0
  21. package/dist/__tests__/cli.test.js +278 -0
  22. package/dist/__tests__/codegen.test.d.ts +1 -0
  23. package/dist/__tests__/codegen.test.js +152 -0
  24. package/dist/__tests__/compile-all.test.d.ts +10 -0
  25. package/dist/__tests__/compile-all.test.js +108 -0
  26. package/dist/__tests__/dce.test.d.ts +1 -0
  27. package/dist/__tests__/dce.test.js +138 -0
  28. package/dist/__tests__/diagnostics.test.d.ts +4 -0
  29. package/dist/__tests__/diagnostics.test.js +149 -0
  30. package/dist/__tests__/e2e.test.d.ts +6 -0
  31. package/dist/__tests__/e2e.test.js +1847 -0
  32. package/dist/__tests__/entity-types.test.d.ts +1 -0
  33. package/dist/__tests__/entity-types.test.js +203 -0
  34. package/dist/__tests__/formatter.test.d.ts +1 -0
  35. package/dist/__tests__/formatter.test.js +40 -0
  36. package/dist/__tests__/lexer.test.d.ts +1 -0
  37. package/dist/__tests__/lexer.test.js +343 -0
  38. package/dist/__tests__/lowering.test.d.ts +1 -0
  39. package/dist/__tests__/lowering.test.js +1015 -0
  40. package/dist/__tests__/macro.test.d.ts +8 -0
  41. package/dist/__tests__/macro.test.js +305 -0
  42. package/dist/__tests__/mc-integration.test.d.ts +12 -0
  43. package/dist/__tests__/mc-integration.test.js +819 -0
  44. package/dist/__tests__/mc-syntax.test.d.ts +1 -0
  45. package/dist/__tests__/mc-syntax.test.js +124 -0
  46. package/dist/__tests__/nbt.test.d.ts +1 -0
  47. package/dist/__tests__/nbt.test.js +82 -0
  48. package/dist/__tests__/optimizer-advanced.test.d.ts +1 -0
  49. package/dist/__tests__/optimizer-advanced.test.js +124 -0
  50. package/dist/__tests__/optimizer.test.d.ts +1 -0
  51. package/dist/__tests__/optimizer.test.js +149 -0
  52. package/dist/__tests__/parser.test.d.ts +1 -0
  53. package/dist/__tests__/parser.test.js +807 -0
  54. package/dist/__tests__/repl.test.d.ts +1 -0
  55. package/dist/__tests__/repl.test.js +27 -0
  56. package/dist/__tests__/runtime.test.d.ts +1 -0
  57. package/dist/__tests__/runtime.test.js +289 -0
  58. package/dist/__tests__/stdlib-advanced.test.d.ts +4 -0
  59. package/dist/__tests__/stdlib-advanced.test.js +378 -0
  60. package/dist/__tests__/stdlib-bigint.test.d.ts +7 -0
  61. package/dist/__tests__/stdlib-bigint.test.js +428 -0
  62. package/dist/__tests__/stdlib-math.test.d.ts +7 -0
  63. package/dist/__tests__/stdlib-math.test.js +352 -0
  64. package/dist/__tests__/stdlib-vec.test.d.ts +4 -0
  65. package/dist/__tests__/stdlib-vec.test.js +264 -0
  66. package/dist/__tests__/structure-optimizer.test.d.ts +1 -0
  67. package/dist/__tests__/structure-optimizer.test.js +33 -0
  68. package/dist/__tests__/typechecker.test.d.ts +1 -0
  69. package/dist/__tests__/typechecker.test.js +552 -0
  70. package/dist/__tests__/var-allocator.test.d.ts +1 -0
  71. package/dist/__tests__/var-allocator.test.js +69 -0
  72. package/dist/ast/types.d.ts +514 -0
  73. package/dist/ast/types.js +9 -0
  74. package/dist/builtins/metadata.d.ts +36 -0
  75. package/dist/builtins/metadata.js +1014 -0
  76. package/dist/cli.d.ts +11 -0
  77. package/dist/cli.js +0 -0
  78. package/dist/codegen/cmdblock/index.d.ts +26 -0
  79. package/dist/codegen/cmdblock/index.js +45 -0
  80. package/dist/codegen/mcfunction/index.d.ts +40 -0
  81. package/dist/codegen/mcfunction/index.js +606 -0
  82. package/dist/codegen/structure/index.d.ts +24 -0
  83. package/dist/codegen/structure/index.js +279 -0
  84. package/dist/codegen/var-allocator.d.ts +45 -0
  85. package/dist/codegen/var-allocator.js +104 -0
  86. package/dist/compile.d.ts +68 -0
  87. package/dist/data/arena/function/__load.mcfunction +6 -0
  88. package/dist/data/arena/function/__tick.mcfunction +2 -0
  89. package/dist/data/arena/function/announce_leaders/else_1.mcfunction +3 -0
  90. package/dist/data/arena/function/announce_leaders/foreach_0/merge_2.mcfunction +1 -0
  91. package/dist/data/arena/function/announce_leaders/foreach_0/then_0.mcfunction +3 -0
  92. package/dist/data/arena/function/announce_leaders/foreach_0.mcfunction +7 -0
  93. package/dist/data/arena/function/announce_leaders/foreach_1/merge_2.mcfunction +1 -0
  94. package/dist/data/arena/function/announce_leaders/foreach_1/then_0.mcfunction +4 -0
  95. package/dist/data/arena/function/announce_leaders/foreach_1.mcfunction +6 -0
  96. package/dist/data/arena/function/announce_leaders/merge_2.mcfunction +1 -0
  97. package/dist/data/arena/function/announce_leaders/then_0.mcfunction +4 -0
  98. package/dist/data/arena/function/announce_leaders.mcfunction +6 -0
  99. package/dist/data/arena/function/arena_tick/merge_2.mcfunction +1 -0
  100. package/dist/data/arena/function/arena_tick/then_0.mcfunction +4 -0
  101. package/dist/data/arena/function/arena_tick.mcfunction +11 -0
  102. package/dist/data/capture_the_flag/function/add_to_team.mcfunction +5 -0
  103. package/dist/data/capture_the_flag/function/angry_at.mcfunction +1 -0
  104. package/dist/data/capture_the_flag/function/assign_teams.mcfunction +1 -0
  105. package/dist/data/capture_the_flag/function/assign_teams__foreach_t1.mcfunction +8 -0
  106. package/dist/data/capture_the_flag/function/assign_teams__foreach_t1__else_2.mcfunction +8 -0
  107. package/dist/data/capture_the_flag/function/assign_teams__foreach_t1__merge_1.mcfunction +3 -0
  108. package/dist/data/capture_the_flag/function/assign_teams__foreach_t1__then_0.mcfunction +8 -0
  109. package/dist/data/capture_the_flag/function/barrier_wall.mcfunction +1 -0
  110. package/dist/data/capture_the_flag/function/buff_all.mcfunction +22 -0
  111. package/dist/data/capture_the_flag/function/check_flag_capture.mcfunction +2 -0
  112. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t0.mcfunction +8 -0
  113. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t0__merge_1.mcfunction +1 -0
  114. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t0__then_0.mcfunction +7 -0
  115. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t1.mcfunction +8 -0
  116. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t1__merge_1.mcfunction +1 -0
  117. package/dist/data/capture_the_flag/function/check_flag_capture__foreach_t1__then_0.mcfunction +7 -0
  118. package/dist/data/capture_the_flag/function/check_flag_pickup.mcfunction +2 -0
  119. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t0.mcfunction +8 -0
  120. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t0__merge_1.mcfunction +1 -0
  121. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t0__then_0.mcfunction +7 -0
  122. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t1.mcfunction +8 -0
  123. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t1__merge_1.mcfunction +1 -0
  124. package/dist/data/capture_the_flag/function/check_flag_pickup__foreach_t1__then_0.mcfunction +7 -0
  125. package/dist/data/capture_the_flag/function/check_win.mcfunction +4 -0
  126. package/dist/data/capture_the_flag/function/cleanup_teams.mcfunction +8 -0
  127. package/dist/data/capture_the_flag/function/clear_area.mcfunction +1 -0
  128. package/dist/data/capture_the_flag/function/clear_effect.mcfunction +1 -0
  129. package/dist/data/capture_the_flag/function/clear_effects.mcfunction +1 -0
  130. package/dist/data/capture_the_flag/function/clear_inventory.mcfunction +1 -0
  131. package/dist/data/capture_the_flag/function/create_blue_team.mcfunction +10 -0
  132. package/dist/data/capture_the_flag/function/create_green_team.mcfunction +10 -0
  133. package/dist/data/capture_the_flag/function/create_red_team.mcfunction +10 -0
  134. package/dist/data/capture_the_flag/function/create_team.mcfunction +8 -0
  135. package/dist/data/capture_the_flag/function/create_yellow_team.mcfunction +10 -0
  136. package/dist/data/capture_the_flag/function/disable_fire_spread.mcfunction +1 -0
  137. package/dist/data/capture_the_flag/function/disable_keep_inventory.mcfunction +1 -0
  138. package/dist/data/capture_the_flag/function/disable_mob_griefing.mcfunction +1 -0
  139. package/dist/data/capture_the_flag/function/distance_to.mcfunction +6 -0
  140. package/dist/data/capture_the_flag/function/distance_to__const_0_0_0_0.mcfunction +5 -0
  141. package/dist/data/capture_the_flag/function/enable_keep_inventory.mcfunction +1 -0
  142. package/dist/data/capture_the_flag/function/end_game.mcfunction +6 -0
  143. package/dist/data/capture_the_flag/function/end_game__else_2.mcfunction +3 -0
  144. package/dist/data/capture_the_flag/function/end_game__foreach_t7.mcfunction +2 -0
  145. package/dist/data/capture_the_flag/function/end_game__merge_1.mcfunction +1 -0
  146. package/dist/data/capture_the_flag/function/end_game__then_0.mcfunction +3 -0
  147. package/dist/data/capture_the_flag/function/end_sparkles_at.mcfunction +1 -0
  148. package/dist/data/capture_the_flag/function/explosion_effect.mcfunction +1 -0
  149. package/dist/data/capture_the_flag/function/flames.mcfunction +1 -0
  150. package/dist/data/capture_the_flag/function/game_tick.mcfunction +1 -0
  151. package/dist/data/capture_the_flag/function/give_kit_archer.mcfunction +6 -0
  152. package/dist/data/capture_the_flag/function/give_kit_mage.mcfunction +5 -0
  153. package/dist/data/capture_the_flag/function/give_kit_warrior.mcfunction +6 -0
  154. package/dist/data/capture_the_flag/function/glass_box.mcfunction +2 -0
  155. package/dist/data/capture_the_flag/function/glow.mcfunction +1 -0
  156. package/dist/data/capture_the_flag/function/happy_at.mcfunction +1 -0
  157. package/dist/data/capture_the_flag/function/hearts_at.mcfunction +1 -0
  158. package/dist/data/capture_the_flag/function/init.mcfunction +11 -0
  159. package/dist/data/capture_the_flag/function/invisible.mcfunction +1 -0
  160. package/dist/data/capture_the_flag/function/jump.mcfunction +1 -0
  161. package/dist/data/capture_the_flag/function/load.mcfunction +1 -0
  162. package/dist/data/capture_the_flag/function/night_vision.mcfunction +1 -0
  163. package/dist/data/capture_the_flag/function/place_flags.mcfunction +2 -0
  164. package/dist/data/capture_the_flag/function/portal_effect.mcfunction +1 -0
  165. package/dist/data/capture_the_flag/function/regen.mcfunction +1 -0
  166. package/dist/data/capture_the_flag/function/remove_from_teams.mcfunction +3 -0
  167. package/dist/data/capture_the_flag/function/remove_item.mcfunction +1 -0
  168. package/dist/data/capture_the_flag/function/resistance.mcfunction +1 -0
  169. package/dist/data/capture_the_flag/function/set_day.mcfunction +1 -0
  170. package/dist/data/capture_the_flag/function/set_easy.mcfunction +1 -0
  171. package/dist/data/capture_the_flag/function/set_hard.mcfunction +1 -0
  172. package/dist/data/capture_the_flag/function/set_midnight.mcfunction +1 -0
  173. package/dist/data/capture_the_flag/function/set_night.mcfunction +1 -0
  174. package/dist/data/capture_the_flag/function/set_noon.mcfunction +1 -0
  175. package/dist/data/capture_the_flag/function/set_normal.mcfunction +1 -0
  176. package/dist/data/capture_the_flag/function/set_peaceful.mcfunction +1 -0
  177. package/dist/data/capture_the_flag/function/setup_four_teams.mcfunction +4 -0
  178. package/dist/data/capture_the_flag/function/setup_two_teams.mcfunction +2 -0
  179. package/dist/data/capture_the_flag/function/slow_fall.mcfunction +1 -0
  180. package/dist/data/capture_the_flag/function/smoke.mcfunction +1 -0
  181. package/dist/data/capture_the_flag/function/sparkles_at.mcfunction +1 -0
  182. package/dist/data/capture_the_flag/function/speed.mcfunction +1 -0
  183. package/dist/data/capture_the_flag/function/start_game.mcfunction +15 -0
  184. package/dist/data/capture_the_flag/function/start_game__foreach_t10.mcfunction +4 -0
  185. package/dist/data/capture_the_flag/function/strength.mcfunction +1 -0
  186. package/dist/data/capture_the_flag/function/totem_at.mcfunction +1 -0
  187. package/dist/data/capture_the_flag/function/weather_clear.mcfunction +1 -0
  188. package/dist/data/capture_the_flag/function/weather_rain.mcfunction +1 -0
  189. package/dist/data/capture_the_flag/function/weather_thunder.mcfunction +1 -0
  190. package/dist/data/counter/function/__load.mcfunction +5 -0
  191. package/dist/data/counter/function/__tick.mcfunction +2 -0
  192. package/dist/data/counter/function/counter_tick/merge_2.mcfunction +1 -0
  193. package/dist/data/counter/function/counter_tick/then_0.mcfunction +3 -0
  194. package/dist/data/counter/function/counter_tick.mcfunction +11 -0
  195. package/dist/data/gcd2/function/__load.mcfunction +3 -0
  196. package/dist/data/gcd2/function/abs/merge_2.mcfunction +3 -0
  197. package/dist/data/gcd2/function/abs/then_0.mcfunction +5 -0
  198. package/dist/data/gcd2/function/abs.mcfunction +7 -0
  199. package/dist/data/gcd2/function/gcd/loop_body_1.mcfunction +7 -0
  200. package/dist/data/gcd2/function/gcd/loop_check_0.mcfunction +5 -0
  201. package/dist/data/gcd2/function/gcd/loop_exit_2.mcfunction +3 -0
  202. package/dist/data/gcd2/function/gcd.mcfunction +14 -0
  203. package/dist/data/gcd3/function/__load.mcfunction +3 -0
  204. package/dist/data/gcd3/function/abs/merge_2.mcfunction +3 -0
  205. package/dist/data/gcd3/function/abs/then_0.mcfunction +5 -0
  206. package/dist/data/gcd3/function/abs.mcfunction +7 -0
  207. package/dist/data/gcd3/function/gcd/loop_body_1.mcfunction +7 -0
  208. package/dist/data/gcd3/function/gcd/loop_check_0.mcfunction +5 -0
  209. package/dist/data/gcd3/function/gcd/loop_exit_2.mcfunction +3 -0
  210. package/dist/data/gcd3/function/gcd.mcfunction +14 -0
  211. package/dist/data/gcd3/function/test.mcfunction +7 -0
  212. package/dist/data/gcd3nm/function/__load.mcfunction +3 -0
  213. package/dist/data/gcd3nm/function/abs/merge_2.mcfunction +3 -0
  214. package/dist/data/gcd3nm/function/abs/then_0.mcfunction +5 -0
  215. package/dist/data/gcd3nm/function/abs.mcfunction +7 -0
  216. package/dist/data/gcd3nm/function/gcd/loop_body_1.mcfunction +7 -0
  217. package/dist/data/gcd3nm/function/gcd/loop_check_0.mcfunction +5 -0
  218. package/dist/data/gcd3nm/function/gcd/loop_exit_2.mcfunction +3 -0
  219. package/dist/data/gcd3nm/function/gcd.mcfunction +14 -0
  220. package/dist/data/gcd3nm/function/test.mcfunction +7 -0
  221. package/dist/data/gcd_test/function/__load.mcfunction +3 -0
  222. package/dist/data/gcd_test/function/abs/merge_2.mcfunction +3 -0
  223. package/dist/data/gcd_test/function/abs/then_0.mcfunction +5 -0
  224. package/dist/data/gcd_test/function/abs.mcfunction +7 -0
  225. package/dist/data/gcd_test/function/gcd/loop_body_1.mcfunction +7 -0
  226. package/dist/data/gcd_test/function/gcd/loop_check_0.mcfunction +5 -0
  227. package/dist/data/gcd_test/function/gcd/loop_exit_2.mcfunction +3 -0
  228. package/dist/data/gcd_test/function/gcd.mcfunction +14 -0
  229. package/dist/data/hunger_games/function/angry_at.mcfunction +1 -0
  230. package/dist/data/hunger_games/function/barrier_wall.mcfunction +1 -0
  231. package/dist/data/hunger_games/function/buff_all.mcfunction +22 -0
  232. package/dist/data/hunger_games/function/check_alive.mcfunction +3 -0
  233. package/dist/data/hunger_games/function/check_alive__foreach_t3.mcfunction +10 -0
  234. package/dist/data/hunger_games/function/check_alive__foreach_t3__merge_1.mcfunction +1 -0
  235. package/dist/data/hunger_games/function/check_alive__foreach_t3__then_0.mcfunction +5 -0
  236. package/dist/data/hunger_games/function/check_border_damage.mcfunction +1 -0
  237. package/dist/data/hunger_games/function/check_border_damage__foreach_t0.mcfunction +1 -0
  238. package/dist/data/hunger_games/function/clear_area.mcfunction +1 -0
  239. package/dist/data/hunger_games/function/clear_effect.mcfunction +1 -0
  240. package/dist/data/hunger_games/function/clear_effects.mcfunction +1 -0
  241. package/dist/data/hunger_games/function/countdown_tick.mcfunction +1 -0
  242. package/dist/data/hunger_games/function/create_health_bar.mcfunction +24 -0
  243. package/dist/data/hunger_games/function/create_progress_bar.mcfunction +24 -0
  244. package/dist/data/hunger_games/function/create_progress_bar__const_0_0_0.mcfunction +21 -0
  245. package/dist/data/hunger_games/function/create_timer_bar.mcfunction +30 -0
  246. package/dist/data/hunger_games/function/declare_winner.mcfunction +13 -0
  247. package/dist/data/hunger_games/function/disable_fire_spread.mcfunction +1 -0
  248. package/dist/data/hunger_games/function/disable_keep_inventory.mcfunction +1 -0
  249. package/dist/data/hunger_games/function/disable_mob_griefing.mcfunction +1 -0
  250. package/dist/data/hunger_games/function/enable_keep_inventory.mcfunction +1 -0
  251. package/dist/data/hunger_games/function/end_game_no_winner.mcfunction +3 -0
  252. package/dist/data/hunger_games/function/end_sparkles_at.mcfunction +1 -0
  253. package/dist/data/hunger_games/function/explosion_effect.mcfunction +1 -0
  254. package/dist/data/hunger_games/function/flames.mcfunction +1 -0
  255. package/dist/data/hunger_games/function/game_tick.mcfunction +1 -0
  256. package/dist/data/hunger_games/function/glass_box.mcfunction +2 -0
  257. package/dist/data/hunger_games/function/glow.mcfunction +1 -0
  258. package/dist/data/hunger_games/function/happy_at.mcfunction +1 -0
  259. package/dist/data/hunger_games/function/hearts_at.mcfunction +1 -0
  260. package/dist/data/hunger_games/function/hide_bar.mcfunction +4 -0
  261. package/dist/data/hunger_games/function/init.mcfunction +7 -0
  262. package/dist/data/hunger_games/function/invisible.mcfunction +1 -0
  263. package/dist/data/hunger_games/function/jump.mcfunction +1 -0
  264. package/dist/data/hunger_games/function/load.mcfunction +1 -0
  265. package/dist/data/hunger_games/function/main_game_tick.mcfunction +4 -0
  266. package/dist/data/hunger_games/function/night_vision.mcfunction +1 -0
  267. package/dist/data/hunger_games/function/on_player_death.mcfunction +14 -0
  268. package/dist/data/hunger_games/function/portal_effect.mcfunction +1 -0
  269. package/dist/data/hunger_games/function/regen.mcfunction +1 -0
  270. package/dist/data/hunger_games/function/remove_bar.mcfunction +3 -0
  271. package/dist/data/hunger_games/function/remove_bar__const_0.mcfunction +2 -0
  272. package/dist/data/hunger_games/function/reset_game.mcfunction +3 -0
  273. package/dist/data/hunger_games/function/reset_game__foreach_t0.mcfunction +9 -0
  274. package/dist/data/hunger_games/function/resistance.mcfunction +1 -0
  275. package/dist/data/hunger_games/function/set_day.mcfunction +1 -0
  276. package/dist/data/hunger_games/function/set_easy.mcfunction +1 -0
  277. package/dist/data/hunger_games/function/set_hard.mcfunction +1 -0
  278. package/dist/data/hunger_games/function/set_midnight.mcfunction +1 -0
  279. package/dist/data/hunger_games/function/set_night.mcfunction +1 -0
  280. package/dist/data/hunger_games/function/set_noon.mcfunction +1 -0
  281. package/dist/data/hunger_games/function/set_normal.mcfunction +1 -0
  282. package/dist/data/hunger_games/function/set_peaceful.mcfunction +1 -0
  283. package/dist/data/hunger_games/function/show_bar.mcfunction +4 -0
  284. package/dist/data/hunger_games/function/shrink_border.mcfunction +1 -0
  285. package/dist/data/hunger_games/function/slow_fall.mcfunction +1 -0
  286. package/dist/data/hunger_games/function/smoke.mcfunction +1 -0
  287. package/dist/data/hunger_games/function/sparkles_at.mcfunction +1 -0
  288. package/dist/data/hunger_games/function/speed.mcfunction +1 -0
  289. package/dist/data/hunger_games/function/start_countdown.mcfunction +3 -0
  290. package/dist/data/hunger_games/function/start_countdown__foreach_t0.mcfunction +16 -0
  291. package/dist/data/hunger_games/function/start_game.mcfunction +4 -0
  292. package/dist/data/hunger_games/function/start_game__foreach_t3.mcfunction +4 -0
  293. package/dist/data/hunger_games/function/strength.mcfunction +1 -0
  294. package/dist/data/hunger_games/function/totem_at.mcfunction +1 -0
  295. package/dist/data/hunger_games/function/update_bar.mcfunction +5 -0
  296. package/dist/data/hunger_games/function/update_bar__const_0_0.mcfunction +3 -0
  297. package/dist/data/hunger_games/function/update_bar_color.mcfunction +7 -0
  298. package/dist/data/hunger_games/function/update_bar_color__else_2.mcfunction +5 -0
  299. package/dist/data/hunger_games/function/update_bar_color__else_5.mcfunction +4 -0
  300. package/dist/data/hunger_games/function/update_bar_color__merge_1.mcfunction +1 -0
  301. package/dist/data/hunger_games/function/update_bar_color__merge_4.mcfunction +1 -0
  302. package/dist/data/hunger_games/function/update_bar_color__then_0.mcfunction +4 -0
  303. package/dist/data/hunger_games/function/update_bar_color__then_3.mcfunction +4 -0
  304. package/dist/data/hunger_games/function/weather_clear.mcfunction +1 -0
  305. package/dist/data/hunger_games/function/weather_rain.mcfunction +1 -0
  306. package/dist/data/hunger_games/function/weather_thunder.mcfunction +1 -0
  307. package/dist/data/isqrttest/function/__load.mcfunction +6 -0
  308. package/dist/data/isqrttest/function/isqrt/loop_body_4.mcfunction +12 -0
  309. package/dist/data/isqrttest/function/isqrt/loop_check_3.mcfunction +5 -0
  310. package/dist/data/isqrttest/function/isqrt/loop_exit_5.mcfunction +3 -0
  311. package/dist/data/isqrttest/function/isqrt/merge_2.mcfunction +4 -0
  312. package/dist/data/isqrttest/function/isqrt/merge_8.mcfunction +6 -0
  313. package/dist/data/isqrttest/function/isqrt/then_0.mcfunction +3 -0
  314. package/dist/data/isqrttest/function/isqrt/then_6.mcfunction +3 -0
  315. package/dist/data/isqrttest/function/isqrt.mcfunction +7 -0
  316. package/dist/data/isqrttest/function/test.mcfunction +6 -0
  317. package/dist/data/linalg/function/_vec2d_len_sq_fx.mcfunction +17 -0
  318. package/dist/data/linalg/function/_vec3d_len_sq_fx.mcfunction +27 -0
  319. package/dist/data/linalg/function/load.mcfunction +1 -0
  320. package/dist/data/linalg/function/mat2d_det.mcfunction +16 -0
  321. package/dist/data/linalg/function/mat2d_mul_r0c0.mcfunction +16 -0
  322. package/dist/data/linalg/function/mat2d_mul_r0c1.mcfunction +16 -0
  323. package/dist/data/linalg/function/mat2d_mul_r1c0.mcfunction +16 -0
  324. package/dist/data/linalg/function/mat2d_mul_r1c1.mcfunction +16 -0
  325. package/dist/data/linalg/function/mat2d_vecmul_x.mcfunction +16 -0
  326. package/dist/data/linalg/function/mat2d_vecmul_y.mcfunction +16 -0
  327. package/dist/data/linalg/function/solve2d_x.mcfunction +27 -0
  328. package/dist/data/linalg/function/solve2d_y.mcfunction +27 -0
  329. package/dist/data/linalg/function/vec2d_dist.mcfunction +15 -0
  330. package/dist/data/linalg/function/vec2d_dot.mcfunction +16 -0
  331. package/dist/data/linalg/function/vec2d_length.mcfunction +21 -0
  332. package/dist/data/linalg/function/vec2d_normalize_x.mcfunction +8 -0
  333. package/dist/data/linalg/function/vec2d_normalize_x__merge_1.mcfunction +10 -0
  334. package/dist/data/linalg/function/vec2d_normalize_x__then_0.mcfunction +3 -0
  335. package/dist/data/linalg/function/vec2d_normalize_y.mcfunction +8 -0
  336. package/dist/data/linalg/function/vec2d_normalize_y__merge_1.mcfunction +10 -0
  337. package/dist/data/linalg/function/vec2d_normalize_y__then_0.mcfunction +3 -0
  338. package/dist/data/linalg/function/vec3d_cross_x.mcfunction +16 -0
  339. package/dist/data/linalg/function/vec3d_cross_y.mcfunction +16 -0
  340. package/dist/data/linalg/function/vec3d_cross_z.mcfunction +16 -0
  341. package/dist/data/linalg/function/vec3d_dist.mcfunction +21 -0
  342. package/dist/data/linalg/function/vec3d_dot.mcfunction +26 -0
  343. package/dist/data/linalg/function/vec3d_length.mcfunction +31 -0
  344. package/dist/data/linalg/function/vec3d_normalize_x.mcfunction +9 -0
  345. package/dist/data/linalg/function/vec3d_normalize_x__merge_1.mcfunction +11 -0
  346. package/dist/data/linalg/function/vec3d_normalize_x__then_0.mcfunction +3 -0
  347. package/dist/data/linalg/function/vec3d_normalize_y.mcfunction +9 -0
  348. package/dist/data/linalg/function/vec3d_normalize_y__merge_1.mcfunction +11 -0
  349. package/dist/data/linalg/function/vec3d_normalize_y__then_0.mcfunction +3 -0
  350. package/dist/data/linalg/function/vec3d_normalize_z.mcfunction +9 -0
  351. package/dist/data/linalg/function/vec3d_normalize_z__merge_1.mcfunction +11 -0
  352. package/dist/data/linalg/function/vec3d_normalize_z__then_0.mcfunction +3 -0
  353. package/dist/data/macrotest/function/get_element.mcfunction +2 -0
  354. package/dist/data/macrotest/function/load.mcfunction +1 -0
  355. package/dist/data/macrotest/function/test_dynamic_index.mcfunction +2 -0
  356. package/dist/data/math_hp/function/cos_hp.mcfunction +8 -0
  357. package/dist/data/math_hp/function/div3_hp.mcfunction +23 -0
  358. package/dist/data/math_hp/function/div_hp.mcfunction +13 -0
  359. package/dist/data/math_hp/function/init_div.mcfunction +1 -0
  360. package/dist/data/math_hp/function/init_trig.mcfunction +1 -0
  361. package/dist/data/math_hp/function/ln_5term.mcfunction +6 -0
  362. package/dist/data/math_hp/function/ln_5term__loop_body_1.mcfunction +8 -0
  363. package/dist/data/math_hp/function/ln_5term__loop_body_4.mcfunction +8 -0
  364. package/dist/data/math_hp/function/ln_5term__loop_exit_2.mcfunction +1 -0
  365. package/dist/data/math_hp/function/ln_5term__loop_exit_5.mcfunction +61 -0
  366. package/dist/data/math_hp/function/ln_5term__loop_header_0.mcfunction +3 -0
  367. package/dist/data/math_hp/function/ln_5term__loop_header_3.mcfunction +6 -0
  368. package/dist/data/math_hp/function/load.mcfunction +1 -0
  369. package/dist/data/math_hp/function/norm3_hp.mcfunction +43 -0
  370. package/dist/data/math_hp/function/sin_hp.mcfunction +8 -0
  371. package/dist/data/math_hp/function/sqrt_hp.mcfunction +17 -0
  372. package/dist/data/math_hp/function/sqrt_hp__merge_1.mcfunction +21 -0
  373. package/dist/data/math_hp/function/sqrt_hp__then_0.mcfunction +2 -0
  374. package/dist/data/mathdemo/function/__load.mcfunction +2 -0
  375. package/dist/data/mathdemo/function/_atan_init.mcfunction +4 -0
  376. package/dist/data/mathdemo/function/_math_init.mcfunction +4 -0
  377. package/dist/data/mathdemo/function/add2d_x.mcfunction +5 -0
  378. package/dist/data/mathdemo/function/add2d_y.mcfunction +5 -0
  379. package/dist/data/mathdemo/function/add3d_x.mcfunction +5 -0
  380. package/dist/data/mathdemo/function/add3d_y.mcfunction +5 -0
  381. package/dist/data/mathdemo/function/add3d_z.mcfunction +5 -0
  382. package/dist/data/mathdemo/function/air_drag_fx.mcfunction +2 -0
  383. package/dist/data/mathdemo/function/apply_drag.mcfunction +8 -0
  384. package/dist/data/mathdemo/function/apply_gravity.mcfunction +6 -0
  385. package/dist/data/mathdemo/function/approx_eq.mcfunction +10 -0
  386. package/dist/data/mathdemo/function/approx_eq__merge_1.mcfunction +3 -0
  387. package/dist/data/mathdemo/function/approx_eq__merge_3.mcfunction +2 -0
  388. package/dist/data/mathdemo/function/approx_eq__then_0.mcfunction +4 -0
  389. package/dist/data/mathdemo/function/approx_eq__then_2.mcfunction +2 -0
  390. package/dist/data/mathdemo/function/atan2_fixed.mcfunction +6 -0
  391. package/dist/data/mathdemo/function/atan2_fixed__else_30.mcfunction +2 -0
  392. package/dist/data/mathdemo/function/atan2_fixed__loop_body_26.mcfunction +21 -0
  393. package/dist/data/mathdemo/function/atan2_fixed__loop_exit_27.mcfunction +5 -0
  394. package/dist/data/mathdemo/function/atan2_fixed__loop_header_25.mcfunction +3 -0
  395. package/dist/data/mathdemo/function/atan2_fixed__merge_1.mcfunction +4 -0
  396. package/dist/data/mathdemo/function/atan2_fixed__merge_10.mcfunction +5 -0
  397. package/dist/data/mathdemo/function/atan2_fixed__merge_12.mcfunction +2 -0
  398. package/dist/data/mathdemo/function/atan2_fixed__merge_16.mcfunction +5 -0
  399. package/dist/data/mathdemo/function/atan2_fixed__merge_18.mcfunction +4 -0
  400. package/dist/data/mathdemo/function/atan2_fixed__merge_20.mcfunction +4 -0
  401. package/dist/data/mathdemo/function/atan2_fixed__merge_22.mcfunction +4 -0
  402. package/dist/data/mathdemo/function/atan2_fixed__merge_24.mcfunction +3 -0
  403. package/dist/data/mathdemo/function/atan2_fixed__merge_29.mcfunction +1 -0
  404. package/dist/data/mathdemo/function/atan2_fixed__merge_3.mcfunction +4 -0
  405. package/dist/data/mathdemo/function/atan2_fixed__merge_32.mcfunction +4 -0
  406. package/dist/data/mathdemo/function/atan2_fixed__merge_34.mcfunction +4 -0
  407. package/dist/data/mathdemo/function/atan2_fixed__merge_36.mcfunction +3 -0
  408. package/dist/data/mathdemo/function/atan2_fixed__merge_40.mcfunction +3 -0
  409. package/dist/data/mathdemo/function/atan2_fixed__merge_6.mcfunction +2 -0
  410. package/dist/data/mathdemo/function/atan2_fixed__then_0.mcfunction +4 -0
  411. package/dist/data/mathdemo/function/atan2_fixed__then_11.mcfunction +2 -0
  412. package/dist/data/mathdemo/function/atan2_fixed__then_15.mcfunction +4 -0
  413. package/dist/data/mathdemo/function/atan2_fixed__then_17.mcfunction +4 -0
  414. package/dist/data/mathdemo/function/atan2_fixed__then_19.mcfunction +2 -0
  415. package/dist/data/mathdemo/function/atan2_fixed__then_2.mcfunction +2 -0
  416. package/dist/data/mathdemo/function/atan2_fixed__then_21.mcfunction +2 -0
  417. package/dist/data/mathdemo/function/atan2_fixed__then_23.mcfunction +5 -0
  418. package/dist/data/mathdemo/function/atan2_fixed__then_28.mcfunction +4 -0
  419. package/dist/data/mathdemo/function/atan2_fixed__then_31.mcfunction +4 -0
  420. package/dist/data/mathdemo/function/atan2_fixed__then_33.mcfunction +4 -0
  421. package/dist/data/mathdemo/function/atan2_fixed__then_35.mcfunction +1 -0
  422. package/dist/data/mathdemo/function/atan2_fixed__then_39.mcfunction +3 -0
  423. package/dist/data/mathdemo/function/atan2_fixed__then_5.mcfunction +2 -0
  424. package/dist/data/mathdemo/function/atan2_fixed__then_9.mcfunction +4 -0
  425. package/dist/data/mathdemo/function/bounce_v.mcfunction +10 -0
  426. package/dist/data/mathdemo/function/cbrt_fx.mcfunction +5 -0
  427. package/dist/data/mathdemo/function/cbrt_fx__loop_body_6.mcfunction +7 -0
  428. package/dist/data/mathdemo/function/cbrt_fx__loop_exit_7.mcfunction +1 -0
  429. package/dist/data/mathdemo/function/cbrt_fx__loop_header_5.mcfunction +4 -0
  430. package/dist/data/mathdemo/function/cbrt_fx__merge_1.mcfunction +8 -0
  431. package/dist/data/mathdemo/function/cbrt_fx__merge_11.mcfunction +5 -0
  432. package/dist/data/mathdemo/function/cbrt_fx__merge_13.mcfunction +4 -0
  433. package/dist/data/mathdemo/function/cbrt_fx__merge_4.mcfunction +2 -0
  434. package/dist/data/mathdemo/function/cbrt_fx__merge_9.mcfunction +13 -0
  435. package/dist/data/mathdemo/function/cbrt_fx__then_0.mcfunction +2 -0
  436. package/dist/data/mathdemo/function/cbrt_fx__then_10.mcfunction +2 -0
  437. package/dist/data/mathdemo/function/cbrt_fx__then_12.mcfunction +2 -0
  438. package/dist/data/mathdemo/function/cbrt_fx__then_3.mcfunction +2 -0
  439. package/dist/data/mathdemo/function/cbrt_fx__then_8.mcfunction +2 -0
  440. package/dist/data/mathdemo/function/ceil_div.mcfunction +9 -0
  441. package/dist/data/mathdemo/function/chebyshev.mcfunction +14 -0
  442. package/dist/data/mathdemo/function/chebyshev3d.mcfunction +19 -0
  443. package/dist/data/mathdemo/function/chebyshev3d__merge_1.mcfunction +4 -0
  444. package/dist/data/mathdemo/function/chebyshev3d__merge_3.mcfunction +4 -0
  445. package/dist/data/mathdemo/function/chebyshev3d__merge_5.mcfunction +4 -0
  446. package/dist/data/mathdemo/function/chebyshev3d__merge_7.mcfunction +3 -0
  447. package/dist/data/mathdemo/function/chebyshev3d__merge_9.mcfunction +1 -0
  448. package/dist/data/mathdemo/function/chebyshev3d__then_0.mcfunction +4 -0
  449. package/dist/data/mathdemo/function/chebyshev3d__then_2.mcfunction +4 -0
  450. package/dist/data/mathdemo/function/chebyshev3d__then_4.mcfunction +4 -0
  451. package/dist/data/mathdemo/function/chebyshev3d__then_6.mcfunction +2 -0
  452. package/dist/data/mathdemo/function/chebyshev3d__then_8.mcfunction +2 -0
  453. package/dist/data/mathdemo/function/chebyshev__merge_1.mcfunction +4 -0
  454. package/dist/data/mathdemo/function/chebyshev__merge_3.mcfunction +3 -0
  455. package/dist/data/mathdemo/function/chebyshev__merge_5.mcfunction +1 -0
  456. package/dist/data/mathdemo/function/chebyshev__then_0.mcfunction +4 -0
  457. package/dist/data/mathdemo/function/chebyshev__then_2.mcfunction +4 -0
  458. package/dist/data/mathdemo/function/chebyshev__then_4.mcfunction +1 -0
  459. package/dist/data/mathdemo/function/circular_x.mcfunction +14 -0
  460. package/dist/data/mathdemo/function/circular_z.mcfunction +14 -0
  461. package/dist/data/mathdemo/function/clamp_velocity.mcfunction +5 -0
  462. package/dist/data/mathdemo/function/clamp_velocity__merge_1.mcfunction +5 -0
  463. package/dist/data/mathdemo/function/clamp_velocity__merge_4.mcfunction +1 -0
  464. package/dist/data/mathdemo/function/clamp_velocity__then_0.mcfunction +1 -0
  465. package/dist/data/mathdemo/function/clamp_velocity__then_3.mcfunction +3 -0
  466. package/dist/data/mathdemo/function/combinations.mcfunction +6 -0
  467. package/dist/data/mathdemo/function/combinations__loop_body_9.mcfunction +15 -0
  468. package/dist/data/mathdemo/function/combinations__loop_exit_10.mcfunction +1 -0
  469. package/dist/data/mathdemo/function/combinations__loop_header_8.mcfunction +3 -0
  470. package/dist/data/mathdemo/function/combinations__merge_1.mcfunction +3 -0
  471. package/dist/data/mathdemo/function/combinations__merge_4.mcfunction +6 -0
  472. package/dist/data/mathdemo/function/combinations__merge_7.mcfunction +3 -0
  473. package/dist/data/mathdemo/function/combinations__then_0.mcfunction +2 -0
  474. package/dist/data/mathdemo/function/combinations__then_3.mcfunction +2 -0
  475. package/dist/data/mathdemo/function/combinations__then_6.mcfunction +4 -0
  476. package/dist/data/mathdemo/function/cos_fixed.mcfunction +7 -0
  477. package/dist/data/mathdemo/function/cross2d.mcfunction +11 -0
  478. package/dist/data/mathdemo/function/cross3d_x.mcfunction +11 -0
  479. package/dist/data/mathdemo/function/cross3d_y.mcfunction +11 -0
  480. package/dist/data/mathdemo/function/cross3d_z.mcfunction +11 -0
  481. package/dist/data/mathdemo/function/demo_easing.mcfunction +12 -0
  482. package/dist/data/mathdemo/function/demo_math.mcfunction +16 -0
  483. package/dist/data/mathdemo/function/demo_noise.mcfunction +14 -0
  484. package/dist/data/mathdemo/function/demo_physics.mcfunction +11 -0
  485. package/dist/data/mathdemo/function/demo_physics__loop_body_1.mcfunction +9 -0
  486. package/dist/data/mathdemo/function/demo_physics__loop_body_4.mcfunction +18 -0
  487. package/dist/data/mathdemo/function/demo_physics__loop_exit_2.mcfunction +6 -0
  488. package/dist/data/mathdemo/function/demo_physics__loop_exit_5.mcfunction +1 -0
  489. package/dist/data/mathdemo/function/demo_physics__loop_header_0.mcfunction +4 -0
  490. package/dist/data/mathdemo/function/demo_physics__loop_header_3.mcfunction +4 -0
  491. package/dist/data/mathdemo/function/distance2d_fixed.mcfunction +13 -0
  492. package/dist/data/mathdemo/function/distance3d_fixed.mcfunction +18 -0
  493. package/dist/data/mathdemo/function/divfix.mcfunction +6 -0
  494. package/dist/data/mathdemo/function/divfix__merge_1.mcfunction +6 -0
  495. package/dist/data/mathdemo/function/divfix__then_0.mcfunction +2 -0
  496. package/dist/data/mathdemo/function/dot2d.mcfunction +11 -0
  497. package/dist/data/mathdemo/function/dot3d.mcfunction +17 -0
  498. package/dist/data/mathdemo/function/ease_in_back.mcfunction +26 -0
  499. package/dist/data/mathdemo/function/ease_in_bounce.mcfunction +9 -0
  500. package/dist/data/mathdemo/function/ease_in_cubic.mcfunction +12 -0
  501. package/dist/data/mathdemo/function/ease_in_expo.mcfunction +5 -0
  502. package/dist/data/mathdemo/function/ease_in_expo__merge_1.mcfunction +11 -0
  503. package/dist/data/mathdemo/function/ease_in_expo__then_0.mcfunction +2 -0
  504. package/dist/data/mathdemo/function/ease_in_out_back.mcfunction +5 -0
  505. package/dist/data/mathdemo/function/ease_in_out_back__merge_1.mcfunction +14 -0
  506. package/dist/data/mathdemo/function/ease_in_out_back__then_0.mcfunction +10 -0
  507. package/dist/data/mathdemo/function/ease_in_out_bounce.mcfunction +5 -0
  508. package/dist/data/mathdemo/function/ease_in_out_bounce__merge_1.mcfunction +14 -0
  509. package/dist/data/mathdemo/function/ease_in_out_bounce__then_0.mcfunction +10 -0
  510. package/dist/data/mathdemo/function/ease_in_out_cubic.mcfunction +5 -0
  511. package/dist/data/mathdemo/function/ease_in_out_cubic__merge_1.mcfunction +17 -0
  512. package/dist/data/mathdemo/function/ease_in_out_cubic__then_0.mcfunction +13 -0
  513. package/dist/data/mathdemo/function/ease_in_out_quad.mcfunction +5 -0
  514. package/dist/data/mathdemo/function/ease_in_out_quad__merge_1.mcfunction +12 -0
  515. package/dist/data/mathdemo/function/ease_in_out_quad__then_0.mcfunction +8 -0
  516. package/dist/data/mathdemo/function/ease_in_out_sine.mcfunction +5 -0
  517. package/dist/data/mathdemo/function/ease_in_out_sine__merge_1.mcfunction +14 -0
  518. package/dist/data/mathdemo/function/ease_in_out_sine__then_0.mcfunction +10 -0
  519. package/dist/data/mathdemo/function/ease_in_quad.mcfunction +7 -0
  520. package/dist/data/mathdemo/function/ease_in_quad__const_5000.mcfunction +5 -0
  521. package/dist/data/mathdemo/function/ease_in_quart.mcfunction +12 -0
  522. package/dist/data/mathdemo/function/ease_in_sine.mcfunction +30 -0
  523. package/dist/data/mathdemo/function/ease_linear.mcfunction +2 -0
  524. package/dist/data/mathdemo/function/ease_linear__const_5000.mcfunction +2 -0
  525. package/dist/data/mathdemo/function/ease_out_back.mcfunction +9 -0
  526. package/dist/data/mathdemo/function/ease_out_back__const_5000.mcfunction +7 -0
  527. package/dist/data/mathdemo/function/ease_out_bounce.mcfunction +6 -0
  528. package/dist/data/mathdemo/function/ease_out_bounce__merge_1.mcfunction +4 -0
  529. package/dist/data/mathdemo/function/ease_out_bounce__merge_4.mcfunction +4 -0
  530. package/dist/data/mathdemo/function/ease_out_bounce__merge_7.mcfunction +15 -0
  531. package/dist/data/mathdemo/function/ease_out_bounce__then_0.mcfunction +11 -0
  532. package/dist/data/mathdemo/function/ease_out_bounce__then_3.mcfunction +15 -0
  533. package/dist/data/mathdemo/function/ease_out_bounce__then_6.mcfunction +15 -0
  534. package/dist/data/mathdemo/function/ease_out_cubic.mcfunction +16 -0
  535. package/dist/data/mathdemo/function/ease_out_cubic__const_5000.mcfunction +14 -0
  536. package/dist/data/mathdemo/function/ease_out_expo.mcfunction +5 -0
  537. package/dist/data/mathdemo/function/ease_out_expo__merge_1.mcfunction +8 -0
  538. package/dist/data/mathdemo/function/ease_out_expo__then_0.mcfunction +2 -0
  539. package/dist/data/mathdemo/function/ease_out_quad.mcfunction +11 -0
  540. package/dist/data/mathdemo/function/ease_out_quart.mcfunction +16 -0
  541. package/dist/data/mathdemo/function/ease_out_sine.mcfunction +9 -0
  542. package/dist/data/mathdemo/function/ease_smooth.mcfunction +23 -0
  543. package/dist/data/mathdemo/function/ease_smoother.mcfunction +41 -0
  544. package/dist/data/mathdemo/function/exp_fx.mcfunction +16 -0
  545. package/dist/data/mathdemo/function/exp_fx__loop_body_10.mcfunction +8 -0
  546. package/dist/data/mathdemo/function/exp_fx__loop_body_5.mcfunction +8 -0
  547. package/dist/data/mathdemo/function/exp_fx__loop_exit_11.mcfunction +1 -0
  548. package/dist/data/mathdemo/function/exp_fx__loop_exit_6.mcfunction +1 -0
  549. package/dist/data/mathdemo/function/exp_fx__loop_header_4.mcfunction +3 -0
  550. package/dist/data/mathdemo/function/exp_fx__loop_header_9.mcfunction +3 -0
  551. package/dist/data/mathdemo/function/exp_fx__merge_1.mcfunction +47 -0
  552. package/dist/data/mathdemo/function/exp_fx__merge_3.mcfunction +4 -0
  553. package/dist/data/mathdemo/function/exp_fx__merge_8.mcfunction +1 -0
  554. package/dist/data/mathdemo/function/exp_fx__then_0.mcfunction +7 -0
  555. package/dist/data/mathdemo/function/exp_fx__then_2.mcfunction +2 -0
  556. package/dist/data/mathdemo/function/exp_fx__then_7.mcfunction +5 -0
  557. package/dist/data/mathdemo/function/factorial.mcfunction +5 -0
  558. package/dist/data/mathdemo/function/factorial__loop_body_4.mcfunction +7 -0
  559. package/dist/data/mathdemo/function/factorial__loop_exit_5.mcfunction +1 -0
  560. package/dist/data/mathdemo/function/factorial__loop_header_3.mcfunction +3 -0
  561. package/dist/data/mathdemo/function/factorial__merge_1.mcfunction +3 -0
  562. package/dist/data/mathdemo/function/factorial__then_0.mcfunction +2 -0
  563. package/dist/data/mathdemo/function/fbm_1d.mcfunction +9 -0
  564. package/dist/data/mathdemo/function/fbm_1d__loop_body_1.mcfunction +33 -0
  565. package/dist/data/mathdemo/function/fbm_1d__loop_exit_2.mcfunction +4 -0
  566. package/dist/data/mathdemo/function/fbm_1d__loop_header_0.mcfunction +3 -0
  567. package/dist/data/mathdemo/function/fbm_1d__merge_4.mcfunction +6 -0
  568. package/dist/data/mathdemo/function/fbm_1d__then_3.mcfunction +2 -0
  569. package/dist/data/mathdemo/function/fbm_2d.mcfunction +10 -0
  570. package/dist/data/mathdemo/function/fbm_2d__loop_body_1.mcfunction +39 -0
  571. package/dist/data/mathdemo/function/fbm_2d__loop_exit_2.mcfunction +4 -0
  572. package/dist/data/mathdemo/function/fbm_2d__loop_header_0.mcfunction +3 -0
  573. package/dist/data/mathdemo/function/fbm_2d__merge_4.mcfunction +6 -0
  574. package/dist/data/mathdemo/function/fbm_2d__then_3.mcfunction +2 -0
  575. package/dist/data/mathdemo/function/friction_decel.mcfunction +5 -0
  576. package/dist/data/mathdemo/function/friction_decel__merge_1.mcfunction +5 -0
  577. package/dist/data/mathdemo/function/friction_decel__merge_4.mcfunction +2 -0
  578. package/dist/data/mathdemo/function/friction_decel__then_0.mcfunction +3 -0
  579. package/dist/data/mathdemo/function/friction_decel__then_3.mcfunction +3 -0
  580. package/dist/data/mathdemo/function/gamma_int.mcfunction +5 -0
  581. package/dist/data/mathdemo/function/gamma_int__merge_1.mcfunction +6 -0
  582. package/dist/data/mathdemo/function/gamma_int__then_0.mcfunction +2 -0
  583. package/dist/data/mathdemo/function/gcd.mcfunction +7 -0
  584. package/dist/data/mathdemo/function/gcd__loop_body_5.mcfunction +5 -0
  585. package/dist/data/mathdemo/function/gcd__loop_exit_6.mcfunction +1 -0
  586. package/dist/data/mathdemo/function/gcd__loop_header_4.mcfunction +4 -0
  587. package/dist/data/mathdemo/function/gcd__merge_1.mcfunction +5 -0
  588. package/dist/data/mathdemo/function/gcd__merge_3.mcfunction +1 -0
  589. package/dist/data/mathdemo/function/gcd__then_0.mcfunction +4 -0
  590. package/dist/data/mathdemo/function/gcd__then_2.mcfunction +4 -0
  591. package/dist/data/mathdemo/function/gravity_fx.mcfunction +2 -0
  592. package/dist/data/mathdemo/function/hash_1d.mcfunction +15 -0
  593. package/dist/data/mathdemo/function/hash_1d_pos.mcfunction +9 -0
  594. package/dist/data/mathdemo/function/hash_1d_pos__merge_1.mcfunction +4 -0
  595. package/dist/data/mathdemo/function/hash_1d_pos__then_0.mcfunction +4 -0
  596. package/dist/data/mathdemo/function/hash_2d.mcfunction +11 -0
  597. package/dist/data/mathdemo/function/hash_2d_pos.mcfunction +11 -0
  598. package/dist/data/mathdemo/function/hash_2d_pos__merge_1.mcfunction +4 -0
  599. package/dist/data/mathdemo/function/hash_2d_pos__then_0.mcfunction +4 -0
  600. package/dist/data/mathdemo/function/impact_velocity.mcfunction +5 -0
  601. package/dist/data/mathdemo/function/impact_velocity__merge_1.mcfunction +16 -0
  602. package/dist/data/mathdemo/function/impact_velocity__then_0.mcfunction +2 -0
  603. package/dist/data/mathdemo/function/is_grounded.mcfunction +5 -0
  604. package/dist/data/mathdemo/function/is_grounded__merge_1.mcfunction +2 -0
  605. package/dist/data/mathdemo/function/is_grounded__then_0.mcfunction +2 -0
  606. package/dist/data/mathdemo/function/isqrt.mcfunction +5 -0
  607. package/dist/data/mathdemo/function/isqrt__loop_body_10.mcfunction +8 -0
  608. package/dist/data/mathdemo/function/isqrt__loop_body_13.mcfunction +11 -0
  609. package/dist/data/mathdemo/function/isqrt__loop_body_7.mcfunction +8 -0
  610. package/dist/data/mathdemo/function/isqrt__loop_exit_11.mcfunction +2 -0
  611. package/dist/data/mathdemo/function/isqrt__loop_exit_14.mcfunction +1 -0
  612. package/dist/data/mathdemo/function/isqrt__loop_exit_8.mcfunction +9 -0
  613. package/dist/data/mathdemo/function/isqrt__loop_header_12.mcfunction +4 -0
  614. package/dist/data/mathdemo/function/isqrt__loop_header_6.mcfunction +4 -0
  615. package/dist/data/mathdemo/function/isqrt__loop_header_9.mcfunction +3 -0
  616. package/dist/data/mathdemo/function/isqrt__merge_1.mcfunction +4 -0
  617. package/dist/data/mathdemo/function/isqrt__merge_16.mcfunction +5 -0
  618. package/dist/data/mathdemo/function/isqrt__merge_4.mcfunction +3 -0
  619. package/dist/data/mathdemo/function/isqrt__then_0.mcfunction +2 -0
  620. package/dist/data/mathdemo/function/isqrt__then_15.mcfunction +1 -0
  621. package/dist/data/mathdemo/function/isqrt__then_3.mcfunction +2 -0
  622. package/dist/data/mathdemo/function/lcm.mcfunction +11 -0
  623. package/dist/data/mathdemo/function/lcm__merge_1.mcfunction +5 -0
  624. package/dist/data/mathdemo/function/lcm__then_0.mcfunction +2 -0
  625. package/dist/data/mathdemo/function/length2d_fixed.mcfunction +15 -0
  626. package/dist/data/mathdemo/function/length3d_fixed.mcfunction +20 -0
  627. package/dist/data/mathdemo/function/lerp.mcfunction +13 -0
  628. package/dist/data/mathdemo/function/lerp2d_x.mcfunction +13 -0
  629. package/dist/data/mathdemo/function/lerp2d_y.mcfunction +13 -0
  630. package/dist/data/mathdemo/function/ln.mcfunction +9 -0
  631. package/dist/data/mathdemo/function/ln__loop_body_1.mcfunction +8 -0
  632. package/dist/data/mathdemo/function/ln__loop_body_4.mcfunction +8 -0
  633. package/dist/data/mathdemo/function/ln__loop_exit_2.mcfunction +1 -0
  634. package/dist/data/mathdemo/function/ln__loop_exit_5.mcfunction +37 -0
  635. package/dist/data/mathdemo/function/ln__loop_header_0.mcfunction +3 -0
  636. package/dist/data/mathdemo/function/ln__loop_header_3.mcfunction +6 -0
  637. package/dist/data/mathdemo/function/load.mcfunction +1 -0
  638. package/dist/data/mathdemo/function/log10_fx.mcfunction +11 -0
  639. package/dist/data/mathdemo/function/log2_fx.mcfunction +11 -0
  640. package/dist/data/mathdemo/function/log2_int.mcfunction +5 -0
  641. package/dist/data/mathdemo/function/log2_int__loop_body_4.mcfunction +8 -0
  642. package/dist/data/mathdemo/function/log2_int__loop_exit_5.mcfunction +1 -0
  643. package/dist/data/mathdemo/function/log2_int__loop_header_3.mcfunction +4 -0
  644. package/dist/data/mathdemo/function/log2_int__merge_1.mcfunction +3 -0
  645. package/dist/data/mathdemo/function/log2_int__then_0.mcfunction +2 -0
  646. package/dist/data/mathdemo/function/loga_fx.mcfunction +10 -0
  647. package/dist/data/mathdemo/function/loga_fx__merge_1.mcfunction +9 -0
  648. package/dist/data/mathdemo/function/loga_fx__then_0.mcfunction +2 -0
  649. package/dist/data/mathdemo/function/manhattan.mcfunction +14 -0
  650. package/dist/data/mathdemo/function/manhattan3d.mcfunction +19 -0
  651. package/dist/data/mathdemo/function/manhattan3d__merge_1.mcfunction +4 -0
  652. package/dist/data/mathdemo/function/manhattan3d__merge_3.mcfunction +4 -0
  653. package/dist/data/mathdemo/function/manhattan3d__merge_5.mcfunction +5 -0
  654. package/dist/data/mathdemo/function/manhattan3d__then_0.mcfunction +4 -0
  655. package/dist/data/mathdemo/function/manhattan3d__then_2.mcfunction +4 -0
  656. package/dist/data/mathdemo/function/manhattan3d__then_4.mcfunction +4 -0
  657. package/dist/data/mathdemo/function/manhattan__merge_1.mcfunction +4 -0
  658. package/dist/data/mathdemo/function/manhattan__merge_3.mcfunction +3 -0
  659. package/dist/data/mathdemo/function/manhattan__then_0.mcfunction +4 -0
  660. package/dist/data/mathdemo/function/manhattan__then_2.mcfunction +4 -0
  661. package/dist/data/mathdemo/function/map.mcfunction +12 -0
  662. package/dist/data/mathdemo/function/map__merge_1.mcfunction +11 -0
  663. package/dist/data/mathdemo/function/map__then_0.mcfunction +1 -0
  664. package/dist/data/mathdemo/function/mulfix.mcfunction +8 -0
  665. package/dist/data/mathdemo/function/neg2d_x.mcfunction +4 -0
  666. package/dist/data/mathdemo/function/neg2d_y.mcfunction +4 -0
  667. package/dist/data/mathdemo/function/neg3d_x.mcfunction +4 -0
  668. package/dist/data/mathdemo/function/neg3d_y.mcfunction +4 -0
  669. package/dist/data/mathdemo/function/neg3d_z.mcfunction +4 -0
  670. package/dist/data/mathdemo/function/normalize2d_x.mcfunction +11 -0
  671. package/dist/data/mathdemo/function/normalize2d_x__merge_1.mcfunction +6 -0
  672. package/dist/data/mathdemo/function/normalize2d_x__then_0.mcfunction +2 -0
  673. package/dist/data/mathdemo/function/normalize2d_y.mcfunction +11 -0
  674. package/dist/data/mathdemo/function/normalize2d_y__merge_1.mcfunction +6 -0
  675. package/dist/data/mathdemo/function/normalize2d_y__then_0.mcfunction +2 -0
  676. package/dist/data/mathdemo/function/pow_int.mcfunction +6 -0
  677. package/dist/data/mathdemo/function/pow_int__loop_body_4.mcfunction +7 -0
  678. package/dist/data/mathdemo/function/pow_int__loop_exit_5.mcfunction +1 -0
  679. package/dist/data/mathdemo/function/pow_int__loop_header_3.mcfunction +4 -0
  680. package/dist/data/mathdemo/function/pow_int__merge_1.mcfunction +4 -0
  681. package/dist/data/mathdemo/function/pow_int__merge_7.mcfunction +8 -0
  682. package/dist/data/mathdemo/function/pow_int__then_0.mcfunction +2 -0
  683. package/dist/data/mathdemo/function/pow_int__then_6.mcfunction +4 -0
  684. package/dist/data/mathdemo/function/projectile_land_t.mcfunction +5 -0
  685. package/dist/data/mathdemo/function/projectile_land_t__merge_1.mcfunction +7 -0
  686. package/dist/data/mathdemo/function/projectile_land_t__then_0.mcfunction +2 -0
  687. package/dist/data/mathdemo/function/projectile_max_height.mcfunction +10 -0
  688. package/dist/data/mathdemo/function/projectile_max_height__const_200.mcfunction +8 -0
  689. package/dist/data/mathdemo/function/projectile_vy.mcfunction +9 -0
  690. package/dist/data/mathdemo/function/projectile_x.mcfunction +8 -0
  691. package/dist/data/mathdemo/function/projectile_y.mcfunction +19 -0
  692. package/dist/data/mathdemo/function/quadratic_disc.mcfunction +12 -0
  693. package/dist/data/mathdemo/function/quadratic_x1.mcfunction +7 -0
  694. package/dist/data/mathdemo/function/quadratic_x1__merge_1.mcfunction +13 -0
  695. package/dist/data/mathdemo/function/quadratic_x1__merge_4.mcfunction +15 -0
  696. package/dist/data/mathdemo/function/quadratic_x1__then_0.mcfunction +2 -0
  697. package/dist/data/mathdemo/function/quadratic_x1__then_3.mcfunction +2 -0
  698. package/dist/data/mathdemo/function/quadratic_x2.mcfunction +7 -0
  699. package/dist/data/mathdemo/function/quadratic_x2__merge_1.mcfunction +13 -0
  700. package/dist/data/mathdemo/function/quadratic_x2__merge_4.mcfunction +15 -0
  701. package/dist/data/mathdemo/function/quadratic_x2__then_0.mcfunction +2 -0
  702. package/dist/data/mathdemo/function/quadratic_x2__then_3.mcfunction +2 -0
  703. package/dist/data/mathdemo/function/rotate2d_x.mcfunction +20 -0
  704. package/dist/data/mathdemo/function/rotate2d_y.mcfunction +20 -0
  705. package/dist/data/mathdemo/function/scale2d_x.mcfunction +8 -0
  706. package/dist/data/mathdemo/function/scale2d_y.mcfunction +8 -0
  707. package/dist/data/mathdemo/function/scale3d_x.mcfunction +8 -0
  708. package/dist/data/mathdemo/function/scale3d_y.mcfunction +8 -0
  709. package/dist/data/mathdemo/function/scale3d_z.mcfunction +8 -0
  710. package/dist/data/mathdemo/function/sign.mcfunction +5 -0
  711. package/dist/data/mathdemo/function/sign__merge_1.mcfunction +4 -0
  712. package/dist/data/mathdemo/function/sign__merge_4.mcfunction +2 -0
  713. package/dist/data/mathdemo/function/sign__then_0.mcfunction +2 -0
  714. package/dist/data/mathdemo/function/sign__then_3.mcfunction +2 -0
  715. package/dist/data/mathdemo/function/sin_fixed.mcfunction +9 -0
  716. package/dist/data/mathdemo/function/sin_fixed__merge_1.mcfunction +4 -0
  717. package/dist/data/mathdemo/function/sin_fixed__merge_3.mcfunction +4 -0
  718. package/dist/data/mathdemo/function/sin_fixed__merge_6.mcfunction +4 -0
  719. package/dist/data/mathdemo/function/sin_fixed__merge_9.mcfunction +10 -0
  720. package/dist/data/mathdemo/function/sin_fixed__then_0.mcfunction +4 -0
  721. package/dist/data/mathdemo/function/sin_fixed__then_2.mcfunction +6 -0
  722. package/dist/data/mathdemo/function/sin_fixed__then_5.mcfunction +8 -0
  723. package/dist/data/mathdemo/function/sin_fixed__then_8.mcfunction +10 -0
  724. package/dist/data/mathdemo/function/smootherstep.mcfunction +10 -0
  725. package/dist/data/mathdemo/function/smootherstep__merge_1.mcfunction +12 -0
  726. package/dist/data/mathdemo/function/smootherstep__merge_4.mcfunction +4 -0
  727. package/dist/data/mathdemo/function/smootherstep__merge_6.mcfunction +27 -0
  728. package/dist/data/mathdemo/function/smootherstep__then_0.mcfunction +2 -0
  729. package/dist/data/mathdemo/function/smootherstep__then_3.mcfunction +2 -0
  730. package/dist/data/mathdemo/function/smootherstep__then_5.mcfunction +2 -0
  731. package/dist/data/mathdemo/function/smoothstep.mcfunction +10 -0
  732. package/dist/data/mathdemo/function/smoothstep__merge_1.mcfunction +12 -0
  733. package/dist/data/mathdemo/function/smoothstep__merge_4.mcfunction +4 -0
  734. package/dist/data/mathdemo/function/smoothstep__merge_6.mcfunction +15 -0
  735. package/dist/data/mathdemo/function/smoothstep__then_0.mcfunction +2 -0
  736. package/dist/data/mathdemo/function/smoothstep__then_3.mcfunction +2 -0
  737. package/dist/data/mathdemo/function/smoothstep__then_5.mcfunction +2 -0
  738. package/dist/data/mathdemo/function/solve2x2_x.mcfunction +17 -0
  739. package/dist/data/mathdemo/function/solve2x2_x__merge_1.mcfunction +12 -0
  740. package/dist/data/mathdemo/function/solve2x2_x__then_0.mcfunction +2 -0
  741. package/dist/data/mathdemo/function/solve2x2_y.mcfunction +17 -0
  742. package/dist/data/mathdemo/function/solve2x2_y__merge_1.mcfunction +12 -0
  743. package/dist/data/mathdemo/function/solve2x2_y__then_0.mcfunction +2 -0
  744. package/dist/data/mathdemo/function/spring_force.mcfunction +11 -0
  745. package/dist/data/mathdemo/function/spring_update_v.mcfunction +18 -0
  746. package/dist/data/mathdemo/function/sqrt_fixed.mcfunction +8 -0
  747. package/dist/data/mathdemo/function/sqrt_fx.mcfunction +11 -0
  748. package/dist/data/mathdemo/function/sqrt_fx__const_20000.mcfunction +8 -0
  749. package/dist/data/mathdemo/function/start.mcfunction +6 -0
  750. package/dist/data/mathdemo/function/sub2d_x.mcfunction +5 -0
  751. package/dist/data/mathdemo/function/sub2d_y.mcfunction +5 -0
  752. package/dist/data/mathdemo/function/sub3d_x.mcfunction +5 -0
  753. package/dist/data/mathdemo/function/sub3d_y.mcfunction +5 -0
  754. package/dist/data/mathdemo/function/sub3d_z.mcfunction +5 -0
  755. package/dist/data/mathdemo/function/terrain_height.mcfunction +24 -0
  756. package/dist/data/mathdemo/function/terrain_height__const_0_0_64_20.mcfunction +17 -0
  757. package/dist/data/mathdemo/function/terrain_height__const_10_5_64_20.mcfunction +17 -0
  758. package/dist/data/mathdemo/function/update_pos.mcfunction +5 -0
  759. package/dist/data/mathdemo/function/value_noise_1d.mcfunction +13 -0
  760. package/dist/data/mathdemo/function/value_noise_1d__merge_1.mcfunction +39 -0
  761. package/dist/data/mathdemo/function/value_noise_1d__then_0.mcfunction +7 -0
  762. package/dist/data/mathdemo/function/value_noise_2d.mcfunction +14 -0
  763. package/dist/data/mathdemo/function/value_noise_2d__merge_1.mcfunction +12 -0
  764. package/dist/data/mathdemo/function/value_noise_2d__merge_3.mcfunction +98 -0
  765. package/dist/data/mathdemo/function/value_noise_2d__then_0.mcfunction +7 -0
  766. package/dist/data/mathdemo/function/value_noise_2d__then_2.mcfunction +7 -0
  767. package/dist/data/mathdemo/function/water_drag_fx.mcfunction +2 -0
  768. package/dist/data/mathtest/function/__load.mcfunction +3 -0
  769. package/dist/data/mathtest/function/abs/merge_2.mcfunction +3 -0
  770. package/dist/data/mathtest/function/abs/then_0.mcfunction +5 -0
  771. package/dist/data/mathtest/function/abs.mcfunction +6 -0
  772. package/dist/data/mathtest/function/test.mcfunction +5 -0
  773. package/dist/data/minecraft/tags/function/load.json +5 -0
  774. package/dist/data/minecraft/tags/function/tick.json +5 -0
  775. package/dist/data/mypack/function/__load.mcfunction +13 -0
  776. package/dist/data/mypack/function/_atan_init.mcfunction +2 -0
  777. package/dist/data/mypack/function/abs/merge_2.mcfunction +3 -0
  778. package/dist/data/mypack/function/abs/then_0.mcfunction +5 -0
  779. package/dist/data/mypack/function/abs.mcfunction +6 -0
  780. package/dist/data/mypack/function/atan2_fixed/__sgi_1.mcfunction +2 -0
  781. package/dist/data/mypack/function/atan2_fixed/else_34.mcfunction +3 -0
  782. package/dist/data/mypack/function/atan2_fixed/loop_body_31.mcfunction +19 -0
  783. package/dist/data/mypack/function/atan2_fixed/loop_check_30.mcfunction +5 -0
  784. package/dist/data/mypack/function/atan2_fixed/loop_exit_32.mcfunction +6 -0
  785. package/dist/data/mypack/function/atan2_fixed/merge_11.mcfunction +6 -0
  786. package/dist/data/mypack/function/atan2_fixed/merge_14.mcfunction +3 -0
  787. package/dist/data/mypack/function/atan2_fixed/merge_17.mcfunction +6 -0
  788. package/dist/data/mypack/function/atan2_fixed/merge_2.mcfunction +5 -0
  789. package/dist/data/mypack/function/atan2_fixed/merge_20.mcfunction +5 -0
  790. package/dist/data/mypack/function/atan2_fixed/merge_23.mcfunction +5 -0
  791. package/dist/data/mypack/function/atan2_fixed/merge_26.mcfunction +6 -0
  792. package/dist/data/mypack/function/atan2_fixed/merge_29.mcfunction +4 -0
  793. package/dist/data/mypack/function/atan2_fixed/merge_38.mcfunction +5 -0
  794. package/dist/data/mypack/function/atan2_fixed/merge_41.mcfunction +5 -0
  795. package/dist/data/mypack/function/atan2_fixed/merge_44.mcfunction +5 -0
  796. package/dist/data/mypack/function/atan2_fixed/merge_47.mcfunction +5 -0
  797. package/dist/data/mypack/function/atan2_fixed/merge_5.mcfunction +5 -0
  798. package/dist/data/mypack/function/atan2_fixed/merge_8.mcfunction +3 -0
  799. package/dist/data/mypack/function/atan2_fixed/then_0.mcfunction +5 -0
  800. package/dist/data/mypack/function/atan2_fixed/then_12.mcfunction +3 -0
  801. package/dist/data/mypack/function/atan2_fixed/then_15.mcfunction +5 -0
  802. package/dist/data/mypack/function/atan2_fixed/then_18.mcfunction +5 -0
  803. package/dist/data/mypack/function/atan2_fixed/then_21.mcfunction +3 -0
  804. package/dist/data/mypack/function/atan2_fixed/then_24.mcfunction +3 -0
  805. package/dist/data/mypack/function/atan2_fixed/then_27.mcfunction +6 -0
  806. package/dist/data/mypack/function/atan2_fixed/then_3.mcfunction +3 -0
  807. package/dist/data/mypack/function/atan2_fixed/then_33.mcfunction +5 -0
  808. package/dist/data/mypack/function/atan2_fixed/then_36.mcfunction +5 -0
  809. package/dist/data/mypack/function/atan2_fixed/then_39.mcfunction +5 -0
  810. package/dist/data/mypack/function/atan2_fixed/then_42.mcfunction +3 -0
  811. package/dist/data/mypack/function/atan2_fixed/then_45.mcfunction +5 -0
  812. package/dist/data/mypack/function/atan2_fixed/then_6.mcfunction +3 -0
  813. package/dist/data/mypack/function/atan2_fixed/then_9.mcfunction +5 -0
  814. package/dist/data/mypack/function/atan2_fixed.mcfunction +7 -0
  815. package/dist/data/mypack/function/my_game.mcfunction +10 -0
  816. package/dist/data/parkour_race/function/angry_at.mcfunction +1 -0
  817. package/dist/data/parkour_race/function/barrier_wall.mcfunction +1 -0
  818. package/dist/data/parkour_race/function/buff_all.mcfunction +22 -0
  819. package/dist/data/parkour_race/function/check_checkpoints.mcfunction +11 -0
  820. package/dist/data/parkour_race/function/check_checkpoints__exec_t11.mcfunction +4 -0
  821. package/dist/data/parkour_race/function/check_checkpoints__exec_t13.mcfunction +3 -0
  822. package/dist/data/parkour_race/function/check_checkpoints__exec_t5.mcfunction +4 -0
  823. package/dist/data/parkour_race/function/check_checkpoints__exec_t7.mcfunction +4 -0
  824. package/dist/data/parkour_race/function/check_checkpoints__exec_t9.mcfunction +4 -0
  825. package/dist/data/parkour_race/function/check_checkpoints__merge_1.mcfunction +5 -0
  826. package/dist/data/parkour_race/function/check_checkpoints__merge_3.mcfunction +5 -0
  827. package/dist/data/parkour_race/function/check_checkpoints__merge_5.mcfunction +5 -0
  828. package/dist/data/parkour_race/function/check_checkpoints__merge_7.mcfunction +5 -0
  829. package/dist/data/parkour_race/function/check_checkpoints__merge_9.mcfunction +1 -0
  830. package/dist/data/parkour_race/function/check_checkpoints__then_0.mcfunction +2 -0
  831. package/dist/data/parkour_race/function/check_checkpoints__then_2.mcfunction +2 -0
  832. package/dist/data/parkour_race/function/check_checkpoints__then_4.mcfunction +2 -0
  833. package/dist/data/parkour_race/function/check_checkpoints__then_6.mcfunction +2 -0
  834. package/dist/data/parkour_race/function/check_checkpoints__then_8.mcfunction +2 -0
  835. package/dist/data/parkour_race/function/check_fall.mcfunction +1 -0
  836. package/dist/data/parkour_race/function/check_fall__exec_t1.mcfunction +10 -0
  837. package/dist/data/parkour_race/function/clear_area.mcfunction +1 -0
  838. package/dist/data/parkour_race/function/clear_effect.mcfunction +1 -0
  839. package/dist/data/parkour_race/function/clear_effects.mcfunction +1 -0
  840. package/dist/data/parkour_race/function/create_health_bar.mcfunction +24 -0
  841. package/dist/data/parkour_race/function/create_progress_bar.mcfunction +24 -0
  842. package/dist/data/parkour_race/function/create_timer_bar.mcfunction +30 -0
  843. package/dist/data/parkour_race/function/disable_fire_spread.mcfunction +1 -0
  844. package/dist/data/parkour_race/function/disable_keep_inventory.mcfunction +1 -0
  845. package/dist/data/parkour_race/function/disable_mob_griefing.mcfunction +1 -0
  846. package/dist/data/parkour_race/function/enable_keep_inventory.mcfunction +1 -0
  847. package/dist/data/parkour_race/function/end_sparkles_at.mcfunction +1 -0
  848. package/dist/data/parkour_race/function/explosion_effect.mcfunction +1 -0
  849. package/dist/data/parkour_race/function/finish_race.mcfunction +20 -0
  850. package/dist/data/parkour_race/function/finish_race__else_2.mcfunction +4 -0
  851. package/dist/data/parkour_race/function/finish_race__else_5.mcfunction +3 -0
  852. package/dist/data/parkour_race/function/finish_race__merge_1.mcfunction +3 -0
  853. package/dist/data/parkour_race/function/finish_race__merge_4.mcfunction +1 -0
  854. package/dist/data/parkour_race/function/finish_race__then_0.mcfunction +8 -0
  855. package/dist/data/parkour_race/function/finish_race__then_3.mcfunction +10 -0
  856. package/dist/data/parkour_race/function/flames.mcfunction +1 -0
  857. package/dist/data/parkour_race/function/glass_box.mcfunction +2 -0
  858. package/dist/data/parkour_race/function/glow.mcfunction +1 -0
  859. package/dist/data/parkour_race/function/happy_at.mcfunction +1 -0
  860. package/dist/data/parkour_race/function/hearts_at.mcfunction +1 -0
  861. package/dist/data/parkour_race/function/hide_bar.mcfunction +4 -0
  862. package/dist/data/parkour_race/function/init.mcfunction +18 -0
  863. package/dist/data/parkour_race/function/invisible.mcfunction +1 -0
  864. package/dist/data/parkour_race/function/jump.mcfunction +1 -0
  865. package/dist/data/parkour_race/function/load.mcfunction +1 -0
  866. package/dist/data/parkour_race/function/night_vision.mcfunction +1 -0
  867. package/dist/data/parkour_race/function/portal_effect.mcfunction +1 -0
  868. package/dist/data/parkour_race/function/quit_race.mcfunction +10 -0
  869. package/dist/data/parkour_race/function/quit_race__merge_1.mcfunction +1 -0
  870. package/dist/data/parkour_race/function/quit_race__then_0.mcfunction +11 -0
  871. package/dist/data/parkour_race/function/race_tick.mcfunction +1 -0
  872. package/dist/data/parkour_race/function/race_tick__foreach_t0.mcfunction +10 -0
  873. package/dist/data/parkour_race/function/race_tick__foreach_t0__merge_1.mcfunction +1 -0
  874. package/dist/data/parkour_race/function/race_tick__foreach_t0__then_0.mcfunction +13 -0
  875. package/dist/data/parkour_race/function/reach_checkpoint.mcfunction +11 -0
  876. package/dist/data/parkour_race/function/regen.mcfunction +1 -0
  877. package/dist/data/parkour_race/function/remove_bar.mcfunction +3 -0
  878. package/dist/data/parkour_race/function/resistance.mcfunction +1 -0
  879. package/dist/data/parkour_race/function/respawn_at_checkpoint.mcfunction +7 -0
  880. package/dist/data/parkour_race/function/respawn_at_checkpoint__merge_1.mcfunction +5 -0
  881. package/dist/data/parkour_race/function/respawn_at_checkpoint__merge_3.mcfunction +5 -0
  882. package/dist/data/parkour_race/function/respawn_at_checkpoint__merge_5.mcfunction +5 -0
  883. package/dist/data/parkour_race/function/respawn_at_checkpoint__merge_7.mcfunction +5 -0
  884. package/dist/data/parkour_race/function/respawn_at_checkpoint__merge_9.mcfunction +1 -0
  885. package/dist/data/parkour_race/function/respawn_at_checkpoint__then_0.mcfunction +6 -0
  886. package/dist/data/parkour_race/function/respawn_at_checkpoint__then_2.mcfunction +6 -0
  887. package/dist/data/parkour_race/function/respawn_at_checkpoint__then_4.mcfunction +6 -0
  888. package/dist/data/parkour_race/function/respawn_at_checkpoint__then_6.mcfunction +6 -0
  889. package/dist/data/parkour_race/function/respawn_at_checkpoint__then_8.mcfunction +6 -0
  890. package/dist/data/parkour_race/function/set_day.mcfunction +1 -0
  891. package/dist/data/parkour_race/function/set_easy.mcfunction +1 -0
  892. package/dist/data/parkour_race/function/set_hard.mcfunction +1 -0
  893. package/dist/data/parkour_race/function/set_midnight.mcfunction +1 -0
  894. package/dist/data/parkour_race/function/set_night.mcfunction +1 -0
  895. package/dist/data/parkour_race/function/set_noon.mcfunction +1 -0
  896. package/dist/data/parkour_race/function/set_normal.mcfunction +1 -0
  897. package/dist/data/parkour_race/function/set_peaceful.mcfunction +1 -0
  898. package/dist/data/parkour_race/function/show_bar.mcfunction +4 -0
  899. package/dist/data/parkour_race/function/show_leaderboard.mcfunction +4 -0
  900. package/dist/data/parkour_race/function/slow_fall.mcfunction +1 -0
  901. package/dist/data/parkour_race/function/smoke.mcfunction +1 -0
  902. package/dist/data/parkour_race/function/sparkles_at.mcfunction +1 -0
  903. package/dist/data/parkour_race/function/speed.mcfunction +1 -0
  904. package/dist/data/parkour_race/function/start_race.mcfunction +10 -0
  905. package/dist/data/parkour_race/function/start_race__merge_1.mcfunction +23 -0
  906. package/dist/data/parkour_race/function/start_race__then_0.mcfunction +1 -0
  907. package/dist/data/parkour_race/function/strength.mcfunction +1 -0
  908. package/dist/data/parkour_race/function/totem_at.mcfunction +1 -0
  909. package/dist/data/parkour_race/function/update_bar.mcfunction +5 -0
  910. package/dist/data/parkour_race/function/update_bar_color.mcfunction +7 -0
  911. package/dist/data/parkour_race/function/update_bar_color__else_2.mcfunction +5 -0
  912. package/dist/data/parkour_race/function/update_bar_color__else_5.mcfunction +4 -0
  913. package/dist/data/parkour_race/function/update_bar_color__merge_1.mcfunction +1 -0
  914. package/dist/data/parkour_race/function/update_bar_color__merge_4.mcfunction +1 -0
  915. package/dist/data/parkour_race/function/update_bar_color__then_0.mcfunction +4 -0
  916. package/dist/data/parkour_race/function/update_bar_color__then_3.mcfunction +4 -0
  917. package/dist/data/parkour_race/function/weather_clear.mcfunction +1 -0
  918. package/dist/data/parkour_race/function/weather_rain.mcfunction +1 -0
  919. package/dist/data/parkour_race/function/weather_thunder.mcfunction +1 -0
  920. package/dist/data/quiz/function/__load.mcfunction +16 -0
  921. package/dist/data/quiz/function/__tick.mcfunction +6 -0
  922. package/dist/data/quiz/function/__trigger_quiz_a_dispatch.mcfunction +4 -0
  923. package/dist/data/quiz/function/__trigger_quiz_b_dispatch.mcfunction +4 -0
  924. package/dist/data/quiz/function/__trigger_quiz_c_dispatch.mcfunction +4 -0
  925. package/dist/data/quiz/function/__trigger_quiz_start_dispatch.mcfunction +4 -0
  926. package/dist/data/quiz/function/answer_a.mcfunction +4 -0
  927. package/dist/data/quiz/function/answer_b.mcfunction +4 -0
  928. package/dist/data/quiz/function/answer_c.mcfunction +4 -0
  929. package/dist/data/quiz/function/ask_question/else_1.mcfunction +5 -0
  930. package/dist/data/quiz/function/ask_question/else_4.mcfunction +5 -0
  931. package/dist/data/quiz/function/ask_question/else_7.mcfunction +4 -0
  932. package/dist/data/quiz/function/ask_question/merge_2.mcfunction +1 -0
  933. package/dist/data/quiz/function/ask_question/merge_5.mcfunction +2 -0
  934. package/dist/data/quiz/function/ask_question/merge_8.mcfunction +2 -0
  935. package/dist/data/quiz/function/ask_question/then_0.mcfunction +4 -0
  936. package/dist/data/quiz/function/ask_question/then_3.mcfunction +4 -0
  937. package/dist/data/quiz/function/ask_question/then_6.mcfunction +4 -0
  938. package/dist/data/quiz/function/ask_question.mcfunction +7 -0
  939. package/dist/data/quiz/function/finish_quiz.mcfunction +6 -0
  940. package/dist/data/quiz/function/handle_answer/else_1.mcfunction +5 -0
  941. package/dist/data/quiz/function/handle_answer/else_10.mcfunction +3 -0
  942. package/dist/data/quiz/function/handle_answer/else_16.mcfunction +3 -0
  943. package/dist/data/quiz/function/handle_answer/else_4.mcfunction +3 -0
  944. package/dist/data/quiz/function/handle_answer/else_7.mcfunction +5 -0
  945. package/dist/data/quiz/function/handle_answer/merge_11.mcfunction +2 -0
  946. package/dist/data/quiz/function/handle_answer/merge_14.mcfunction +2 -0
  947. package/dist/data/quiz/function/handle_answer/merge_17.mcfunction +2 -0
  948. package/dist/data/quiz/function/handle_answer/merge_2.mcfunction +8 -0
  949. package/dist/data/quiz/function/handle_answer/merge_5.mcfunction +2 -0
  950. package/dist/data/quiz/function/handle_answer/merge_8.mcfunction +2 -0
  951. package/dist/data/quiz/function/handle_answer/then_0.mcfunction +5 -0
  952. package/dist/data/quiz/function/handle_answer/then_12.mcfunction +5 -0
  953. package/dist/data/quiz/function/handle_answer/then_15.mcfunction +6 -0
  954. package/dist/data/quiz/function/handle_answer/then_3.mcfunction +6 -0
  955. package/dist/data/quiz/function/handle_answer/then_6.mcfunction +5 -0
  956. package/dist/data/quiz/function/handle_answer/then_9.mcfunction +6 -0
  957. package/dist/data/quiz/function/handle_answer.mcfunction +11 -0
  958. package/dist/data/quiz/function/start_quiz.mcfunction +5 -0
  959. package/dist/data/rawtest/function/load.mcfunction +1 -0
  960. package/dist/data/rawtest/function/test.mcfunction +2 -0
  961. package/dist/data/readme_demo/function/_draw.mcfunction +1 -0
  962. package/dist/data/readme_demo/function/_init.mcfunction +1 -0
  963. package/dist/data/readme_demo/function/_math_init.mcfunction +4 -0
  964. package/dist/data/readme_demo/function/_wave_tick.mcfunction +1 -0
  965. package/dist/data/readme_demo/function/_wave_tick__foreach_t8.mcfunction +109 -0
  966. package/dist/data/readme_demo/function/acos_approx.mcfunction +7 -0
  967. package/dist/data/readme_demo/function/approx_eq.mcfunction +10 -0
  968. package/dist/data/readme_demo/function/approx_eq__merge_1.mcfunction +3 -0
  969. package/dist/data/readme_demo/function/approx_eq__merge_3.mcfunction +2 -0
  970. package/dist/data/readme_demo/function/approx_eq__then_0.mcfunction +4 -0
  971. package/dist/data/readme_demo/function/approx_eq__then_2.mcfunction +2 -0
  972. package/dist/data/readme_demo/function/asin_approx.mcfunction +5 -0
  973. package/dist/data/readme_demo/function/asin_approx__merge_1.mcfunction +3 -0
  974. package/dist/data/readme_demo/function/asin_approx__merge_10.mcfunction +5 -0
  975. package/dist/data/readme_demo/function/asin_approx__merge_4.mcfunction +12 -0
  976. package/dist/data/readme_demo/function/asin_approx__merge_7.mcfunction +14 -0
  977. package/dist/data/readme_demo/function/asin_approx__then_0.mcfunction +2 -0
  978. package/dist/data/readme_demo/function/asin_approx__then_3.mcfunction +2 -0
  979. package/dist/data/readme_demo/function/asin_approx__then_6.mcfunction +2 -0
  980. package/dist/data/readme_demo/function/asin_approx__then_9.mcfunction +2 -0
  981. package/dist/data/readme_demo/function/cbrt_fx.mcfunction +5 -0
  982. package/dist/data/readme_demo/function/cbrt_fx__loop_body_6.mcfunction +7 -0
  983. package/dist/data/readme_demo/function/cbrt_fx__loop_exit_7.mcfunction +1 -0
  984. package/dist/data/readme_demo/function/cbrt_fx__loop_header_5.mcfunction +4 -0
  985. package/dist/data/readme_demo/function/cbrt_fx__merge_1.mcfunction +8 -0
  986. package/dist/data/readme_demo/function/cbrt_fx__merge_11.mcfunction +5 -0
  987. package/dist/data/readme_demo/function/cbrt_fx__merge_13.mcfunction +4 -0
  988. package/dist/data/readme_demo/function/cbrt_fx__merge_4.mcfunction +2 -0
  989. package/dist/data/readme_demo/function/cbrt_fx__merge_9.mcfunction +13 -0
  990. package/dist/data/readme_demo/function/cbrt_fx__then_0.mcfunction +2 -0
  991. package/dist/data/readme_demo/function/cbrt_fx__then_10.mcfunction +2 -0
  992. package/dist/data/readme_demo/function/cbrt_fx__then_12.mcfunction +2 -0
  993. package/dist/data/readme_demo/function/cbrt_fx__then_3.mcfunction +2 -0
  994. package/dist/data/readme_demo/function/cbrt_fx__then_8.mcfunction +2 -0
  995. package/dist/data/readme_demo/function/cbrt_newton.mcfunction +5 -0
  996. package/dist/data/readme_demo/function/cbrt_newton__else_7.mcfunction +2 -0
  997. package/dist/data/readme_demo/function/cbrt_newton__merge_1.mcfunction +11 -0
  998. package/dist/data/readme_demo/function/cbrt_newton__merge_4.mcfunction +1 -0
  999. package/dist/data/readme_demo/function/cbrt_newton__merge_6.mcfunction +1 -0
  1000. package/dist/data/readme_demo/function/cbrt_newton__then_0.mcfunction +2 -0
  1001. package/dist/data/readme_demo/function/cbrt_newton__then_3.mcfunction +17 -0
  1002. package/dist/data/readme_demo/function/cbrt_newton__then_5.mcfunction +11 -0
  1003. package/dist/data/readme_demo/function/ceil_div.mcfunction +9 -0
  1004. package/dist/data/readme_demo/function/combinations.mcfunction +6 -0
  1005. package/dist/data/readme_demo/function/combinations__loop_body_9.mcfunction +15 -0
  1006. package/dist/data/readme_demo/function/combinations__loop_exit_10.mcfunction +1 -0
  1007. package/dist/data/readme_demo/function/combinations__loop_header_8.mcfunction +3 -0
  1008. package/dist/data/readme_demo/function/combinations__merge_1.mcfunction +3 -0
  1009. package/dist/data/readme_demo/function/combinations__merge_4.mcfunction +6 -0
  1010. package/dist/data/readme_demo/function/combinations__merge_7.mcfunction +3 -0
  1011. package/dist/data/readme_demo/function/combinations__then_0.mcfunction +2 -0
  1012. package/dist/data/readme_demo/function/combinations__then_3.mcfunction +2 -0
  1013. package/dist/data/readme_demo/function/combinations__then_6.mcfunction +4 -0
  1014. package/dist/data/readme_demo/function/cos_fixed.mcfunction +7 -0
  1015. package/dist/data/readme_demo/function/cubic_disc_fx.mcfunction +26 -0
  1016. package/dist/data/readme_demo/function/cubic_newton.mcfunction +8 -0
  1017. package/dist/data/readme_demo/function/cubic_newton__loop_body_1.mcfunction +55 -0
  1018. package/dist/data/readme_demo/function/cubic_newton__loop_exit_2.mcfunction +1 -0
  1019. package/dist/data/readme_demo/function/cubic_newton__loop_header_0.mcfunction +4 -0
  1020. package/dist/data/readme_demo/function/cubic_newton__merge_10.mcfunction +1 -0
  1021. package/dist/data/readme_demo/function/cubic_newton__merge_4.mcfunction +4 -0
  1022. package/dist/data/readme_demo/function/cubic_newton__merge_6.mcfunction +4 -0
  1023. package/dist/data/readme_demo/function/cubic_newton__merge_8.mcfunction +4 -0
  1024. package/dist/data/readme_demo/function/cubic_newton__then_3.mcfunction +2 -0
  1025. package/dist/data/readme_demo/function/cubic_newton__then_5.mcfunction +13 -0
  1026. package/dist/data/readme_demo/function/cubic_newton__then_7.mcfunction +4 -0
  1027. package/dist/data/readme_demo/function/cubic_newton__then_9.mcfunction +2 -0
  1028. package/dist/data/readme_demo/function/divfix.mcfunction +6 -0
  1029. package/dist/data/readme_demo/function/divfix__merge_1.mcfunction +6 -0
  1030. package/dist/data/readme_demo/function/divfix__then_0.mcfunction +2 -0
  1031. package/dist/data/readme_demo/function/exp_fx.mcfunction +16 -0
  1032. package/dist/data/readme_demo/function/exp_fx__loop_body_10.mcfunction +8 -0
  1033. package/dist/data/readme_demo/function/exp_fx__loop_body_5.mcfunction +8 -0
  1034. package/dist/data/readme_demo/function/exp_fx__loop_exit_11.mcfunction +1 -0
  1035. package/dist/data/readme_demo/function/exp_fx__loop_exit_6.mcfunction +1 -0
  1036. package/dist/data/readme_demo/function/exp_fx__loop_header_4.mcfunction +3 -0
  1037. package/dist/data/readme_demo/function/exp_fx__loop_header_9.mcfunction +3 -0
  1038. package/dist/data/readme_demo/function/exp_fx__merge_1.mcfunction +47 -0
  1039. package/dist/data/readme_demo/function/exp_fx__merge_3.mcfunction +4 -0
  1040. package/dist/data/readme_demo/function/exp_fx__merge_8.mcfunction +1 -0
  1041. package/dist/data/readme_demo/function/exp_fx__then_0.mcfunction +7 -0
  1042. package/dist/data/readme_demo/function/exp_fx__then_2.mcfunction +2 -0
  1043. package/dist/data/readme_demo/function/exp_fx__then_7.mcfunction +5 -0
  1044. package/dist/data/readme_demo/function/factorial.mcfunction +5 -0
  1045. package/dist/data/readme_demo/function/factorial__loop_body_4.mcfunction +7 -0
  1046. package/dist/data/readme_demo/function/factorial__loop_exit_5.mcfunction +1 -0
  1047. package/dist/data/readme_demo/function/factorial__loop_header_3.mcfunction +3 -0
  1048. package/dist/data/readme_demo/function/factorial__merge_1.mcfunction +3 -0
  1049. package/dist/data/readme_demo/function/factorial__then_0.mcfunction +2 -0
  1050. package/dist/data/readme_demo/function/gamma_int.mcfunction +5 -0
  1051. package/dist/data/readme_demo/function/gamma_int__merge_1.mcfunction +6 -0
  1052. package/dist/data/readme_demo/function/gamma_int__then_0.mcfunction +2 -0
  1053. package/dist/data/readme_demo/function/gcd.mcfunction +7 -0
  1054. package/dist/data/readme_demo/function/gcd__loop_body_5.mcfunction +5 -0
  1055. package/dist/data/readme_demo/function/gcd__loop_exit_6.mcfunction +1 -0
  1056. package/dist/data/readme_demo/function/gcd__loop_header_4.mcfunction +4 -0
  1057. package/dist/data/readme_demo/function/gcd__merge_1.mcfunction +5 -0
  1058. package/dist/data/readme_demo/function/gcd__merge_3.mcfunction +1 -0
  1059. package/dist/data/readme_demo/function/gcd__then_0.mcfunction +4 -0
  1060. package/dist/data/readme_demo/function/gcd__then_2.mcfunction +4 -0
  1061. package/dist/data/readme_demo/function/isqrt.mcfunction +5 -0
  1062. package/dist/data/readme_demo/function/isqrt__loop_body_10.mcfunction +8 -0
  1063. package/dist/data/readme_demo/function/isqrt__loop_body_13.mcfunction +11 -0
  1064. package/dist/data/readme_demo/function/isqrt__loop_body_7.mcfunction +8 -0
  1065. package/dist/data/readme_demo/function/isqrt__loop_exit_11.mcfunction +2 -0
  1066. package/dist/data/readme_demo/function/isqrt__loop_exit_14.mcfunction +1 -0
  1067. package/dist/data/readme_demo/function/isqrt__loop_exit_8.mcfunction +9 -0
  1068. package/dist/data/readme_demo/function/isqrt__loop_header_12.mcfunction +4 -0
  1069. package/dist/data/readme_demo/function/isqrt__loop_header_6.mcfunction +4 -0
  1070. package/dist/data/readme_demo/function/isqrt__loop_header_9.mcfunction +3 -0
  1071. package/dist/data/readme_demo/function/isqrt__merge_1.mcfunction +4 -0
  1072. package/dist/data/readme_demo/function/isqrt__merge_16.mcfunction +5 -0
  1073. package/dist/data/readme_demo/function/isqrt__merge_4.mcfunction +3 -0
  1074. package/dist/data/readme_demo/function/isqrt__then_0.mcfunction +2 -0
  1075. package/dist/data/readme_demo/function/isqrt__then_15.mcfunction +1 -0
  1076. package/dist/data/readme_demo/function/isqrt__then_3.mcfunction +2 -0
  1077. package/dist/data/readme_demo/function/lcm.mcfunction +11 -0
  1078. package/dist/data/readme_demo/function/lcm__merge_1.mcfunction +5 -0
  1079. package/dist/data/readme_demo/function/lcm__then_0.mcfunction +2 -0
  1080. package/dist/data/readme_demo/function/lerp.mcfunction +13 -0
  1081. package/dist/data/readme_demo/function/ln.mcfunction +9 -0
  1082. package/dist/data/readme_demo/function/ln__loop_body_1.mcfunction +8 -0
  1083. package/dist/data/readme_demo/function/ln__loop_body_4.mcfunction +8 -0
  1084. package/dist/data/readme_demo/function/ln__loop_exit_2.mcfunction +1 -0
  1085. package/dist/data/readme_demo/function/ln__loop_exit_5.mcfunction +37 -0
  1086. package/dist/data/readme_demo/function/ln__loop_header_0.mcfunction +3 -0
  1087. package/dist/data/readme_demo/function/ln__loop_header_3.mcfunction +6 -0
  1088. package/dist/data/readme_demo/function/load.mcfunction +1 -0
  1089. package/dist/data/readme_demo/function/log10_fx.mcfunction +11 -0
  1090. package/dist/data/readme_demo/function/log2_fx.mcfunction +11 -0
  1091. package/dist/data/readme_demo/function/log2_int.mcfunction +5 -0
  1092. package/dist/data/readme_demo/function/log2_int__loop_body_4.mcfunction +8 -0
  1093. package/dist/data/readme_demo/function/log2_int__loop_exit_5.mcfunction +1 -0
  1094. package/dist/data/readme_demo/function/log2_int__loop_header_3.mcfunction +4 -0
  1095. package/dist/data/readme_demo/function/log2_int__merge_1.mcfunction +3 -0
  1096. package/dist/data/readme_demo/function/log2_int__then_0.mcfunction +2 -0
  1097. package/dist/data/readme_demo/function/loga_fx.mcfunction +10 -0
  1098. package/dist/data/readme_demo/function/loga_fx__merge_1.mcfunction +9 -0
  1099. package/dist/data/readme_demo/function/loga_fx__then_0.mcfunction +2 -0
  1100. package/dist/data/readme_demo/function/map.mcfunction +12 -0
  1101. package/dist/data/readme_demo/function/map__merge_1.mcfunction +11 -0
  1102. package/dist/data/readme_demo/function/map__then_0.mcfunction +1 -0
  1103. package/dist/data/readme_demo/function/mulfix.mcfunction +8 -0
  1104. package/dist/data/readme_demo/function/newton_step.mcfunction +7 -0
  1105. package/dist/data/readme_demo/function/newton_step__merge_1.mcfunction +8 -0
  1106. package/dist/data/readme_demo/function/newton_step__then_0.mcfunction +1 -0
  1107. package/dist/data/readme_demo/function/pow_int.mcfunction +6 -0
  1108. package/dist/data/readme_demo/function/pow_int__loop_body_4.mcfunction +7 -0
  1109. package/dist/data/readme_demo/function/pow_int__loop_exit_5.mcfunction +1 -0
  1110. package/dist/data/readme_demo/function/pow_int__loop_header_3.mcfunction +4 -0
  1111. package/dist/data/readme_demo/function/pow_int__merge_1.mcfunction +4 -0
  1112. package/dist/data/readme_demo/function/pow_int__merge_7.mcfunction +8 -0
  1113. package/dist/data/readme_demo/function/pow_int__then_0.mcfunction +2 -0
  1114. package/dist/data/readme_demo/function/pow_int__then_6.mcfunction +4 -0
  1115. package/dist/data/readme_demo/function/quadratic_disc.mcfunction +12 -0
  1116. package/dist/data/readme_demo/function/quadratic_x1.mcfunction +7 -0
  1117. package/dist/data/readme_demo/function/quadratic_x1__merge_1.mcfunction +13 -0
  1118. package/dist/data/readme_demo/function/quadratic_x1__merge_4.mcfunction +15 -0
  1119. package/dist/data/readme_demo/function/quadratic_x1__then_0.mcfunction +2 -0
  1120. package/dist/data/readme_demo/function/quadratic_x1__then_3.mcfunction +2 -0
  1121. package/dist/data/readme_demo/function/quadratic_x2.mcfunction +7 -0
  1122. package/dist/data/readme_demo/function/quadratic_x2__merge_1.mcfunction +13 -0
  1123. package/dist/data/readme_demo/function/quadratic_x2__merge_4.mcfunction +15 -0
  1124. package/dist/data/readme_demo/function/quadratic_x2__then_0.mcfunction +2 -0
  1125. package/dist/data/readme_demo/function/quadratic_x2__then_3.mcfunction +2 -0
  1126. package/dist/data/readme_demo/function/sign.mcfunction +5 -0
  1127. package/dist/data/readme_demo/function/sign__merge_1.mcfunction +4 -0
  1128. package/dist/data/readme_demo/function/sign__merge_4.mcfunction +2 -0
  1129. package/dist/data/readme_demo/function/sign__then_0.mcfunction +2 -0
  1130. package/dist/data/readme_demo/function/sign__then_3.mcfunction +2 -0
  1131. package/dist/data/readme_demo/function/simpson_step.mcfunction +16 -0
  1132. package/dist/data/readme_demo/function/sin_fixed.mcfunction +9 -0
  1133. package/dist/data/readme_demo/function/sin_fixed__merge_1.mcfunction +4 -0
  1134. package/dist/data/readme_demo/function/sin_fixed__merge_3.mcfunction +4 -0
  1135. package/dist/data/readme_demo/function/sin_fixed__merge_6.mcfunction +4 -0
  1136. package/dist/data/readme_demo/function/sin_fixed__merge_9.mcfunction +10 -0
  1137. package/dist/data/readme_demo/function/sin_fixed__then_0.mcfunction +4 -0
  1138. package/dist/data/readme_demo/function/sin_fixed__then_2.mcfunction +6 -0
  1139. package/dist/data/readme_demo/function/sin_fixed__then_5.mcfunction +8 -0
  1140. package/dist/data/readme_demo/function/sin_fixed__then_8.mcfunction +10 -0
  1141. package/dist/data/readme_demo/function/smootherstep.mcfunction +10 -0
  1142. package/dist/data/readme_demo/function/smootherstep__merge_1.mcfunction +12 -0
  1143. package/dist/data/readme_demo/function/smootherstep__merge_4.mcfunction +4 -0
  1144. package/dist/data/readme_demo/function/smootherstep__merge_6.mcfunction +27 -0
  1145. package/dist/data/readme_demo/function/smootherstep__then_0.mcfunction +2 -0
  1146. package/dist/data/readme_demo/function/smootherstep__then_3.mcfunction +2 -0
  1147. package/dist/data/readme_demo/function/smootherstep__then_5.mcfunction +2 -0
  1148. package/dist/data/readme_demo/function/smoothstep.mcfunction +10 -0
  1149. package/dist/data/readme_demo/function/smoothstep__merge_1.mcfunction +12 -0
  1150. package/dist/data/readme_demo/function/smoothstep__merge_4.mcfunction +4 -0
  1151. package/dist/data/readme_demo/function/smoothstep__merge_6.mcfunction +15 -0
  1152. package/dist/data/readme_demo/function/smoothstep__then_0.mcfunction +2 -0
  1153. package/dist/data/readme_demo/function/smoothstep__then_3.mcfunction +2 -0
  1154. package/dist/data/readme_demo/function/smoothstep__then_5.mcfunction +2 -0
  1155. package/dist/data/readme_demo/function/solve2x2_x.mcfunction +17 -0
  1156. package/dist/data/readme_demo/function/solve2x2_x__merge_1.mcfunction +12 -0
  1157. package/dist/data/readme_demo/function/solve2x2_x__then_0.mcfunction +2 -0
  1158. package/dist/data/readme_demo/function/solve2x2_y.mcfunction +17 -0
  1159. package/dist/data/readme_demo/function/solve2x2_y__merge_1.mcfunction +12 -0
  1160. package/dist/data/readme_demo/function/solve2x2_y__then_0.mcfunction +2 -0
  1161. package/dist/data/readme_demo/function/sqrt_fixed.mcfunction +8 -0
  1162. package/dist/data/readme_demo/function/sqrt_fx.mcfunction +8 -0
  1163. package/dist/data/readme_demo/function/start.mcfunction +2 -0
  1164. package/dist/data/readme_demo/function/stop.mcfunction +1 -0
  1165. package/dist/data/readme_demo/function/trapezoid_step.mcfunction +11 -0
  1166. package/dist/data/reqtest/function/__load.mcfunction +4 -0
  1167. package/dist/data/reqtest/function/_table_init.mcfunction +2 -0
  1168. package/dist/data/reqtest/function/no_trig.mcfunction +3 -0
  1169. package/dist/data/reqtest/function/use_table.mcfunction +4 -0
  1170. package/dist/data/reqtest2/function/__load.mcfunction +3 -0
  1171. package/dist/data/reqtest2/function/no_trig.mcfunction +3 -0
  1172. package/dist/data/runtime/function/__load.mcfunction +5 -0
  1173. package/dist/data/runtime/function/__tick.mcfunction +2 -0
  1174. package/dist/data/runtime/function/counter_tick/then_0.mcfunction +3 -0
  1175. package/dist/data/runtime/function/counter_tick.mcfunction +13 -0
  1176. package/dist/data/shop/function/__load.mcfunction +7 -0
  1177. package/dist/data/shop/function/__tick.mcfunction +3 -0
  1178. package/dist/data/shop/function/__trigger_shop_buy_dispatch.mcfunction +4 -0
  1179. package/dist/data/shop/function/complete_purchase/else_1.mcfunction +5 -0
  1180. package/dist/data/shop/function/complete_purchase/else_4.mcfunction +5 -0
  1181. package/dist/data/shop/function/complete_purchase/else_7.mcfunction +3 -0
  1182. package/dist/data/shop/function/complete_purchase/merge_2.mcfunction +2 -0
  1183. package/dist/data/shop/function/complete_purchase/merge_5.mcfunction +2 -0
  1184. package/dist/data/shop/function/complete_purchase/merge_8.mcfunction +2 -0
  1185. package/dist/data/shop/function/complete_purchase/then_0.mcfunction +4 -0
  1186. package/dist/data/shop/function/complete_purchase/then_3.mcfunction +4 -0
  1187. package/dist/data/shop/function/complete_purchase/then_6.mcfunction +4 -0
  1188. package/dist/data/shop/function/complete_purchase.mcfunction +7 -0
  1189. package/dist/data/shop/function/handle_shop_trigger.mcfunction +3 -0
  1190. package/dist/data/stdextra/function/__load.mcfunction +2 -0
  1191. package/dist/data/stdextra/function/load.mcfunction +1 -0
  1192. package/dist/data/stdextra/function/test_bigint.mcfunction +52 -0
  1193. package/dist/data/stdextra/function/test_bits.mcfunction +33 -0
  1194. package/dist/data/stdextra/function/test_list_sort.mcfunction +55 -0
  1195. package/dist/data/stdextra/function/test_random.mcfunction +17 -0
  1196. package/dist/data/stdextra/function/test_random__merge_1.mcfunction +4 -0
  1197. package/dist/data/stdextra/function/test_random__merge_11.mcfunction +1 -0
  1198. package/dist/data/stdextra/function/test_random__merge_3.mcfunction +14 -0
  1199. package/dist/data/stdextra/function/test_random__merge_5.mcfunction +8 -0
  1200. package/dist/data/stdextra/function/test_random__merge_7.mcfunction +1 -0
  1201. package/dist/data/stdextra/function/test_random__merge_9.mcfunction +1 -0
  1202. package/dist/data/stdextra/function/test_random__then_0.mcfunction +4 -0
  1203. package/dist/data/stdextra/function/test_random__then_10.mcfunction +2 -0
  1204. package/dist/data/stdextra/function/test_random__then_2.mcfunction +2 -0
  1205. package/dist/data/stdextra/function/test_random__then_4.mcfunction +4 -0
  1206. package/dist/data/stdextra/function/test_random__then_6.mcfunction +2 -0
  1207. package/dist/data/stdextra/function/test_random__then_8.mcfunction +4 -0
  1208. package/dist/data/swap_test/function/__load.mcfunction +3 -0
  1209. package/dist/data/swap_test/function/gcd_old/loop_body_1.mcfunction +7 -0
  1210. package/dist/data/swap_test/function/gcd_old/loop_check_0.mcfunction +5 -0
  1211. package/dist/data/swap_test/function/gcd_old/loop_exit_2.mcfunction +3 -0
  1212. package/dist/data/swap_test/function/gcd_old.mcfunction +8 -0
  1213. package/dist/data/test/function/__dyn_idx_test_arrays_a.mcfunction +1 -0
  1214. package/dist/data/test/function/__dyn_idx_test_arrays_b.mcfunction +1 -0
  1215. package/dist/data/test/function/__dyn_idx_test_arrays_c.mcfunction +1 -0
  1216. package/dist/data/test/function/__dyn_idx_test_arrays_counter.mcfunction +1 -0
  1217. package/dist/data/test/function/__dyn_idx_test_arrays_d.mcfunction +1 -0
  1218. package/dist/data/test/function/__dyn_idx_test_arrays_e.mcfunction +1 -0
  1219. package/dist/data/test/function/__dyn_idx_test_arrays_g.mcfunction +1 -0
  1220. package/dist/data/test/function/__dyn_idx_test_arrays_h.mcfunction +1 -0
  1221. package/dist/data/test/function/__dyn_idx_test_arrays_nums.mcfunction +1 -0
  1222. package/dist/data/test/function/__dyn_idx_test_arrays_one.mcfunction +1 -0
  1223. package/dist/data/test/function/__dyn_idx_test_arrays_parent.mcfunction +1 -0
  1224. package/dist/data/test/function/__dyn_idx_test_arrays_queue.mcfunction +1 -0
  1225. package/dist/data/test/function/__dyn_idx_test_arrays_rev.mcfunction +1 -0
  1226. package/dist/data/test/function/__dyn_idx_test_arrays_visited.mcfunction +1 -0
  1227. package/dist/data/test/function/__dyn_wrt_test_arrays_f.mcfunction +1 -0
  1228. package/dist/data/test/function/__dyn_wrt_test_arrays_parent.mcfunction +1 -0
  1229. package/dist/data/test/function/__dyn_wrt_test_arrays_r.mcfunction +1 -0
  1230. package/dist/data/test/function/__dyn_wrt_test_arrays_s.mcfunction +1 -0
  1231. package/dist/data/test/function/__dyn_wrt_test_arrays_visited.mcfunction +1 -0
  1232. package/dist/data/test/function/_apply.mcfunction +5 -0
  1233. package/dist/data/test/function/_atan_init.mcfunction +4 -0
  1234. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1.mcfunction +2 -0
  1235. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1.mcfunction +17 -0
  1236. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_continue.mcfunction +1 -0
  1237. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_yield.mcfunction +1 -0
  1238. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0.mcfunction +4 -0
  1239. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0_exit.mcfunction +1 -0
  1240. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2.mcfunction +2 -0
  1241. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__else_8.mcfunction +19 -0
  1242. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_body_4.mcfunction +9 -0
  1243. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3.mcfunction +3 -0
  1244. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3_exit.mcfunction +1 -0
  1245. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_10.mcfunction +11 -0
  1246. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_12.mcfunction +1 -0
  1247. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_14.mcfunction +11 -0
  1248. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_16.mcfunction +1 -0
  1249. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_18.mcfunction +11 -0
  1250. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_20.mcfunction +1 -0
  1251. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_22.mcfunction +1 -0
  1252. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_24.mcfunction +1 -0
  1253. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7.mcfunction +6 -0
  1254. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_continue.mcfunction +1 -0
  1255. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_yield.mcfunction +1 -0
  1256. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_11.mcfunction +15 -0
  1257. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_13.mcfunction +13 -0
  1258. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_15.mcfunction +15 -0
  1259. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_17.mcfunction +13 -0
  1260. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_19.mcfunction +15 -0
  1261. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_21.mcfunction +13 -0
  1262. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_23.mcfunction +15 -0
  1263. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_6.mcfunction +2 -0
  1264. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_9.mcfunction +13 -0
  1265. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3.mcfunction +2 -0
  1266. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__else_32.mcfunction +4 -0
  1267. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_body_28.mcfunction +6 -0
  1268. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27.mcfunction +4 -0
  1269. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27_exit.mcfunction +1 -0
  1270. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31.mcfunction +6 -0
  1271. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_continue.mcfunction +1 -0
  1272. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_yield.mcfunction +1 -0
  1273. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__then_30.mcfunction +2 -0
  1274. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4.mcfunction +2 -0
  1275. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34.mcfunction +16 -0
  1276. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_continue.mcfunction +1 -0
  1277. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_yield.mcfunction +1 -0
  1278. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33.mcfunction +4 -0
  1279. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33_exit.mcfunction +1 -0
  1280. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5.mcfunction +16 -0
  1281. package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5__merge_26.mcfunction +1 -0
  1282. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick.mcfunction +4 -0
  1283. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_1.mcfunction +1 -0
  1284. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_2.mcfunction +1 -0
  1285. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_3.mcfunction +1 -0
  1286. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_4.mcfunction +1 -0
  1287. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_5.mcfunction +1 -0
  1288. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_2.mcfunction +4 -0
  1289. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_3.mcfunction +4 -0
  1290. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_4.mcfunction +4 -0
  1291. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_5.mcfunction +4 -0
  1292. package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__done.mcfunction +1 -0
  1293. package/dist/data/test/function/_divider.mcfunction +1 -0
  1294. package/dist/data/test/function/_dump_advanced_phase.mcfunction +4 -0
  1295. package/dist/data/test/function/_dump_advanced_phase__loop_body_1.mcfunction +7 -0
  1296. package/dist/data/test/function/_dump_advanced_phase__loop_body_6.mcfunction +10 -0
  1297. package/dist/data/test/function/_dump_advanced_phase__loop_exit_2.mcfunction +20 -0
  1298. package/dist/data/test/function/_dump_advanced_phase__loop_exit_7.mcfunction +12 -0
  1299. package/dist/data/test/function/_dump_advanced_phase__loop_header_0.mcfunction +4 -0
  1300. package/dist/data/test/function/_dump_advanced_phase__loop_header_5.mcfunction +4 -0
  1301. package/dist/data/test/function/_dump_advanced_phase__merge_4.mcfunction +4 -0
  1302. package/dist/data/test/function/_dump_advanced_phase__then_3.mcfunction +2 -0
  1303. package/dist/data/test/function/_dump_bigint_phase.mcfunction +28 -0
  1304. package/dist/data/test/function/_dump_math_phase.mcfunction +4 -0
  1305. package/dist/data/test/function/_dump_math_phase__loop_body_1.mcfunction +9 -0
  1306. package/dist/data/test/function/_dump_math_phase__loop_exit_2.mcfunction +18 -0
  1307. package/dist/data/test/function/_dump_math_phase__loop_header_0.mcfunction +4 -0
  1308. package/dist/data/test/function/_fp.mcfunction +2 -0
  1309. package/dist/data/test/function/_hsl_chroma_x.mcfunction +10 -0
  1310. package/dist/data/test/function/_hsl_chroma_x__merge_1.mcfunction +6 -0
  1311. package/dist/data/test/function/_hsl_chroma_x__then_0.mcfunction +4 -0
  1312. package/dist/data/test/function/_math_init.mcfunction +4 -0
  1313. package/dist/data/test/function/_next_phase.mcfunction +1 -0
  1314. package/dist/data/test/function/_section.mcfunction +3 -0
  1315. package/dist/data/test/function/_section__const_0.mcfunction +3 -0
  1316. package/dist/data/test/function/_tick_advanced_live.mcfunction +5 -0
  1317. package/dist/data/test/function/_tick_advanced_live__foreach_t12.mcfunction +1 -0
  1318. package/dist/data/test/function/_tick_bigint_live.mcfunction +8 -0
  1319. package/dist/data/test/function/_tick_bigint_live__foreach_t11.mcfunction +1 -0
  1320. package/dist/data/test/function/_tick_math.mcfunction +9 -0
  1321. package/dist/data/test/function/_tick_math__foreach_t12.mcfunction +1 -0
  1322. package/dist/data/test/function/_tick_visual.mcfunction +11 -0
  1323. package/dist/data/test/function/_tick_visual__foreach_t12.mcfunction +1 -0
  1324. package/dist/data/test/function/_tick_visual__foreach_t16.mcfunction +8 -0
  1325. package/dist/data/test/function/_tick_visual__foreach_t17.mcfunction +8 -0
  1326. package/dist/data/test/function/_tick_visual__foreach_t21.mcfunction +1 -0
  1327. package/dist/data/test/function/aabb_contains.mcfunction +12 -0
  1328. package/dist/data/test/function/aabb_contains__merge_1.mcfunction +3 -0
  1329. package/dist/data/test/function/aabb_contains__merge_10.mcfunction +3 -0
  1330. package/dist/data/test/function/aabb_contains__merge_13.mcfunction +3 -0
  1331. package/dist/data/test/function/aabb_contains__merge_16.mcfunction +2 -0
  1332. package/dist/data/test/function/aabb_contains__merge_4.mcfunction +3 -0
  1333. package/dist/data/test/function/aabb_contains__merge_7.mcfunction +3 -0
  1334. package/dist/data/test/function/aabb_contains__then_0.mcfunction +2 -0
  1335. package/dist/data/test/function/aabb_contains__then_12.mcfunction +2 -0
  1336. package/dist/data/test/function/aabb_contains__then_15.mcfunction +2 -0
  1337. package/dist/data/test/function/aabb_contains__then_3.mcfunction +2 -0
  1338. package/dist/data/test/function/aabb_contains__then_6.mcfunction +2 -0
  1339. package/dist/data/test/function/aabb_contains__then_9.mcfunction +2 -0
  1340. package/dist/data/test/function/acos_approx.mcfunction +7 -0
  1341. package/dist/data/test/function/add2d_x.mcfunction +5 -0
  1342. package/dist/data/test/function/add2d_y.mcfunction +5 -0
  1343. package/dist/data/test/function/add3d_x.mcfunction +5 -0
  1344. package/dist/data/test/function/add3d_y.mcfunction +5 -0
  1345. package/dist/data/test/function/add3d_z.mcfunction +5 -0
  1346. package/dist/data/test/function/add_to_team.mcfunction +5 -0
  1347. package/dist/data/test/function/air_drag_fx.mcfunction +2 -0
  1348. package/dist/data/test/function/angle_between.mcfunction +28 -0
  1349. package/dist/data/test/function/angle_between__and_false_2.mcfunction +2 -0
  1350. package/dist/data/test/function/angle_between__and_false_8.mcfunction +2 -0
  1351. package/dist/data/test/function/angle_between__and_merge_1.mcfunction +2 -0
  1352. package/dist/data/test/function/angle_between__and_merge_7.mcfunction +2 -0
  1353. package/dist/data/test/function/angle_between__and_right_0.mcfunction +4 -0
  1354. package/dist/data/test/function/angle_between__and_right_6.mcfunction +4 -0
  1355. package/dist/data/test/function/angle_between__merge_10.mcfunction +26 -0
  1356. package/dist/data/test/function/angle_between__merge_4.mcfunction +4 -0
  1357. package/dist/data/test/function/angle_between__then_3.mcfunction +2 -0
  1358. package/dist/data/test/function/angle_between__then_9.mcfunction +2 -0
  1359. package/dist/data/test/function/angle_diff.mcfunction +12 -0
  1360. package/dist/data/test/function/angle_diff__merge_1.mcfunction +1 -0
  1361. package/dist/data/test/function/angle_diff__then_0.mcfunction +4 -0
  1362. package/dist/data/test/function/angle_normalize.mcfunction +3 -0
  1363. package/dist/data/test/function/angle_normalize__loop_body_1.mcfunction +4 -0
  1364. package/dist/data/test/function/angle_normalize__loop_body_4.mcfunction +4 -0
  1365. package/dist/data/test/function/angle_normalize__loop_exit_2.mcfunction +1 -0
  1366. package/dist/data/test/function/angle_normalize__loop_exit_5.mcfunction +1 -0
  1367. package/dist/data/test/function/angle_normalize__loop_header_0.mcfunction +4 -0
  1368. package/dist/data/test/function/angle_normalize__loop_header_3.mcfunction +4 -0
  1369. package/dist/data/test/function/angry_at.mcfunction +1 -0
  1370. package/dist/data/test/function/apply_damage.mcfunction +12 -0
  1371. package/dist/data/test/function/apply_damage__else_2.mcfunction +2 -0
  1372. package/dist/data/test/function/apply_damage__merge_1.mcfunction +1 -0
  1373. package/dist/data/test/function/apply_damage__then_0.mcfunction +2 -0
  1374. package/dist/data/test/function/apply_drag.mcfunction +8 -0
  1375. package/dist/data/test/function/apply_gravity.mcfunction +6 -0
  1376. package/dist/data/test/function/approx_eq.mcfunction +10 -0
  1377. package/dist/data/test/function/approx_eq__merge_1.mcfunction +3 -0
  1378. package/dist/data/test/function/approx_eq__merge_3.mcfunction +2 -0
  1379. package/dist/data/test/function/approx_eq__then_0.mcfunction +4 -0
  1380. package/dist/data/test/function/approx_eq__then_2.mcfunction +2 -0
  1381. package/dist/data/test/function/arr_test.mcfunction +4 -0
  1382. package/dist/data/test/function/asin_approx.mcfunction +5 -0
  1383. package/dist/data/test/function/asin_approx__merge_1.mcfunction +3 -0
  1384. package/dist/data/test/function/asin_approx__merge_10.mcfunction +5 -0
  1385. package/dist/data/test/function/asin_approx__merge_4.mcfunction +12 -0
  1386. package/dist/data/test/function/asin_approx__merge_7.mcfunction +14 -0
  1387. package/dist/data/test/function/asin_approx__then_0.mcfunction +2 -0
  1388. package/dist/data/test/function/asin_approx__then_3.mcfunction +2 -0
  1389. package/dist/data/test/function/asin_approx__then_6.mcfunction +2 -0
  1390. package/dist/data/test/function/asin_approx__then_9.mcfunction +2 -0
  1391. package/dist/data/test/function/atan2_fixed.mcfunction +6 -0
  1392. package/dist/data/test/function/atan2_fixed__else_30.mcfunction +2 -0
  1393. package/dist/data/test/function/atan2_fixed__loop_body_26.mcfunction +21 -0
  1394. package/dist/data/test/function/atan2_fixed__loop_exit_27.mcfunction +5 -0
  1395. package/dist/data/test/function/atan2_fixed__loop_header_25.mcfunction +3 -0
  1396. package/dist/data/test/function/atan2_fixed__merge_1.mcfunction +4 -0
  1397. package/dist/data/test/function/atan2_fixed__merge_10.mcfunction +5 -0
  1398. package/dist/data/test/function/atan2_fixed__merge_12.mcfunction +2 -0
  1399. package/dist/data/test/function/atan2_fixed__merge_16.mcfunction +5 -0
  1400. package/dist/data/test/function/atan2_fixed__merge_18.mcfunction +4 -0
  1401. package/dist/data/test/function/atan2_fixed__merge_20.mcfunction +4 -0
  1402. package/dist/data/test/function/atan2_fixed__merge_22.mcfunction +4 -0
  1403. package/dist/data/test/function/atan2_fixed__merge_24.mcfunction +3 -0
  1404. package/dist/data/test/function/atan2_fixed__merge_29.mcfunction +1 -0
  1405. package/dist/data/test/function/atan2_fixed__merge_3.mcfunction +4 -0
  1406. package/dist/data/test/function/atan2_fixed__merge_32.mcfunction +4 -0
  1407. package/dist/data/test/function/atan2_fixed__merge_34.mcfunction +4 -0
  1408. package/dist/data/test/function/atan2_fixed__merge_36.mcfunction +3 -0
  1409. package/dist/data/test/function/atan2_fixed__merge_40.mcfunction +3 -0
  1410. package/dist/data/test/function/atan2_fixed__merge_6.mcfunction +2 -0
  1411. package/dist/data/test/function/atan2_fixed__then_0.mcfunction +4 -0
  1412. package/dist/data/test/function/atan2_fixed__then_11.mcfunction +2 -0
  1413. package/dist/data/test/function/atan2_fixed__then_15.mcfunction +4 -0
  1414. package/dist/data/test/function/atan2_fixed__then_17.mcfunction +4 -0
  1415. package/dist/data/test/function/atan2_fixed__then_19.mcfunction +2 -0
  1416. package/dist/data/test/function/atan2_fixed__then_2.mcfunction +2 -0
  1417. package/dist/data/test/function/atan2_fixed__then_21.mcfunction +2 -0
  1418. package/dist/data/test/function/atan2_fixed__then_23.mcfunction +5 -0
  1419. package/dist/data/test/function/atan2_fixed__then_28.mcfunction +4 -0
  1420. package/dist/data/test/function/atan2_fixed__then_31.mcfunction +4 -0
  1421. package/dist/data/test/function/atan2_fixed__then_33.mcfunction +4 -0
  1422. package/dist/data/test/function/atan2_fixed__then_35.mcfunction +1 -0
  1423. package/dist/data/test/function/atan2_fixed__then_39.mcfunction +3 -0
  1424. package/dist/data/test/function/atan2_fixed__then_5.mcfunction +2 -0
  1425. package/dist/data/test/function/atan2_fixed__then_9.mcfunction +4 -0
  1426. package/dist/data/test/function/avg3.mcfunction +11 -0
  1427. package/dist/data/test/function/avg5.mcfunction +17 -0
  1428. package/dist/data/test/function/barrier_wall.mcfunction +1 -0
  1429. package/dist/data/test/function/bernoulli.mcfunction +12 -0
  1430. package/dist/data/test/function/bernoulli__merge_1.mcfunction +6 -0
  1431. package/dist/data/test/function/bernoulli__merge_3.mcfunction +2 -0
  1432. package/dist/data/test/function/bernoulli__then_0.mcfunction +4 -0
  1433. package/dist/data/test/function/bernoulli__then_2.mcfunction +2 -0
  1434. package/dist/data/test/function/bezier_cubic.mcfunction +36 -0
  1435. package/dist/data/test/function/bezier_quad.mcfunction +20 -0
  1436. package/dist/data/test/function/bigint3_add_hi.mcfunction +11 -0
  1437. package/dist/data/test/function/bigint3_add_lo.mcfunction +8 -0
  1438. package/dist/data/test/function/bigint3_add_mid.mcfunction +11 -0
  1439. package/dist/data/test/function/bigint3_borrow_lo.mcfunction +5 -0
  1440. package/dist/data/test/function/bigint3_borrow_lo__merge_1.mcfunction +2 -0
  1441. package/dist/data/test/function/bigint3_borrow_lo__then_0.mcfunction +2 -0
  1442. package/dist/data/test/function/bigint3_borrow_mid.mcfunction +8 -0
  1443. package/dist/data/test/function/bigint3_borrow_mid__merge_1.mcfunction +2 -0
  1444. package/dist/data/test/function/bigint3_borrow_mid__then_0.mcfunction +2 -0
  1445. package/dist/data/test/function/bigint3_carry_lo.mcfunction +8 -0
  1446. package/dist/data/test/function/bigint3_carry_mid.mcfunction +11 -0
  1447. package/dist/data/test/function/bigint3_cmp.mcfunction +9 -0
  1448. package/dist/data/test/function/bigint3_cmp__merge_1.mcfunction +3 -0
  1449. package/dist/data/test/function/bigint3_cmp__merge_10.mcfunction +3 -0
  1450. package/dist/data/test/function/bigint3_cmp__merge_13.mcfunction +3 -0
  1451. package/dist/data/test/function/bigint3_cmp__merge_16.mcfunction +2 -0
  1452. package/dist/data/test/function/bigint3_cmp__merge_4.mcfunction +3 -0
  1453. package/dist/data/test/function/bigint3_cmp__merge_7.mcfunction +3 -0
  1454. package/dist/data/test/function/bigint3_cmp__then_0.mcfunction +2 -0
  1455. package/dist/data/test/function/bigint3_cmp__then_12.mcfunction +2 -0
  1456. package/dist/data/test/function/bigint3_cmp__then_15.mcfunction +2 -0
  1457. package/dist/data/test/function/bigint3_cmp__then_3.mcfunction +2 -0
  1458. package/dist/data/test/function/bigint3_cmp__then_6.mcfunction +2 -0
  1459. package/dist/data/test/function/bigint3_cmp__then_9.mcfunction +2 -0
  1460. package/dist/data/test/function/bigint3_div_chunk.mcfunction +11 -0
  1461. package/dist/data/test/function/bigint3_mul1_hi.mcfunction +8 -0
  1462. package/dist/data/test/function/bigint3_mul1_lo.mcfunction +8 -0
  1463. package/dist/data/test/function/bigint3_mul1_mid.mcfunction +2 -0
  1464. package/dist/data/test/function/bigint3_rem_chunk.mcfunction +11 -0
  1465. package/dist/data/test/function/bigint3_sub_hi.mcfunction +8 -0
  1466. package/dist/data/test/function/bigint3_sub_lo.mcfunction +5 -0
  1467. package/dist/data/test/function/bigint3_sub_lo__merge_1.mcfunction +5 -0
  1468. package/dist/data/test/function/bigint3_sub_lo__then_0.mcfunction +3 -0
  1469. package/dist/data/test/function/bigint3_sub_mid.mcfunction +12 -0
  1470. package/dist/data/test/function/bigint3_sub_mid__merge_1.mcfunction +1 -0
  1471. package/dist/data/test/function/bigint3_sub_mid__then_0.mcfunction +4 -0
  1472. package/dist/data/test/function/bigint3_to_int32.mcfunction +14 -0
  1473. package/dist/data/test/function/bigint_add.mcfunction +8 -0
  1474. package/dist/data/test/function/bigint_add__arr_a__test_arrays__a__b__test_arrays__b__result__test_arrays__r.mcfunction +6 -0
  1475. package/dist/data/test/function/bigint_add__arr_a__test_arrays__a__b__test_arrays__b__result__test_arrays__r__loop_body_1.mcfunction +22 -0
  1476. package/dist/data/test/function/bigint_add__arr_a__test_arrays__a__b__test_arrays__b__result__test_arrays__r__loop_exit_2.mcfunction +1 -0
  1477. package/dist/data/test/function/bigint_add__arr_a__test_arrays__a__b__test_arrays__b__result__test_arrays__r__loop_header_0.mcfunction +4 -0
  1478. package/dist/data/test/function/bigint_add__arr_a__test_arrays__counter__b__test_arrays__one__result__test_arrays__r.mcfunction +6 -0
  1479. package/dist/data/test/function/bigint_add__arr_a__test_arrays__counter__b__test_arrays__one__result__test_arrays__r__loop_body_1.mcfunction +22 -0
  1480. package/dist/data/test/function/bigint_add__arr_a__test_arrays__counter__b__test_arrays__one__result__test_arrays__r__loop_exit_2.mcfunction +1 -0
  1481. package/dist/data/test/function/bigint_add__arr_a__test_arrays__counter__b__test_arrays__one__result__test_arrays__r__loop_header_0.mcfunction +4 -0
  1482. package/dist/data/test/function/bigint_add__loop_body_1.mcfunction +12 -0
  1483. package/dist/data/test/function/bigint_add__loop_exit_2.mcfunction +1 -0
  1484. package/dist/data/test/function/bigint_add__loop_header_0.mcfunction +4 -0
  1485. package/dist/data/test/function/bigint_base.mcfunction +2 -0
  1486. package/dist/data/test/function/bigint_chunk.mcfunction +2 -0
  1487. package/dist/data/test/function/bigint_cmp.mcfunction +5 -0
  1488. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h.mcfunction +3 -0
  1489. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__loop_body_1.mcfunction +7 -0
  1490. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__loop_exit_2.mcfunction +2 -0
  1491. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__loop_header_0.mcfunction +3 -0
  1492. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__merge_4.mcfunction +7 -0
  1493. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__merge_7.mcfunction +4 -0
  1494. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__then_3.mcfunction +2 -0
  1495. package/dist/data/test/function/bigint_cmp__arr_a__test_arrays__g__b__test_arrays__h__then_6.mcfunction +2 -0
  1496. package/dist/data/test/function/bigint_cmp__loop_body_1.mcfunction +3 -0
  1497. package/dist/data/test/function/bigint_cmp__loop_exit_2.mcfunction +2 -0
  1498. package/dist/data/test/function/bigint_cmp__loop_header_0.mcfunction +3 -0
  1499. package/dist/data/test/function/bigint_cmp__merge_4.mcfunction +3 -0
  1500. package/dist/data/test/function/bigint_cmp__merge_7.mcfunction +4 -0
  1501. package/dist/data/test/function/bigint_cmp__then_3.mcfunction +2 -0
  1502. package/dist/data/test/function/bigint_cmp__then_6.mcfunction +2 -0
  1503. package/dist/data/test/function/bigint_copy.mcfunction +3 -0
  1504. package/dist/data/test/function/bigint_copy__loop_body_1.mcfunction +4 -0
  1505. package/dist/data/test/function/bigint_copy__loop_exit_2.mcfunction +1 -0
  1506. package/dist/data/test/function/bigint_copy__loop_header_0.mcfunction +3 -0
  1507. package/dist/data/test/function/bigint_div_small.mcfunction +6 -0
  1508. package/dist/data/test/function/bigint_div_small__loop_body_1.mcfunction +12 -0
  1509. package/dist/data/test/function/bigint_div_small__loop_exit_2.mcfunction +1 -0
  1510. package/dist/data/test/function/bigint_div_small__loop_header_0.mcfunction +3 -0
  1511. package/dist/data/test/function/bigint_is_zero.mcfunction +4 -0
  1512. package/dist/data/test/function/bigint_is_zero__loop_body_1.mcfunction +4 -0
  1513. package/dist/data/test/function/bigint_is_zero__loop_exit_2.mcfunction +2 -0
  1514. package/dist/data/test/function/bigint_is_zero__loop_header_0.mcfunction +3 -0
  1515. package/dist/data/test/function/bigint_is_zero__merge_4.mcfunction +4 -0
  1516. package/dist/data/test/function/bigint_is_zero__then_3.mcfunction +2 -0
  1517. package/dist/data/test/function/bigint_leading_zeros.mcfunction +5 -0
  1518. package/dist/data/test/function/bigint_leading_zeros__loop_body_1.mcfunction +4 -0
  1519. package/dist/data/test/function/bigint_leading_zeros__loop_exit_2.mcfunction +1 -0
  1520. package/dist/data/test/function/bigint_leading_zeros__loop_header_0.mcfunction +3 -0
  1521. package/dist/data/test/function/bigint_leading_zeros__merge_4.mcfunction +9 -0
  1522. package/dist/data/test/function/bigint_leading_zeros__then_3.mcfunction +1 -0
  1523. package/dist/data/test/function/bigint_mod_small.mcfunction +6 -0
  1524. package/dist/data/test/function/bigint_mod_small__loop_body_1.mcfunction +12 -0
  1525. package/dist/data/test/function/bigint_mod_small__loop_exit_2.mcfunction +1 -0
  1526. package/dist/data/test/function/bigint_mod_small__loop_header_0.mcfunction +3 -0
  1527. package/dist/data/test/function/bigint_mul_small.mcfunction +8 -0
  1528. package/dist/data/test/function/bigint_mul_small__arr_a__test_arrays__e__result__test_arrays__f.mcfunction +7 -0
  1529. package/dist/data/test/function/bigint_mul_small__arr_a__test_arrays__e__result__test_arrays__f__loop_body_1.mcfunction +20 -0
  1530. package/dist/data/test/function/bigint_mul_small__arr_a__test_arrays__e__result__test_arrays__f__loop_exit_2.mcfunction +1 -0
  1531. package/dist/data/test/function/bigint_mul_small__arr_a__test_arrays__e__result__test_arrays__f__loop_header_0.mcfunction +4 -0
  1532. package/dist/data/test/function/bigint_mul_small__loop_body_1.mcfunction +12 -0
  1533. package/dist/data/test/function/bigint_mul_small__loop_exit_2.mcfunction +1 -0
  1534. package/dist/data/test/function/bigint_mul_small__loop_header_0.mcfunction +4 -0
  1535. package/dist/data/test/function/bigint_shift_left.mcfunction +3 -0
  1536. package/dist/data/test/function/bigint_shift_left__loop_body_1.mcfunction +4 -0
  1537. package/dist/data/test/function/bigint_shift_left__loop_exit_2.mcfunction +1 -0
  1538. package/dist/data/test/function/bigint_shift_left__loop_header_0.mcfunction +5 -0
  1539. package/dist/data/test/function/bigint_sub.mcfunction +8 -0
  1540. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s.mcfunction +6 -0
  1541. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__loop_body_1.mcfunction +13 -0
  1542. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__loop_exit_2.mcfunction +1 -0
  1543. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__loop_header_0.mcfunction +4 -0
  1544. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__merge_4.mcfunction +4 -0
  1545. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__merge_6.mcfunction +7 -0
  1546. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__then_3.mcfunction +5 -0
  1547. package/dist/data/test/function/bigint_sub__arr_a__test_arrays__c__b__test_arrays__d__result__test_arrays__s__then_5.mcfunction +2 -0
  1548. package/dist/data/test/function/bigint_sub__loop_body_1.mcfunction +9 -0
  1549. package/dist/data/test/function/bigint_sub__loop_exit_2.mcfunction +1 -0
  1550. package/dist/data/test/function/bigint_sub__loop_header_0.mcfunction +4 -0
  1551. package/dist/data/test/function/bigint_sub__merge_4.mcfunction +4 -0
  1552. package/dist/data/test/function/bigint_sub__merge_6.mcfunction +4 -0
  1553. package/dist/data/test/function/bigint_sub__then_3.mcfunction +5 -0
  1554. package/dist/data/test/function/bigint_sub__then_5.mcfunction +2 -0
  1555. package/dist/data/test/function/bigint_zero.mcfunction +3 -0
  1556. package/dist/data/test/function/bigint_zero__loop_body_1.mcfunction +4 -0
  1557. package/dist/data/test/function/bigint_zero__loop_exit_2.mcfunction +1 -0
  1558. package/dist/data/test/function/bigint_zero__loop_header_0.mcfunction +3 -0
  1559. package/dist/data/test/function/billboard_y.mcfunction +7 -0
  1560. package/dist/data/test/function/bit_and.mcfunction +6 -0
  1561. package/dist/data/test/function/bit_and__loop_body_1.mcfunction +9 -0
  1562. package/dist/data/test/function/bit_and__loop_exit_2.mcfunction +1 -0
  1563. package/dist/data/test/function/bit_and__loop_header_0.mcfunction +4 -0
  1564. package/dist/data/test/function/bit_and__merge_4.mcfunction +8 -0
  1565. package/dist/data/test/function/bit_and__merge_6.mcfunction +1 -0
  1566. package/dist/data/test/function/bit_and__then_3.mcfunction +9 -0
  1567. package/dist/data/test/function/bit_and__then_5.mcfunction +4 -0
  1568. package/dist/data/test/function/bit_clear.mcfunction +5 -0
  1569. package/dist/data/test/function/bit_clear__loop_body_1.mcfunction +8 -0
  1570. package/dist/data/test/function/bit_clear__loop_exit_2.mcfunction +9 -0
  1571. package/dist/data/test/function/bit_clear__loop_header_0.mcfunction +3 -0
  1572. package/dist/data/test/function/bit_clear__merge_4.mcfunction +1 -0
  1573. package/dist/data/test/function/bit_clear__then_3.mcfunction +3 -0
  1574. package/dist/data/test/function/bit_get.mcfunction +5 -0
  1575. package/dist/data/test/function/bit_get__loop_body_1.mcfunction +8 -0
  1576. package/dist/data/test/function/bit_get__loop_exit_2.mcfunction +6 -0
  1577. package/dist/data/test/function/bit_get__loop_header_0.mcfunction +3 -0
  1578. package/dist/data/test/function/bit_not.mcfunction +5 -0
  1579. package/dist/data/test/function/bit_not__loop_body_1.mcfunction +9 -0
  1580. package/dist/data/test/function/bit_not__loop_exit_2.mcfunction +1 -0
  1581. package/dist/data/test/function/bit_not__loop_header_0.mcfunction +4 -0
  1582. package/dist/data/test/function/bit_not__merge_4.mcfunction +8 -0
  1583. package/dist/data/test/function/bit_not__then_3.mcfunction +4 -0
  1584. package/dist/data/test/function/bit_or.mcfunction +6 -0
  1585. package/dist/data/test/function/bit_or__loop_body_1.mcfunction +9 -0
  1586. package/dist/data/test/function/bit_or__loop_exit_2.mcfunction +1 -0
  1587. package/dist/data/test/function/bit_or__loop_header_0.mcfunction +4 -0
  1588. package/dist/data/test/function/bit_or__merge_4.mcfunction +9 -0
  1589. package/dist/data/test/function/bit_or__merge_6.mcfunction +8 -0
  1590. package/dist/data/test/function/bit_or__merge_8.mcfunction +1 -0
  1591. package/dist/data/test/function/bit_or__then_3.mcfunction +4 -0
  1592. package/dist/data/test/function/bit_or__then_5.mcfunction +9 -0
  1593. package/dist/data/test/function/bit_or__then_7.mcfunction +4 -0
  1594. package/dist/data/test/function/bit_set.mcfunction +5 -0
  1595. package/dist/data/test/function/bit_set__loop_body_1.mcfunction +8 -0
  1596. package/dist/data/test/function/bit_set__loop_exit_2.mcfunction +9 -0
  1597. package/dist/data/test/function/bit_set__loop_header_0.mcfunction +3 -0
  1598. package/dist/data/test/function/bit_set__merge_4.mcfunction +1 -0
  1599. package/dist/data/test/function/bit_set__then_3.mcfunction +3 -0
  1600. package/dist/data/test/function/bit_shl.mcfunction +5 -0
  1601. package/dist/data/test/function/bit_shl__loop_body_1.mcfunction +8 -0
  1602. package/dist/data/test/function/bit_shl__loop_exit_2.mcfunction +1 -0
  1603. package/dist/data/test/function/bit_shl__loop_header_0.mcfunction +3 -0
  1604. package/dist/data/test/function/bit_shr.mcfunction +5 -0
  1605. package/dist/data/test/function/bit_shr__loop_body_1.mcfunction +8 -0
  1606. package/dist/data/test/function/bit_shr__loop_exit_2.mcfunction +1 -0
  1607. package/dist/data/test/function/bit_shr__loop_header_0.mcfunction +3 -0
  1608. package/dist/data/test/function/bit_toggle.mcfunction +5 -0
  1609. package/dist/data/test/function/bit_toggle__loop_body_1.mcfunction +8 -0
  1610. package/dist/data/test/function/bit_toggle__loop_exit_2.mcfunction +9 -0
  1611. package/dist/data/test/function/bit_toggle__loop_header_0.mcfunction +3 -0
  1612. package/dist/data/test/function/bit_toggle__merge_4.mcfunction +3 -0
  1613. package/dist/data/test/function/bit_toggle__then_3.mcfunction +3 -0
  1614. package/dist/data/test/function/bit_xor.mcfunction +6 -0
  1615. package/dist/data/test/function/bit_xor__loop_body_1.mcfunction +13 -0
  1616. package/dist/data/test/function/bit_xor__loop_exit_2.mcfunction +1 -0
  1617. package/dist/data/test/function/bit_xor__loop_header_0.mcfunction +4 -0
  1618. package/dist/data/test/function/bit_xor__merge_4.mcfunction +8 -0
  1619. package/dist/data/test/function/bit_xor__then_3.mcfunction +4 -0
  1620. package/dist/data/test/function/bounce_v.mcfunction +10 -0
  1621. package/dist/data/test/function/buff_all.mcfunction +22 -0
  1622. package/dist/data/test/function/cbrt_fx.mcfunction +5 -0
  1623. package/dist/data/test/function/cbrt_fx__loop_body_6.mcfunction +7 -0
  1624. package/dist/data/test/function/cbrt_fx__loop_exit_7.mcfunction +1 -0
  1625. package/dist/data/test/function/cbrt_fx__loop_header_5.mcfunction +4 -0
  1626. package/dist/data/test/function/cbrt_fx__merge_1.mcfunction +8 -0
  1627. package/dist/data/test/function/cbrt_fx__merge_11.mcfunction +5 -0
  1628. package/dist/data/test/function/cbrt_fx__merge_13.mcfunction +4 -0
  1629. package/dist/data/test/function/cbrt_fx__merge_4.mcfunction +2 -0
  1630. package/dist/data/test/function/cbrt_fx__merge_9.mcfunction +13 -0
  1631. package/dist/data/test/function/cbrt_fx__then_0.mcfunction +2 -0
  1632. package/dist/data/test/function/cbrt_fx__then_10.mcfunction +2 -0
  1633. package/dist/data/test/function/cbrt_fx__then_12.mcfunction +2 -0
  1634. package/dist/data/test/function/cbrt_fx__then_3.mcfunction +2 -0
  1635. package/dist/data/test/function/cbrt_fx__then_8.mcfunction +2 -0
  1636. package/dist/data/test/function/cbrt_newton.mcfunction +5 -0
  1637. package/dist/data/test/function/cbrt_newton__else_7.mcfunction +2 -0
  1638. package/dist/data/test/function/cbrt_newton__merge_1.mcfunction +11 -0
  1639. package/dist/data/test/function/cbrt_newton__merge_4.mcfunction +1 -0
  1640. package/dist/data/test/function/cbrt_newton__merge_6.mcfunction +1 -0
  1641. package/dist/data/test/function/cbrt_newton__then_0.mcfunction +2 -0
  1642. package/dist/data/test/function/cbrt_newton__then_3.mcfunction +17 -0
  1643. package/dist/data/test/function/cbrt_newton__then_5.mcfunction +11 -0
  1644. package/dist/data/test/function/ceil_div.mcfunction +9 -0
  1645. package/dist/data/test/function/chebyshev.mcfunction +14 -0
  1646. package/dist/data/test/function/chebyshev3d.mcfunction +19 -0
  1647. package/dist/data/test/function/chebyshev3d__merge_1.mcfunction +4 -0
  1648. package/dist/data/test/function/chebyshev3d__merge_3.mcfunction +4 -0
  1649. package/dist/data/test/function/chebyshev3d__merge_5.mcfunction +4 -0
  1650. package/dist/data/test/function/chebyshev3d__merge_7.mcfunction +3 -0
  1651. package/dist/data/test/function/chebyshev3d__merge_9.mcfunction +1 -0
  1652. package/dist/data/test/function/chebyshev3d__then_0.mcfunction +4 -0
  1653. package/dist/data/test/function/chebyshev3d__then_2.mcfunction +4 -0
  1654. package/dist/data/test/function/chebyshev3d__then_4.mcfunction +4 -0
  1655. package/dist/data/test/function/chebyshev3d__then_6.mcfunction +2 -0
  1656. package/dist/data/test/function/chebyshev3d__then_8.mcfunction +2 -0
  1657. package/dist/data/test/function/chebyshev__merge_1.mcfunction +4 -0
  1658. package/dist/data/test/function/chebyshev__merge_3.mcfunction +3 -0
  1659. package/dist/data/test/function/chebyshev__merge_5.mcfunction +1 -0
  1660. package/dist/data/test/function/chebyshev__then_0.mcfunction +4 -0
  1661. package/dist/data/test/function/chebyshev__then_2.mcfunction +4 -0
  1662. package/dist/data/test/function/chebyshev__then_4.mcfunction +1 -0
  1663. package/dist/data/test/function/check_holding_item.mcfunction +1 -0
  1664. package/dist/data/test/function/check_look_down.mcfunction +1 -0
  1665. package/dist/data/test/function/check_look_down__foreach_t0.mcfunction +2 -0
  1666. package/dist/data/test/function/check_look_straight.mcfunction +1 -0
  1667. package/dist/data/test/function/check_look_straight__foreach_t0.mcfunction +2 -0
  1668. package/dist/data/test/function/check_look_up.mcfunction +1 -0
  1669. package/dist/data/test/function/check_look_up__foreach_t0.mcfunction +2 -0
  1670. package/dist/data/test/function/chunk_hi.mcfunction +5 -0
  1671. package/dist/data/test/function/chunk_lo.mcfunction +5 -0
  1672. package/dist/data/test/function/circular_x.mcfunction +14 -0
  1673. package/dist/data/test/function/circular_z.mcfunction +14 -0
  1674. package/dist/data/test/function/clamp3.mcfunction +7 -0
  1675. package/dist/data/test/function/clamp3__merge_1.mcfunction +4 -0
  1676. package/dist/data/test/function/clamp3__merge_4.mcfunction +1 -0
  1677. package/dist/data/test/function/clamp3__then_0.mcfunction +1 -0
  1678. package/dist/data/test/function/clamp3__then_3.mcfunction +1 -0
  1679. package/dist/data/test/function/clamp_circle_x.mcfunction +13 -0
  1680. package/dist/data/test/function/clamp_circle_x__merge_1.mcfunction +10 -0
  1681. package/dist/data/test/function/clamp_circle_x__then_0.mcfunction +1 -0
  1682. package/dist/data/test/function/clamp_circle_y.mcfunction +13 -0
  1683. package/dist/data/test/function/clamp_circle_y__merge_1.mcfunction +10 -0
  1684. package/dist/data/test/function/clamp_circle_y__then_0.mcfunction +1 -0
  1685. package/dist/data/test/function/clamp_velocity.mcfunction +5 -0
  1686. package/dist/data/test/function/clamp_velocity__merge_1.mcfunction +5 -0
  1687. package/dist/data/test/function/clamp_velocity__merge_4.mcfunction +1 -0
  1688. package/dist/data/test/function/clamp_velocity__then_0.mcfunction +1 -0
  1689. package/dist/data/test/function/clamp_velocity__then_3.mcfunction +3 -0
  1690. package/dist/data/test/function/cleanup_teams.mcfunction +8 -0
  1691. package/dist/data/test/function/clear_area.mcfunction +1 -0
  1692. package/dist/data/test/function/clear_effect.mcfunction +1 -0
  1693. package/dist/data/test/function/clear_effects.mcfunction +1 -0
  1694. package/dist/data/test/function/clear_inventory.mcfunction +1 -0
  1695. package/dist/data/test/function/collatz_steps.mcfunction +5 -0
  1696. package/dist/data/test/function/collatz_steps__else_8.mcfunction +6 -0
  1697. package/dist/data/test/function/collatz_steps__loop_body_4.mcfunction +7 -0
  1698. package/dist/data/test/function/collatz_steps__loop_exit_5.mcfunction +1 -0
  1699. package/dist/data/test/function/collatz_steps__loop_header_3.mcfunction +4 -0
  1700. package/dist/data/test/function/collatz_steps__merge_1.mcfunction +3 -0
  1701. package/dist/data/test/function/collatz_steps__merge_7.mcfunction +4 -0
  1702. package/dist/data/test/function/collatz_steps__then_0.mcfunction +2 -0
  1703. package/dist/data/test/function/collatz_steps__then_6.mcfunction +5 -0
  1704. package/dist/data/test/function/combinations.mcfunction +6 -0
  1705. package/dist/data/test/function/combinations__loop_body_9.mcfunction +15 -0
  1706. package/dist/data/test/function/combinations__loop_exit_10.mcfunction +1 -0
  1707. package/dist/data/test/function/combinations__loop_header_8.mcfunction +3 -0
  1708. package/dist/data/test/function/combinations__merge_1.mcfunction +3 -0
  1709. package/dist/data/test/function/combinations__merge_4.mcfunction +6 -0
  1710. package/dist/data/test/function/combinations__merge_7.mcfunction +3 -0
  1711. package/dist/data/test/function/combinations__then_0.mcfunction +2 -0
  1712. package/dist/data/test/function/combinations__then_3.mcfunction +2 -0
  1713. package/dist/data/test/function/combinations__then_6.mcfunction +4 -0
  1714. package/dist/data/test/function/cooldown_ready.mcfunction +7 -0
  1715. package/dist/data/test/function/cooldown_ready__merge_1.mcfunction +4 -0
  1716. package/dist/data/test/function/cooldown_ready__merge_4.mcfunction +2 -0
  1717. package/dist/data/test/function/cooldown_ready__then_0.mcfunction +2 -0
  1718. package/dist/data/test/function/cooldown_ready__then_3.mcfunction +2 -0
  1719. package/dist/data/test/function/cooldown_start.mcfunction +3 -0
  1720. package/dist/data/test/function/cooldown_tick.mcfunction +7 -0
  1721. package/dist/data/test/function/cooldown_tick__else_5.mcfunction +2 -0
  1722. package/dist/data/test/function/cooldown_tick__merge_1.mcfunction +4 -0
  1723. package/dist/data/test/function/cooldown_tick__merge_4.mcfunction +1 -0
  1724. package/dist/data/test/function/cooldown_tick__merge_7.mcfunction +1 -0
  1725. package/dist/data/test/function/cooldown_tick__then_0.mcfunction +1 -0
  1726. package/dist/data/test/function/cooldown_tick__then_3.mcfunction +7 -0
  1727. package/dist/data/test/function/cooldown_tick__then_6.mcfunction +2 -0
  1728. package/dist/data/test/function/cos_fixed.mcfunction +7 -0
  1729. package/dist/data/test/function/cos_fixed__const_0.mcfunction +5 -0
  1730. package/dist/data/test/function/cos_hp.mcfunction +8 -0
  1731. package/dist/data/test/function/count_digits.mcfunction +6 -0
  1732. package/dist/data/test/function/count_digits__loop_body_6.mcfunction +8 -0
  1733. package/dist/data/test/function/count_digits__loop_exit_7.mcfunction +1 -0
  1734. package/dist/data/test/function/count_digits__loop_header_5.mcfunction +4 -0
  1735. package/dist/data/test/function/count_digits__merge_1.mcfunction +4 -0
  1736. package/dist/data/test/function/count_digits__merge_3.mcfunction +2 -0
  1737. package/dist/data/test/function/count_digits__then_0.mcfunction +4 -0
  1738. package/dist/data/test/function/count_digits__then_2.mcfunction +2 -0
  1739. package/dist/data/test/function/create_blue_team.mcfunction +10 -0
  1740. package/dist/data/test/function/create_green_team.mcfunction +10 -0
  1741. package/dist/data/test/function/create_health_bar.mcfunction +24 -0
  1742. package/dist/data/test/function/create_progress_bar.mcfunction +24 -0
  1743. package/dist/data/test/function/create_red_team.mcfunction +10 -0
  1744. package/dist/data/test/function/create_team.mcfunction +8 -0
  1745. package/dist/data/test/function/create_timer_bar.mcfunction +30 -0
  1746. package/dist/data/test/function/create_yellow_team.mcfunction +10 -0
  1747. package/dist/data/test/function/cross2d.mcfunction +11 -0
  1748. package/dist/data/test/function/cross3d_x.mcfunction +11 -0
  1749. package/dist/data/test/function/cross3d_y.mcfunction +11 -0
  1750. package/dist/data/test/function/cross3d_z.mcfunction +11 -0
  1751. package/dist/data/test/function/cubic_disc_fx.mcfunction +26 -0
  1752. package/dist/data/test/function/cubic_newton.mcfunction +8 -0
  1753. package/dist/data/test/function/cubic_newton__loop_body_1.mcfunction +55 -0
  1754. package/dist/data/test/function/cubic_newton__loop_exit_2.mcfunction +1 -0
  1755. package/dist/data/test/function/cubic_newton__loop_header_0.mcfunction +4 -0
  1756. package/dist/data/test/function/cubic_newton__merge_10.mcfunction +1 -0
  1757. package/dist/data/test/function/cubic_newton__merge_4.mcfunction +4 -0
  1758. package/dist/data/test/function/cubic_newton__merge_6.mcfunction +4 -0
  1759. package/dist/data/test/function/cubic_newton__merge_8.mcfunction +4 -0
  1760. package/dist/data/test/function/cubic_newton__then_3.mcfunction +2 -0
  1761. package/dist/data/test/function/cubic_newton__then_5.mcfunction +13 -0
  1762. package/dist/data/test/function/cubic_newton__then_7.mcfunction +4 -0
  1763. package/dist/data/test/function/cubic_newton__then_9.mcfunction +2 -0
  1764. package/dist/data/test/function/curve_length_2d.mcfunction +6 -0
  1765. package/dist/data/test/function/curve_length_2d__loop_body_1.mcfunction +32 -0
  1766. package/dist/data/test/function/curve_length_2d__loop_exit_2.mcfunction +1 -0
  1767. package/dist/data/test/function/curve_length_2d__loop_header_0.mcfunction +5 -0
  1768. package/dist/data/test/function/cylinder_contains.mcfunction +20 -0
  1769. package/dist/data/test/function/cylinder_contains__merge_1.mcfunction +2 -0
  1770. package/dist/data/test/function/cylinder_contains__then_0.mcfunction +2 -0
  1771. package/dist/data/test/function/damage.mcfunction +9 -0
  1772. package/dist/data/test/function/damage__else_2.mcfunction +2 -0
  1773. package/dist/data/test/function/damage__merge_1.mcfunction +1 -0
  1774. package/dist/data/test/function/damage__then_0.mcfunction +2 -0
  1775. package/dist/data/test/function/debug_bigint.mcfunction +25 -0
  1776. package/dist/data/test/function/deriv_central.mcfunction +7 -0
  1777. package/dist/data/test/function/deriv_central__merge_1.mcfunction +10 -0
  1778. package/dist/data/test/function/deriv_central__then_0.mcfunction +2 -0
  1779. package/dist/data/test/function/deriv_forward.mcfunction +7 -0
  1780. package/dist/data/test/function/deriv_forward__merge_1.mcfunction +8 -0
  1781. package/dist/data/test/function/deriv_forward__then_0.mcfunction +2 -0
  1782. package/dist/data/test/function/digit_sum.mcfunction +6 -0
  1783. package/dist/data/test/function/digit_sum__loop_body_6.mcfunction +11 -0
  1784. package/dist/data/test/function/digit_sum__loop_exit_7.mcfunction +1 -0
  1785. package/dist/data/test/function/digit_sum__loop_header_5.mcfunction +4 -0
  1786. package/dist/data/test/function/digit_sum__merge_1.mcfunction +4 -0
  1787. package/dist/data/test/function/digit_sum__merge_3.mcfunction +2 -0
  1788. package/dist/data/test/function/digit_sum__then_0.mcfunction +4 -0
  1789. package/dist/data/test/function/digit_sum__then_2.mcfunction +2 -0
  1790. package/dist/data/test/function/digital_root.mcfunction +5 -0
  1791. package/dist/data/test/function/digital_root__merge_1.mcfunction +8 -0
  1792. package/dist/data/test/function/digital_root__merge_4.mcfunction +1 -0
  1793. package/dist/data/test/function/digital_root__then_0.mcfunction +2 -0
  1794. package/dist/data/test/function/digital_root__then_3.mcfunction +2 -0
  1795. package/dist/data/test/function/disable_fire_spread.mcfunction +1 -0
  1796. package/dist/data/test/function/disable_keep_inventory.mcfunction +1 -0
  1797. package/dist/data/test/function/disable_mob_griefing.mcfunction +1 -0
  1798. package/dist/data/test/function/distance2d_fixed.mcfunction +13 -0
  1799. package/dist/data/test/function/distance3d_fixed.mcfunction +18 -0
  1800. package/dist/data/test/function/div3_hp.mcfunction +23 -0
  1801. package/dist/data/test/function/div_hp.mcfunction +13 -0
  1802. package/dist/data/test/function/divfix.mcfunction +6 -0
  1803. package/dist/data/test/function/divfix__merge_1.mcfunction +6 -0
  1804. package/dist/data/test/function/divfix__then_0.mcfunction +2 -0
  1805. package/dist/data/test/function/dot2d.mcfunction +11 -0
  1806. package/dist/data/test/function/dot3d.mcfunction +17 -0
  1807. package/dist/data/test/function/draw_circle.mcfunction +8 -0
  1808. package/dist/data/test/function/draw_circle__loop_body_1.mcfunction +34 -0
  1809. package/dist/data/test/function/draw_circle__loop_exit_2.mcfunction +1 -0
  1810. package/dist/data/test/function/draw_circle__loop_header_0.mcfunction +3 -0
  1811. package/dist/data/test/function/draw_helix.mcfunction +10 -0
  1812. package/dist/data/test/function/draw_helix__loop_body_1.mcfunction +42 -0
  1813. package/dist/data/test/function/draw_helix__loop_exit_2.mcfunction +1 -0
  1814. package/dist/data/test/function/draw_helix__loop_header_0.mcfunction +3 -0
  1815. package/dist/data/test/function/draw_line_2d.mcfunction +9 -0
  1816. package/dist/data/test/function/draw_line_2d__loop_body_1.mcfunction +34 -0
  1817. package/dist/data/test/function/draw_line_2d__loop_exit_2.mcfunction +1 -0
  1818. package/dist/data/test/function/draw_line_2d__loop_header_0.mcfunction +3 -0
  1819. package/dist/data/test/function/dump_advanced.mcfunction +1 -0
  1820. package/dist/data/test/function/dump_bigint.mcfunction +1 -0
  1821. package/dist/data/test/function/dump_math.mcfunction +1 -0
  1822. package/dist/data/test/function/ease_in_back.mcfunction +26 -0
  1823. package/dist/data/test/function/ease_in_bounce.mcfunction +9 -0
  1824. package/dist/data/test/function/ease_in_cubic.mcfunction +12 -0
  1825. package/dist/data/test/function/ease_in_expo.mcfunction +5 -0
  1826. package/dist/data/test/function/ease_in_expo__merge_1.mcfunction +11 -0
  1827. package/dist/data/test/function/ease_in_expo__then_0.mcfunction +2 -0
  1828. package/dist/data/test/function/ease_in_out_back.mcfunction +5 -0
  1829. package/dist/data/test/function/ease_in_out_back__merge_1.mcfunction +14 -0
  1830. package/dist/data/test/function/ease_in_out_back__then_0.mcfunction +10 -0
  1831. package/dist/data/test/function/ease_in_out_bounce.mcfunction +5 -0
  1832. package/dist/data/test/function/ease_in_out_bounce__merge_1.mcfunction +14 -0
  1833. package/dist/data/test/function/ease_in_out_bounce__then_0.mcfunction +10 -0
  1834. package/dist/data/test/function/ease_in_out_cubic.mcfunction +5 -0
  1835. package/dist/data/test/function/ease_in_out_cubic__merge_1.mcfunction +17 -0
  1836. package/dist/data/test/function/ease_in_out_cubic__then_0.mcfunction +13 -0
  1837. package/dist/data/test/function/ease_in_out_quad.mcfunction +5 -0
  1838. package/dist/data/test/function/ease_in_out_quad__merge_1.mcfunction +12 -0
  1839. package/dist/data/test/function/ease_in_out_quad__then_0.mcfunction +8 -0
  1840. package/dist/data/test/function/ease_in_out_sine.mcfunction +5 -0
  1841. package/dist/data/test/function/ease_in_out_sine__merge_1.mcfunction +14 -0
  1842. package/dist/data/test/function/ease_in_out_sine__then_0.mcfunction +10 -0
  1843. package/dist/data/test/function/ease_in_quad.mcfunction +7 -0
  1844. package/dist/data/test/function/ease_in_quart.mcfunction +12 -0
  1845. package/dist/data/test/function/ease_in_sine.mcfunction +30 -0
  1846. package/dist/data/test/function/ease_linear.mcfunction +2 -0
  1847. package/dist/data/test/function/ease_out_back.mcfunction +9 -0
  1848. package/dist/data/test/function/ease_out_bounce.mcfunction +6 -0
  1849. package/dist/data/test/function/ease_out_bounce__merge_1.mcfunction +4 -0
  1850. package/dist/data/test/function/ease_out_bounce__merge_4.mcfunction +4 -0
  1851. package/dist/data/test/function/ease_out_bounce__merge_7.mcfunction +15 -0
  1852. package/dist/data/test/function/ease_out_bounce__then_0.mcfunction +11 -0
  1853. package/dist/data/test/function/ease_out_bounce__then_3.mcfunction +15 -0
  1854. package/dist/data/test/function/ease_out_bounce__then_6.mcfunction +15 -0
  1855. package/dist/data/test/function/ease_out_cubic.mcfunction +16 -0
  1856. package/dist/data/test/function/ease_out_expo.mcfunction +5 -0
  1857. package/dist/data/test/function/ease_out_expo__merge_1.mcfunction +8 -0
  1858. package/dist/data/test/function/ease_out_expo__then_0.mcfunction +2 -0
  1859. package/dist/data/test/function/ease_out_quad.mcfunction +11 -0
  1860. package/dist/data/test/function/ease_out_quart.mcfunction +16 -0
  1861. package/dist/data/test/function/ease_out_sine.mcfunction +9 -0
  1862. package/dist/data/test/function/ease_smooth.mcfunction +23 -0
  1863. package/dist/data/test/function/ease_smoother.mcfunction +41 -0
  1864. package/dist/data/test/function/enable_keep_inventory.mcfunction +1 -0
  1865. package/dist/data/test/function/end_sparkles_at.mcfunction +1 -0
  1866. package/dist/data/test/function/enemy_health.mcfunction +2 -0
  1867. package/dist/data/test/function/example_right_click.mcfunction +1 -0
  1868. package/dist/data/test/function/example_right_click__foreach_t0.mcfunction +5 -0
  1869. package/dist/data/test/function/example_right_click__foreach_t0__merge_1.mcfunction +1 -0
  1870. package/dist/data/test/function/example_right_click__foreach_t0__then_0.mcfunction +3 -0
  1871. package/dist/data/test/function/exp_dist_approx.mcfunction +12 -0
  1872. package/dist/data/test/function/exp_dist_approx__merge_1.mcfunction +15 -0
  1873. package/dist/data/test/function/exp_dist_approx__merge_3.mcfunction +10 -0
  1874. package/dist/data/test/function/exp_dist_approx__merge_5.mcfunction +1 -0
  1875. package/dist/data/test/function/exp_dist_approx__then_0.mcfunction +4 -0
  1876. package/dist/data/test/function/exp_dist_approx__then_2.mcfunction +2 -0
  1877. package/dist/data/test/function/exp_dist_approx__then_4.mcfunction +2 -0
  1878. package/dist/data/test/function/exp_fx.mcfunction +16 -0
  1879. package/dist/data/test/function/exp_fx__loop_body_10.mcfunction +8 -0
  1880. package/dist/data/test/function/exp_fx__loop_body_5.mcfunction +8 -0
  1881. package/dist/data/test/function/exp_fx__loop_exit_11.mcfunction +1 -0
  1882. package/dist/data/test/function/exp_fx__loop_exit_6.mcfunction +1 -0
  1883. package/dist/data/test/function/exp_fx__loop_header_4.mcfunction +3 -0
  1884. package/dist/data/test/function/exp_fx__loop_header_9.mcfunction +3 -0
  1885. package/dist/data/test/function/exp_fx__merge_1.mcfunction +47 -0
  1886. package/dist/data/test/function/exp_fx__merge_3.mcfunction +4 -0
  1887. package/dist/data/test/function/exp_fx__merge_8.mcfunction +1 -0
  1888. package/dist/data/test/function/exp_fx__then_0.mcfunction +7 -0
  1889. package/dist/data/test/function/exp_fx__then_2.mcfunction +2 -0
  1890. package/dist/data/test/function/exp_fx__then_7.mcfunction +5 -0
  1891. package/dist/data/test/function/explosion_effect.mcfunction +1 -0
  1892. package/dist/data/test/function/factorial.mcfunction +5 -0
  1893. package/dist/data/test/function/factorial__loop_body_4.mcfunction +7 -0
  1894. package/dist/data/test/function/factorial__loop_exit_5.mcfunction +1 -0
  1895. package/dist/data/test/function/factorial__loop_header_3.mcfunction +3 -0
  1896. package/dist/data/test/function/factorial__merge_1.mcfunction +3 -0
  1897. package/dist/data/test/function/factorial__then_0.mcfunction +2 -0
  1898. package/dist/data/test/function/fbm_1d.mcfunction +9 -0
  1899. package/dist/data/test/function/fbm_1d__loop_body_1.mcfunction +33 -0
  1900. package/dist/data/test/function/fbm_1d__loop_exit_2.mcfunction +4 -0
  1901. package/dist/data/test/function/fbm_1d__loop_header_0.mcfunction +3 -0
  1902. package/dist/data/test/function/fbm_1d__merge_4.mcfunction +6 -0
  1903. package/dist/data/test/function/fbm_1d__then_3.mcfunction +2 -0
  1904. package/dist/data/test/function/fbm_2d.mcfunction +10 -0
  1905. package/dist/data/test/function/fbm_2d__loop_body_1.mcfunction +39 -0
  1906. package/dist/data/test/function/fbm_2d__loop_exit_2.mcfunction +4 -0
  1907. package/dist/data/test/function/fbm_2d__loop_header_0.mcfunction +3 -0
  1908. package/dist/data/test/function/fbm_2d__merge_4.mcfunction +6 -0
  1909. package/dist/data/test/function/fbm_2d__then_3.mcfunction +2 -0
  1910. package/dist/data/test/function/fib.mcfunction +5 -0
  1911. package/dist/data/test/function/fib__loop_body_7.mcfunction +8 -0
  1912. package/dist/data/test/function/fib__loop_exit_8.mcfunction +1 -0
  1913. package/dist/data/test/function/fib__loop_header_6.mcfunction +3 -0
  1914. package/dist/data/test/function/fib__merge_1.mcfunction +4 -0
  1915. package/dist/data/test/function/fib__merge_4.mcfunction +4 -0
  1916. package/dist/data/test/function/fib__then_0.mcfunction +2 -0
  1917. package/dist/data/test/function/fib__then_3.mcfunction +2 -0
  1918. package/dist/data/test/function/flames.mcfunction +1 -0
  1919. package/dist/data/test/function/format_time_h.mcfunction +5 -0
  1920. package/dist/data/test/function/format_time_m.mcfunction +8 -0
  1921. package/dist/data/test/function/format_time_s.mcfunction +8 -0
  1922. package/dist/data/test/function/friction_decel.mcfunction +5 -0
  1923. package/dist/data/test/function/friction_decel__merge_1.mcfunction +5 -0
  1924. package/dist/data/test/function/friction_decel__merge_4.mcfunction +2 -0
  1925. package/dist/data/test/function/friction_decel__then_0.mcfunction +3 -0
  1926. package/dist/data/test/function/friction_decel__then_3.mcfunction +3 -0
  1927. package/dist/data/test/function/gamma_int.mcfunction +5 -0
  1928. package/dist/data/test/function/gamma_int__merge_1.mcfunction +6 -0
  1929. package/dist/data/test/function/gamma_int__then_0.mcfunction +2 -0
  1930. package/dist/data/test/function/gather_all.mcfunction +8 -0
  1931. package/dist/data/test/function/gcd.mcfunction +7 -0
  1932. package/dist/data/test/function/gcd__loop_body_5.mcfunction +5 -0
  1933. package/dist/data/test/function/gcd__loop_exit_6.mcfunction +1 -0
  1934. package/dist/data/test/function/gcd__loop_header_4.mcfunction +4 -0
  1935. package/dist/data/test/function/gcd__merge_1.mcfunction +5 -0
  1936. package/dist/data/test/function/gcd__merge_3.mcfunction +1 -0
  1937. package/dist/data/test/function/gcd__then_0.mcfunction +4 -0
  1938. package/dist/data/test/function/gcd__then_2.mcfunction +4 -0
  1939. package/dist/data/test/function/give_kit_archer.mcfunction +6 -0
  1940. package/dist/data/test/function/give_kit_mage.mcfunction +5 -0
  1941. package/dist/data/test/function/give_kit_warrior.mcfunction +6 -0
  1942. package/dist/data/test/function/glass_box.mcfunction +2 -0
  1943. package/dist/data/test/function/glow.mcfunction +1 -0
  1944. package/dist/data/test/function/goto_arena.mcfunction +7 -0
  1945. package/dist/data/test/function/goto_lobby.mcfunction +7 -0
  1946. package/dist/data/test/function/gravity_fx.mcfunction +2 -0
  1947. package/dist/data/test/function/happy_at.mcfunction +1 -0
  1948. package/dist/data/test/function/hash_1d.mcfunction +15 -0
  1949. package/dist/data/test/function/hash_1d_pos.mcfunction +9 -0
  1950. package/dist/data/test/function/hash_1d_pos__merge_1.mcfunction +4 -0
  1951. package/dist/data/test/function/hash_1d_pos__then_0.mcfunction +4 -0
  1952. package/dist/data/test/function/hash_2d.mcfunction +11 -0
  1953. package/dist/data/test/function/hash_2d_pos.mcfunction +11 -0
  1954. package/dist/data/test/function/hash_2d_pos__merge_1.mcfunction +4 -0
  1955. package/dist/data/test/function/hash_2d_pos__then_0.mcfunction +4 -0
  1956. package/dist/data/test/function/hash_int.mcfunction +6 -0
  1957. package/dist/data/test/function/hash_int__merge_1.mcfunction +14 -0
  1958. package/dist/data/test/function/hash_int__merge_3.mcfunction +14 -0
  1959. package/dist/data/test/function/hash_int__merge_5.mcfunction +1 -0
  1960. package/dist/data/test/function/hash_int__then_0.mcfunction +4 -0
  1961. package/dist/data/test/function/hash_int__then_2.mcfunction +4 -0
  1962. package/dist/data/test/function/hash_int__then_4.mcfunction +4 -0
  1963. package/dist/data/test/function/heal.mcfunction +5 -0
  1964. package/dist/data/test/function/heap_new.mcfunction +7 -0
  1965. package/dist/data/test/function/heap_new__loop_body_1.mcfunction +7 -0
  1966. package/dist/data/test/function/heap_new__loop_exit_2.mcfunction +1 -0
  1967. package/dist/data/test/function/heap_new__loop_header_0.mcfunction +4 -0
  1968. package/dist/data/test/function/heap_peek.mcfunction +2 -0
  1969. package/dist/data/test/function/heap_pop.mcfunction +4 -0
  1970. package/dist/data/test/function/heap_pop__else_13.mcfunction +2 -0
  1971. package/dist/data/test/function/heap_pop__loop_body_1.mcfunction +14 -0
  1972. package/dist/data/test/function/heap_pop__loop_exit_2.mcfunction +1 -0
  1973. package/dist/data/test/function/heap_pop__loop_header_0.mcfunction +4 -0
  1974. package/dist/data/test/function/heap_pop__merge_10.mcfunction +1 -0
  1975. package/dist/data/test/function/heap_pop__merge_12.mcfunction +1 -0
  1976. package/dist/data/test/function/heap_pop__merge_4.mcfunction +3 -0
  1977. package/dist/data/test/function/heap_pop__merge_6.mcfunction +1 -0
  1978. package/dist/data/test/function/heap_pop__merge_8.mcfunction +3 -0
  1979. package/dist/data/test/function/heap_pop__then_11.mcfunction +2 -0
  1980. package/dist/data/test/function/heap_pop__then_3.mcfunction +3 -0
  1981. package/dist/data/test/function/heap_pop__then_5.mcfunction +2 -0
  1982. package/dist/data/test/function/heap_pop__then_7.mcfunction +3 -0
  1983. package/dist/data/test/function/heap_pop__then_9.mcfunction +2 -0
  1984. package/dist/data/test/function/heap_push.mcfunction +6 -0
  1985. package/dist/data/test/function/heap_push__else_5.mcfunction +2 -0
  1986. package/dist/data/test/function/heap_push__else_8.mcfunction +2 -0
  1987. package/dist/data/test/function/heap_push__loop_body_1.mcfunction +4 -0
  1988. package/dist/data/test/function/heap_push__loop_exit_2.mcfunction +1 -0
  1989. package/dist/data/test/function/heap_push__loop_header_0.mcfunction +4 -0
  1990. package/dist/data/test/function/heap_push__merge_4.mcfunction +1 -0
  1991. package/dist/data/test/function/heap_push__merge_7.mcfunction +1 -0
  1992. package/dist/data/test/function/heap_push__then_3.mcfunction +7 -0
  1993. package/dist/data/test/function/heap_push__then_6.mcfunction +2 -0
  1994. package/dist/data/test/function/heap_size.mcfunction +2 -0
  1995. package/dist/data/test/function/hearts_at.mcfunction +1 -0
  1996. package/dist/data/test/function/hide_bar.mcfunction +4 -0
  1997. package/dist/data/test/function/hsl_to_b.mcfunction +23 -0
  1998. package/dist/data/test/function/hsl_to_b__merge_1.mcfunction +29 -0
  1999. package/dist/data/test/function/hsl_to_b__merge_12.mcfunction +4 -0
  2000. package/dist/data/test/function/hsl_to_b__merge_15.mcfunction +3 -0
  2001. package/dist/data/test/function/hsl_to_b__merge_3.mcfunction +4 -0
  2002. package/dist/data/test/function/hsl_to_b__merge_6.mcfunction +4 -0
  2003. package/dist/data/test/function/hsl_to_b__merge_9.mcfunction +4 -0
  2004. package/dist/data/test/function/hsl_to_b__then_0.mcfunction +4 -0
  2005. package/dist/data/test/function/hsl_to_b__then_11.mcfunction +3 -0
  2006. package/dist/data/test/function/hsl_to_b__then_14.mcfunction +3 -0
  2007. package/dist/data/test/function/hsl_to_b__then_2.mcfunction +1 -0
  2008. package/dist/data/test/function/hsl_to_b__then_5.mcfunction +1 -0
  2009. package/dist/data/test/function/hsl_to_b__then_8.mcfunction +3 -0
  2010. package/dist/data/test/function/hsl_to_g.mcfunction +23 -0
  2011. package/dist/data/test/function/hsl_to_g__merge_1.mcfunction +29 -0
  2012. package/dist/data/test/function/hsl_to_g__merge_12.mcfunction +4 -0
  2013. package/dist/data/test/function/hsl_to_g__merge_15.mcfunction +1 -0
  2014. package/dist/data/test/function/hsl_to_g__merge_3.mcfunction +4 -0
  2015. package/dist/data/test/function/hsl_to_g__merge_6.mcfunction +4 -0
  2016. package/dist/data/test/function/hsl_to_g__merge_9.mcfunction +4 -0
  2017. package/dist/data/test/function/hsl_to_g__then_0.mcfunction +4 -0
  2018. package/dist/data/test/function/hsl_to_g__then_11.mcfunction +3 -0
  2019. package/dist/data/test/function/hsl_to_g__then_14.mcfunction +1 -0
  2020. package/dist/data/test/function/hsl_to_g__then_2.mcfunction +3 -0
  2021. package/dist/data/test/function/hsl_to_g__then_5.mcfunction +3 -0
  2022. package/dist/data/test/function/hsl_to_g__then_8.mcfunction +3 -0
  2023. package/dist/data/test/function/hsl_to_packed.mcfunction +24 -0
  2024. package/dist/data/test/function/hsl_to_r.mcfunction +23 -0
  2025. package/dist/data/test/function/hsl_to_r__merge_1.mcfunction +29 -0
  2026. package/dist/data/test/function/hsl_to_r__merge_12.mcfunction +4 -0
  2027. package/dist/data/test/function/hsl_to_r__merge_15.mcfunction +3 -0
  2028. package/dist/data/test/function/hsl_to_r__merge_3.mcfunction +4 -0
  2029. package/dist/data/test/function/hsl_to_r__merge_6.mcfunction +4 -0
  2030. package/dist/data/test/function/hsl_to_r__merge_9.mcfunction +4 -0
  2031. package/dist/data/test/function/hsl_to_r__then_0.mcfunction +4 -0
  2032. package/dist/data/test/function/hsl_to_r__then_11.mcfunction +1 -0
  2033. package/dist/data/test/function/hsl_to_r__then_14.mcfunction +3 -0
  2034. package/dist/data/test/function/hsl_to_r__then_2.mcfunction +3 -0
  2035. package/dist/data/test/function/hsl_to_r__then_5.mcfunction +3 -0
  2036. package/dist/data/test/function/hsl_to_r__then_8.mcfunction +1 -0
  2037. package/dist/data/test/function/impact_velocity.mcfunction +5 -0
  2038. package/dist/data/test/function/impact_velocity__merge_1.mcfunction +16 -0
  2039. package/dist/data/test/function/impact_velocity__then_0.mcfunction +2 -0
  2040. package/dist/data/test/function/init_div.mcfunction +1 -0
  2041. package/dist/data/test/function/init_trig.mcfunction +1 -0
  2042. package/dist/data/test/function/insertion_sort.mcfunction +4 -0
  2043. package/dist/data/test/function/insertion_sort__else_11.mcfunction +2 -0
  2044. package/dist/data/test/function/insertion_sort__else_8.mcfunction +2 -0
  2045. package/dist/data/test/function/insertion_sort__loop_body_1.mcfunction +6 -0
  2046. package/dist/data/test/function/insertion_sort__loop_body_4.mcfunction +4 -0
  2047. package/dist/data/test/function/insertion_sort__loop_exit_2.mcfunction +1 -0
  2048. package/dist/data/test/function/insertion_sort__loop_exit_5.mcfunction +4 -0
  2049. package/dist/data/test/function/insertion_sort__loop_header_0.mcfunction +3 -0
  2050. package/dist/data/test/function/insertion_sort__loop_header_3.mcfunction +4 -0
  2051. package/dist/data/test/function/insertion_sort__merge_10.mcfunction +1 -0
  2052. package/dist/data/test/function/insertion_sort__merge_7.mcfunction +1 -0
  2053. package/dist/data/test/function/insertion_sort__then_6.mcfunction +3 -0
  2054. package/dist/data/test/function/insertion_sort__then_9.mcfunction +4 -0
  2055. package/dist/data/test/function/insertion_sort_desc.mcfunction +4 -0
  2056. package/dist/data/test/function/insertion_sort_desc__else_11.mcfunction +2 -0
  2057. package/dist/data/test/function/insertion_sort_desc__else_8.mcfunction +2 -0
  2058. package/dist/data/test/function/insertion_sort_desc__loop_body_1.mcfunction +6 -0
  2059. package/dist/data/test/function/insertion_sort_desc__loop_body_4.mcfunction +4 -0
  2060. package/dist/data/test/function/insertion_sort_desc__loop_exit_2.mcfunction +1 -0
  2061. package/dist/data/test/function/insertion_sort_desc__loop_exit_5.mcfunction +4 -0
  2062. package/dist/data/test/function/insertion_sort_desc__loop_header_0.mcfunction +3 -0
  2063. package/dist/data/test/function/insertion_sort_desc__loop_header_3.mcfunction +4 -0
  2064. package/dist/data/test/function/insertion_sort_desc__merge_10.mcfunction +1 -0
  2065. package/dist/data/test/function/insertion_sort_desc__merge_7.mcfunction +1 -0
  2066. package/dist/data/test/function/insertion_sort_desc__then_6.mcfunction +3 -0
  2067. package/dist/data/test/function/insertion_sort_desc__then_9.mcfunction +4 -0
  2068. package/dist/data/test/function/int32_to_bigint3_hi.mcfunction +5 -0
  2069. package/dist/data/test/function/int32_to_bigint3_hi__merge_1.mcfunction +4 -0
  2070. package/dist/data/test/function/int32_to_bigint3_hi__then_0.mcfunction +4 -0
  2071. package/dist/data/test/function/int32_to_bigint3_lo.mcfunction +5 -0
  2072. package/dist/data/test/function/int32_to_bigint3_lo__merge_1.mcfunction +4 -0
  2073. package/dist/data/test/function/int32_to_bigint3_lo__then_0.mcfunction +4 -0
  2074. package/dist/data/test/function/int32_to_bigint3_mid.mcfunction +5 -0
  2075. package/dist/data/test/function/int32_to_bigint3_mid__merge_1.mcfunction +7 -0
  2076. package/dist/data/test/function/int32_to_bigint3_mid__then_0.mcfunction +4 -0
  2077. package/dist/data/test/function/integrate_simpson.mcfunction +7 -0
  2078. package/dist/data/test/function/integrate_simpson__loop_body_6.mcfunction +7 -0
  2079. package/dist/data/test/function/integrate_simpson__loop_exit_7.mcfunction +6 -0
  2080. package/dist/data/test/function/integrate_simpson__loop_header_5.mcfunction +5 -0
  2081. package/dist/data/test/function/integrate_simpson__merge_1.mcfunction +8 -0
  2082. package/dist/data/test/function/integrate_simpson__merge_11.mcfunction +4 -0
  2083. package/dist/data/test/function/integrate_simpson__merge_4.mcfunction +5 -0
  2084. package/dist/data/test/function/integrate_simpson__merge_9.mcfunction +7 -0
  2085. package/dist/data/test/function/integrate_simpson__then_0.mcfunction +6 -0
  2086. package/dist/data/test/function/integrate_simpson__then_10.mcfunction +6 -0
  2087. package/dist/data/test/function/integrate_simpson__then_3.mcfunction +4 -0
  2088. package/dist/data/test/function/integrate_simpson__then_8.mcfunction +6 -0
  2089. package/dist/data/test/function/integrate_trapezoid.mcfunction +7 -0
  2090. package/dist/data/test/function/integrate_trapezoid__loop_body_4.mcfunction +7 -0
  2091. package/dist/data/test/function/integrate_trapezoid__loop_exit_5.mcfunction +6 -0
  2092. package/dist/data/test/function/integrate_trapezoid__loop_header_3.mcfunction +5 -0
  2093. package/dist/data/test/function/integrate_trapezoid__merge_1.mcfunction +11 -0
  2094. package/dist/data/test/function/integrate_trapezoid__then_0.mcfunction +2 -0
  2095. package/dist/data/test/function/interactions_init.mcfunction +9 -0
  2096. package/dist/data/test/function/invisible.mcfunction +1 -0
  2097. package/dist/data/test/function/is_grounded.mcfunction +5 -0
  2098. package/dist/data/test/function/is_grounded__merge_1.mcfunction +2 -0
  2099. package/dist/data/test/function/is_grounded__then_0.mcfunction +2 -0
  2100. package/dist/data/test/function/is_op.mcfunction +2 -0
  2101. package/dist/data/test/function/is_op__exec_t1.mcfunction +1 -0
  2102. package/dist/data/test/function/is_prime.mcfunction +5 -0
  2103. package/dist/data/test/function/is_prime__loop_body_10.mcfunction +6 -0
  2104. package/dist/data/test/function/is_prime__loop_exit_11.mcfunction +2 -0
  2105. package/dist/data/test/function/is_prime__loop_header_9.mcfunction +5 -0
  2106. package/dist/data/test/function/is_prime__merge_1.mcfunction +4 -0
  2107. package/dist/data/test/function/is_prime__merge_13.mcfunction +4 -0
  2108. package/dist/data/test/function/is_prime__merge_4.mcfunction +7 -0
  2109. package/dist/data/test/function/is_prime__merge_7.mcfunction +2 -0
  2110. package/dist/data/test/function/is_prime__then_0.mcfunction +2 -0
  2111. package/dist/data/test/function/is_prime__then_12.mcfunction +2 -0
  2112. package/dist/data/test/function/is_prime__then_3.mcfunction +2 -0
  2113. package/dist/data/test/function/is_prime__then_6.mcfunction +2 -0
  2114. package/dist/data/test/function/is_sneaking.mcfunction +5 -0
  2115. package/dist/data/test/function/is_sneaking__merge_1.mcfunction +2 -0
  2116. package/dist/data/test/function/is_sneaking__then_0.mcfunction +2 -0
  2117. package/dist/data/test/function/isqrt.mcfunction +5 -0
  2118. package/dist/data/test/function/isqrt__loop_body_10.mcfunction +8 -0
  2119. package/dist/data/test/function/isqrt__loop_body_13.mcfunction +11 -0
  2120. package/dist/data/test/function/isqrt__loop_body_7.mcfunction +8 -0
  2121. package/dist/data/test/function/isqrt__loop_exit_11.mcfunction +2 -0
  2122. package/dist/data/test/function/isqrt__loop_exit_14.mcfunction +1 -0
  2123. package/dist/data/test/function/isqrt__loop_exit_8.mcfunction +9 -0
  2124. package/dist/data/test/function/isqrt__loop_header_12.mcfunction +4 -0
  2125. package/dist/data/test/function/isqrt__loop_header_6.mcfunction +4 -0
  2126. package/dist/data/test/function/isqrt__loop_header_9.mcfunction +3 -0
  2127. package/dist/data/test/function/isqrt__merge_1.mcfunction +4 -0
  2128. package/dist/data/test/function/isqrt__merge_16.mcfunction +5 -0
  2129. package/dist/data/test/function/isqrt__merge_4.mcfunction +3 -0
  2130. package/dist/data/test/function/isqrt__then_0.mcfunction +2 -0
  2131. package/dist/data/test/function/isqrt__then_15.mcfunction +1 -0
  2132. package/dist/data/test/function/isqrt__then_3.mcfunction +2 -0
  2133. package/dist/data/test/function/julia_iter.mcfunction +9 -0
  2134. package/dist/data/test/function/julia_iter__loop_body_1.mcfunction +36 -0
  2135. package/dist/data/test/function/julia_iter__loop_exit_2.mcfunction +1 -0
  2136. package/dist/data/test/function/julia_iter__loop_header_0.mcfunction +3 -0
  2137. package/dist/data/test/function/julia_iter__merge_4.mcfunction +4 -0
  2138. package/dist/data/test/function/julia_iter__then_3.mcfunction +1 -0
  2139. package/dist/data/test/function/jump.mcfunction +1 -0
  2140. package/dist/data/test/function/lambda_demo.mcfunction +2 -0
  2141. package/dist/data/test/function/launch_up.mcfunction +6 -0
  2142. package/dist/data/test/function/lcm.mcfunction +11 -0
  2143. package/dist/data/test/function/lcm__merge_1.mcfunction +5 -0
  2144. package/dist/data/test/function/lcm__then_0.mcfunction +2 -0
  2145. package/dist/data/test/function/length2d_fixed.mcfunction +15 -0
  2146. package/dist/data/test/function/length3d_fixed.mcfunction +20 -0
  2147. package/dist/data/test/function/lerp.mcfunction +13 -0
  2148. package/dist/data/test/function/lerp2d_x.mcfunction +13 -0
  2149. package/dist/data/test/function/lerp2d_y.mcfunction +13 -0
  2150. package/dist/data/test/function/lerp_angle.mcfunction +7 -0
  2151. package/dist/data/test/function/lerp_angle__loop_body_1.mcfunction +4 -0
  2152. package/dist/data/test/function/lerp_angle__loop_body_4.mcfunction +4 -0
  2153. package/dist/data/test/function/lerp_angle__loop_exit_2.mcfunction +1 -0
  2154. package/dist/data/test/function/lerp_angle__loop_exit_5.mcfunction +8 -0
  2155. package/dist/data/test/function/lerp_angle__loop_header_0.mcfunction +4 -0
  2156. package/dist/data/test/function/lerp_angle__loop_header_3.mcfunction +3 -0
  2157. package/dist/data/test/function/list_avg.mcfunction +9 -0
  2158. package/dist/data/test/function/list_clamp_all.mcfunction +6 -0
  2159. package/dist/data/test/function/list_clamp_all__loop_body_1.mcfunction +4 -0
  2160. package/dist/data/test/function/list_clamp_all__loop_exit_2.mcfunction +1 -0
  2161. package/dist/data/test/function/list_clamp_all__loop_header_0.mcfunction +4 -0
  2162. package/dist/data/test/function/list_clamp_all__merge_4.mcfunction +4 -0
  2163. package/dist/data/test/function/list_clamp_all__merge_6.mcfunction +4 -0
  2164. package/dist/data/test/function/list_clamp_all__then_3.mcfunction +1 -0
  2165. package/dist/data/test/function/list_clamp_all__then_5.mcfunction +1 -0
  2166. package/dist/data/test/function/list_contains.mcfunction +5 -0
  2167. package/dist/data/test/function/list_contains__loop_body_1.mcfunction +4 -0
  2168. package/dist/data/test/function/list_contains__loop_exit_2.mcfunction +2 -0
  2169. package/dist/data/test/function/list_contains__loop_header_0.mcfunction +4 -0
  2170. package/dist/data/test/function/list_contains__merge_4.mcfunction +4 -0
  2171. package/dist/data/test/function/list_contains__then_3.mcfunction +2 -0
  2172. package/dist/data/test/function/list_count_if_gt.mcfunction +6 -0
  2173. package/dist/data/test/function/list_count_if_gt__loop_body_1.mcfunction +4 -0
  2174. package/dist/data/test/function/list_count_if_gt__loop_exit_2.mcfunction +1 -0
  2175. package/dist/data/test/function/list_count_if_gt__loop_header_0.mcfunction +4 -0
  2176. package/dist/data/test/function/list_count_if_gt__merge_4.mcfunction +4 -0
  2177. package/dist/data/test/function/list_count_if_gt__then_3.mcfunction +4 -0
  2178. package/dist/data/test/function/list_fill.mcfunction +3 -0
  2179. package/dist/data/test/function/list_fill__loop_body_1.mcfunction +4 -0
  2180. package/dist/data/test/function/list_fill__loop_exit_2.mcfunction +1 -0
  2181. package/dist/data/test/function/list_fill__loop_header_0.mcfunction +4 -0
  2182. package/dist/data/test/function/list_index_of.mcfunction +5 -0
  2183. package/dist/data/test/function/list_index_of__loop_body_1.mcfunction +4 -0
  2184. package/dist/data/test/function/list_index_of__loop_exit_2.mcfunction +2 -0
  2185. package/dist/data/test/function/list_index_of__loop_header_0.mcfunction +4 -0
  2186. package/dist/data/test/function/list_index_of__merge_4.mcfunction +4 -0
  2187. package/dist/data/test/function/list_index_of__then_3.mcfunction +1 -0
  2188. package/dist/data/test/function/list_max.mcfunction +5 -0
  2189. package/dist/data/test/function/list_max3.mcfunction +7 -0
  2190. package/dist/data/test/function/list_max3__merge_1.mcfunction +3 -0
  2191. package/dist/data/test/function/list_max3__merge_3.mcfunction +1 -0
  2192. package/dist/data/test/function/list_max3__then_0.mcfunction +2 -0
  2193. package/dist/data/test/function/list_max3__then_2.mcfunction +2 -0
  2194. package/dist/data/test/function/list_max5.mcfunction +9 -0
  2195. package/dist/data/test/function/list_max5__merge_1.mcfunction +3 -0
  2196. package/dist/data/test/function/list_max5__merge_3.mcfunction +3 -0
  2197. package/dist/data/test/function/list_max5__merge_5.mcfunction +3 -0
  2198. package/dist/data/test/function/list_max5__merge_7.mcfunction +1 -0
  2199. package/dist/data/test/function/list_max5__then_0.mcfunction +2 -0
  2200. package/dist/data/test/function/list_max5__then_2.mcfunction +2 -0
  2201. package/dist/data/test/function/list_max5__then_4.mcfunction +2 -0
  2202. package/dist/data/test/function/list_max5__then_6.mcfunction +2 -0
  2203. package/dist/data/test/function/list_max__loop_body_1.mcfunction +4 -0
  2204. package/dist/data/test/function/list_max__loop_exit_2.mcfunction +1 -0
  2205. package/dist/data/test/function/list_max__loop_header_0.mcfunction +4 -0
  2206. package/dist/data/test/function/list_max__merge_4.mcfunction +4 -0
  2207. package/dist/data/test/function/list_max__then_3.mcfunction +2 -0
  2208. package/dist/data/test/function/list_min.mcfunction +5 -0
  2209. package/dist/data/test/function/list_min3.mcfunction +7 -0
  2210. package/dist/data/test/function/list_min3__merge_1.mcfunction +3 -0
  2211. package/dist/data/test/function/list_min3__merge_3.mcfunction +1 -0
  2212. package/dist/data/test/function/list_min3__then_0.mcfunction +2 -0
  2213. package/dist/data/test/function/list_min3__then_2.mcfunction +2 -0
  2214. package/dist/data/test/function/list_min5.mcfunction +9 -0
  2215. package/dist/data/test/function/list_min5__merge_1.mcfunction +3 -0
  2216. package/dist/data/test/function/list_min5__merge_3.mcfunction +3 -0
  2217. package/dist/data/test/function/list_min5__merge_5.mcfunction +3 -0
  2218. package/dist/data/test/function/list_min5__merge_7.mcfunction +1 -0
  2219. package/dist/data/test/function/list_min5__then_0.mcfunction +2 -0
  2220. package/dist/data/test/function/list_min5__then_2.mcfunction +2 -0
  2221. package/dist/data/test/function/list_min5__then_4.mcfunction +2 -0
  2222. package/dist/data/test/function/list_min5__then_6.mcfunction +2 -0
  2223. package/dist/data/test/function/list_min__loop_body_1.mcfunction +4 -0
  2224. package/dist/data/test/function/list_min__loop_exit_2.mcfunction +1 -0
  2225. package/dist/data/test/function/list_min__loop_header_0.mcfunction +4 -0
  2226. package/dist/data/test/function/list_min__merge_4.mcfunction +4 -0
  2227. package/dist/data/test/function/list_min__then_3.mcfunction +2 -0
  2228. package/dist/data/test/function/list_reverse.mcfunction +6 -0
  2229. package/dist/data/test/function/list_reverse__loop_body_1.mcfunction +9 -0
  2230. package/dist/data/test/function/list_reverse__loop_exit_2.mcfunction +1 -0
  2231. package/dist/data/test/function/list_reverse__loop_header_0.mcfunction +4 -0
  2232. package/dist/data/test/function/list_sort_asc.mcfunction +4 -0
  2233. package/dist/data/test/function/list_sort_asc__loop_body_1.mcfunction +2 -0
  2234. package/dist/data/test/function/list_sort_asc__loop_body_4.mcfunction +3 -0
  2235. package/dist/data/test/function/list_sort_asc__loop_exit_2.mcfunction +1 -0
  2236. package/dist/data/test/function/list_sort_asc__loop_exit_5.mcfunction +4 -0
  2237. package/dist/data/test/function/list_sort_asc__loop_header_0.mcfunction +5 -0
  2238. package/dist/data/test/function/list_sort_asc__loop_header_3.mcfunction +7 -0
  2239. package/dist/data/test/function/list_sort_asc__merge_7.mcfunction +4 -0
  2240. package/dist/data/test/function/list_sort_asc__then_6.mcfunction +1 -0
  2241. package/dist/data/test/function/list_sort_desc.mcfunction +4 -0
  2242. package/dist/data/test/function/list_sort_desc__loop_body_1.mcfunction +2 -0
  2243. package/dist/data/test/function/list_sort_desc__loop_body_4.mcfunction +3 -0
  2244. package/dist/data/test/function/list_sort_desc__loop_exit_2.mcfunction +1 -0
  2245. package/dist/data/test/function/list_sort_desc__loop_exit_5.mcfunction +4 -0
  2246. package/dist/data/test/function/list_sort_desc__loop_header_0.mcfunction +5 -0
  2247. package/dist/data/test/function/list_sort_desc__loop_header_3.mcfunction +7 -0
  2248. package/dist/data/test/function/list_sort_desc__merge_7.mcfunction +4 -0
  2249. package/dist/data/test/function/list_sort_desc__then_6.mcfunction +1 -0
  2250. package/dist/data/test/function/list_sum.mcfunction +5 -0
  2251. package/dist/data/test/function/list_sum3.mcfunction +8 -0
  2252. package/dist/data/test/function/list_sum4.mcfunction +11 -0
  2253. package/dist/data/test/function/list_sum5.mcfunction +14 -0
  2254. package/dist/data/test/function/list_sum__loop_body_1.mcfunction +7 -0
  2255. package/dist/data/test/function/list_sum__loop_exit_2.mcfunction +1 -0
  2256. package/dist/data/test/function/list_sum__loop_header_0.mcfunction +4 -0
  2257. package/dist/data/test/function/ln.mcfunction +9 -0
  2258. package/dist/data/test/function/ln__loop_body_1.mcfunction +8 -0
  2259. package/dist/data/test/function/ln__loop_body_4.mcfunction +8 -0
  2260. package/dist/data/test/function/ln__loop_exit_2.mcfunction +1 -0
  2261. package/dist/data/test/function/ln__loop_exit_5.mcfunction +37 -0
  2262. package/dist/data/test/function/ln__loop_header_0.mcfunction +3 -0
  2263. package/dist/data/test/function/ln__loop_header_3.mcfunction +6 -0
  2264. package/dist/data/test/function/load.mcfunction +1 -0
  2265. package/dist/data/test/function/log10_fx.mcfunction +11 -0
  2266. package/dist/data/test/function/log2_fx.mcfunction +11 -0
  2267. package/dist/data/test/function/log2_int.mcfunction +5 -0
  2268. package/dist/data/test/function/log2_int__loop_body_4.mcfunction +8 -0
  2269. package/dist/data/test/function/log2_int__loop_exit_5.mcfunction +1 -0
  2270. package/dist/data/test/function/log2_int__loop_header_3.mcfunction +4 -0
  2271. package/dist/data/test/function/log2_int__merge_1.mcfunction +3 -0
  2272. package/dist/data/test/function/log2_int__then_0.mcfunction +2 -0
  2273. package/dist/data/test/function/loga_fx.mcfunction +10 -0
  2274. package/dist/data/test/function/loga_fx__merge_1.mcfunction +9 -0
  2275. package/dist/data/test/function/loga_fx__then_0.mcfunction +2 -0
  2276. package/dist/data/test/function/mandelbrot_iter.mcfunction +7 -0
  2277. package/dist/data/test/function/mandelbrot_iter__loop_body_1.mcfunction +36 -0
  2278. package/dist/data/test/function/mandelbrot_iter__loop_exit_2.mcfunction +1 -0
  2279. package/dist/data/test/function/mandelbrot_iter__loop_header_0.mcfunction +3 -0
  2280. package/dist/data/test/function/mandelbrot_iter__merge_4.mcfunction +4 -0
  2281. package/dist/data/test/function/mandelbrot_iter__then_3.mcfunction +1 -0
  2282. package/dist/data/test/function/manhattan.mcfunction +14 -0
  2283. package/dist/data/test/function/manhattan3d.mcfunction +19 -0
  2284. package/dist/data/test/function/manhattan3d__merge_1.mcfunction +4 -0
  2285. package/dist/data/test/function/manhattan3d__merge_3.mcfunction +4 -0
  2286. package/dist/data/test/function/manhattan3d__merge_5.mcfunction +5 -0
  2287. package/dist/data/test/function/manhattan3d__then_0.mcfunction +4 -0
  2288. package/dist/data/test/function/manhattan3d__then_2.mcfunction +4 -0
  2289. package/dist/data/test/function/manhattan3d__then_4.mcfunction +4 -0
  2290. package/dist/data/test/function/manhattan__merge_1.mcfunction +4 -0
  2291. package/dist/data/test/function/manhattan__merge_3.mcfunction +3 -0
  2292. package/dist/data/test/function/manhattan__then_0.mcfunction +4 -0
  2293. package/dist/data/test/function/manhattan__then_2.mcfunction +4 -0
  2294. package/dist/data/test/function/map.mcfunction +12 -0
  2295. package/dist/data/test/function/map__merge_1.mcfunction +11 -0
  2296. package/dist/data/test/function/map__then_0.mcfunction +1 -0
  2297. package/dist/data/test/function/max_heap_pop.mcfunction +4 -0
  2298. package/dist/data/test/function/max_heap_pop__else_13.mcfunction +2 -0
  2299. package/dist/data/test/function/max_heap_pop__loop_body_1.mcfunction +14 -0
  2300. package/dist/data/test/function/max_heap_pop__loop_exit_2.mcfunction +1 -0
  2301. package/dist/data/test/function/max_heap_pop__loop_header_0.mcfunction +4 -0
  2302. package/dist/data/test/function/max_heap_pop__merge_10.mcfunction +1 -0
  2303. package/dist/data/test/function/max_heap_pop__merge_12.mcfunction +1 -0
  2304. package/dist/data/test/function/max_heap_pop__merge_4.mcfunction +3 -0
  2305. package/dist/data/test/function/max_heap_pop__merge_6.mcfunction +1 -0
  2306. package/dist/data/test/function/max_heap_pop__merge_8.mcfunction +3 -0
  2307. package/dist/data/test/function/max_heap_pop__then_11.mcfunction +2 -0
  2308. package/dist/data/test/function/max_heap_pop__then_3.mcfunction +3 -0
  2309. package/dist/data/test/function/max_heap_pop__then_5.mcfunction +2 -0
  2310. package/dist/data/test/function/max_heap_pop__then_7.mcfunction +3 -0
  2311. package/dist/data/test/function/max_heap_pop__then_9.mcfunction +2 -0
  2312. package/dist/data/test/function/max_heap_push.mcfunction +6 -0
  2313. package/dist/data/test/function/max_heap_push__else_5.mcfunction +2 -0
  2314. package/dist/data/test/function/max_heap_push__else_8.mcfunction +2 -0
  2315. package/dist/data/test/function/max_heap_push__loop_body_1.mcfunction +4 -0
  2316. package/dist/data/test/function/max_heap_push__loop_exit_2.mcfunction +1 -0
  2317. package/dist/data/test/function/max_heap_push__loop_header_0.mcfunction +4 -0
  2318. package/dist/data/test/function/max_heap_push__merge_4.mcfunction +1 -0
  2319. package/dist/data/test/function/max_heap_push__merge_7.mcfunction +1 -0
  2320. package/dist/data/test/function/max_heap_push__then_3.mcfunction +7 -0
  2321. package/dist/data/test/function/max_heap_push__then_6.mcfunction +2 -0
  2322. package/dist/data/test/function/mc_day_angle.mcfunction +16 -0
  2323. package/dist/data/test/function/midpoint.mcfunction +8 -0
  2324. package/dist/data/test/function/mod_pow.mcfunction +7 -0
  2325. package/dist/data/test/function/mod_pow__loop_body_6.mcfunction +7 -0
  2326. package/dist/data/test/function/mod_pow__loop_exit_7.mcfunction +1 -0
  2327. package/dist/data/test/function/mod_pow__loop_header_5.mcfunction +4 -0
  2328. package/dist/data/test/function/mod_pow__merge_1.mcfunction +8 -0
  2329. package/dist/data/test/function/mod_pow__merge_4.mcfunction +2 -0
  2330. package/dist/data/test/function/mod_pow__merge_9.mcfunction +10 -0
  2331. package/dist/data/test/function/mod_pow__then_0.mcfunction +2 -0
  2332. package/dist/data/test/function/mod_pow__then_3.mcfunction +4 -0
  2333. package/dist/data/test/function/mod_pow__then_8.mcfunction +6 -0
  2334. package/dist/data/test/function/mulfix.mcfunction +8 -0
  2335. package/dist/data/test/function/neg2d_x.mcfunction +4 -0
  2336. package/dist/data/test/function/neg2d_y.mcfunction +4 -0
  2337. package/dist/data/test/function/neg3d_x.mcfunction +4 -0
  2338. package/dist/data/test/function/neg3d_y.mcfunction +4 -0
  2339. package/dist/data/test/function/neg3d_z.mcfunction +4 -0
  2340. package/dist/data/test/function/newton_sqrt.mcfunction +5 -0
  2341. package/dist/data/test/function/newton_sqrt__loop_body_7.mcfunction +10 -0
  2342. package/dist/data/test/function/newton_sqrt__loop_exit_8.mcfunction +1 -0
  2343. package/dist/data/test/function/newton_sqrt__loop_header_6.mcfunction +3 -0
  2344. package/dist/data/test/function/newton_sqrt__merge_1.mcfunction +4 -0
  2345. package/dist/data/test/function/newton_sqrt__merge_4.mcfunction +6 -0
  2346. package/dist/data/test/function/newton_sqrt__then_0.mcfunction +2 -0
  2347. package/dist/data/test/function/newton_sqrt__then_3.mcfunction +2 -0
  2348. package/dist/data/test/function/newton_step.mcfunction +7 -0
  2349. package/dist/data/test/function/newton_step__merge_1.mcfunction +8 -0
  2350. package/dist/data/test/function/newton_step__then_0.mcfunction +1 -0
  2351. package/dist/data/test/function/next_lcg.mcfunction +7 -0
  2352. package/dist/data/test/function/night_vision.mcfunction +1 -0
  2353. package/dist/data/test/function/noise1d.mcfunction +13 -0
  2354. package/dist/data/test/function/noise1d__merge_1.mcfunction +20 -0
  2355. package/dist/data/test/function/noise1d__merge_3.mcfunction +4 -0
  2356. package/dist/data/test/function/noise1d__merge_5.mcfunction +11 -0
  2357. package/dist/data/test/function/noise1d__then_0.mcfunction +7 -0
  2358. package/dist/data/test/function/noise1d__then_2.mcfunction +4 -0
  2359. package/dist/data/test/function/noise1d__then_4.mcfunction +4 -0
  2360. package/dist/data/test/function/norm3_hp.mcfunction +43 -0
  2361. package/dist/data/test/function/normal_approx12.mcfunction +15 -0
  2362. package/dist/data/test/function/normal_approx12__merge_1.mcfunction +17 -0
  2363. package/dist/data/test/function/normal_approx12__merge_11.mcfunction +17 -0
  2364. package/dist/data/test/function/normal_approx12__merge_13.mcfunction +17 -0
  2365. package/dist/data/test/function/normal_approx12__merge_15.mcfunction +17 -0
  2366. package/dist/data/test/function/normal_approx12__merge_17.mcfunction +17 -0
  2367. package/dist/data/test/function/normal_approx12__merge_19.mcfunction +17 -0
  2368. package/dist/data/test/function/normal_approx12__merge_21.mcfunction +17 -0
  2369. package/dist/data/test/function/normal_approx12__merge_23.mcfunction +9 -0
  2370. package/dist/data/test/function/normal_approx12__merge_3.mcfunction +17 -0
  2371. package/dist/data/test/function/normal_approx12__merge_5.mcfunction +17 -0
  2372. package/dist/data/test/function/normal_approx12__merge_7.mcfunction +17 -0
  2373. package/dist/data/test/function/normal_approx12__merge_9.mcfunction +17 -0
  2374. package/dist/data/test/function/normal_approx12__then_0.mcfunction +4 -0
  2375. package/dist/data/test/function/normal_approx12__then_10.mcfunction +4 -0
  2376. package/dist/data/test/function/normal_approx12__then_12.mcfunction +4 -0
  2377. package/dist/data/test/function/normal_approx12__then_14.mcfunction +4 -0
  2378. package/dist/data/test/function/normal_approx12__then_16.mcfunction +4 -0
  2379. package/dist/data/test/function/normal_approx12__then_18.mcfunction +4 -0
  2380. package/dist/data/test/function/normal_approx12__then_2.mcfunction +4 -0
  2381. package/dist/data/test/function/normal_approx12__then_20.mcfunction +4 -0
  2382. package/dist/data/test/function/normal_approx12__then_22.mcfunction +4 -0
  2383. package/dist/data/test/function/normal_approx12__then_4.mcfunction +4 -0
  2384. package/dist/data/test/function/normal_approx12__then_6.mcfunction +4 -0
  2385. package/dist/data/test/function/normal_approx12__then_8.mcfunction +4 -0
  2386. package/dist/data/test/function/normalize2d_x.mcfunction +11 -0
  2387. package/dist/data/test/function/normalize2d_x__merge_1.mcfunction +6 -0
  2388. package/dist/data/test/function/normalize2d_x__then_0.mcfunction +2 -0
  2389. package/dist/data/test/function/normalize2d_y.mcfunction +11 -0
  2390. package/dist/data/test/function/normalize2d_y__merge_1.mcfunction +6 -0
  2391. package/dist/data/test/function/normalize2d_y__then_0.mcfunction +2 -0
  2392. package/dist/data/test/function/on_double_sneak.mcfunction +1 -0
  2393. package/dist/data/test/function/on_double_sneak__foreach_t0.mcfunction +9 -0
  2394. package/dist/data/test/function/on_double_sneak__foreach_t0__merge_1.mcfunction +1 -0
  2395. package/dist/data/test/function/on_double_sneak__foreach_t0__merge_3.mcfunction +2 -0
  2396. package/dist/data/test/function/on_double_sneak__foreach_t0__then_0.mcfunction +6 -0
  2397. package/dist/data/test/function/on_double_sneak__foreach_t0__then_2.mcfunction +2 -0
  2398. package/dist/data/test/function/on_right_click.mcfunction +1 -0
  2399. package/dist/data/test/function/on_right_click__foreach_t1.mcfunction +5 -0
  2400. package/dist/data/test/function/on_right_click__foreach_t1__merge_1.mcfunction +1 -0
  2401. package/dist/data/test/function/on_right_click__foreach_t1__then_0.mcfunction +3 -0
  2402. package/dist/data/test/function/on_sneak_click.mcfunction +1 -0
  2403. package/dist/data/test/function/on_sneak_click__foreach_t0.mcfunction +7 -0
  2404. package/dist/data/test/function/on_sneak_click__foreach_t0__else_4.mcfunction +3 -0
  2405. package/dist/data/test/function/on_sneak_click__foreach_t0__merge_1.mcfunction +1 -0
  2406. package/dist/data/test/function/on_sneak_click__foreach_t0__merge_3.mcfunction +1 -0
  2407. package/dist/data/test/function/on_sneak_click__foreach_t0__then_0.mcfunction +4 -0
  2408. package/dist/data/test/function/on_sneak_click__foreach_t0__then_2.mcfunction +3 -0
  2409. package/dist/data/test/function/on_sneak_start.mcfunction +1 -0
  2410. package/dist/data/test/function/on_sneak_start__foreach_t0.mcfunction +5 -0
  2411. package/dist/data/test/function/on_sneak_start__foreach_t0__else_2.mcfunction +2 -0
  2412. package/dist/data/test/function/on_sneak_start__foreach_t0__merge_1.mcfunction +1 -0
  2413. package/dist/data/test/function/on_sneak_start__foreach_t0__then_0.mcfunction +2 -0
  2414. package/dist/data/test/function/parabola_land_t.mcfunction +7 -0
  2415. package/dist/data/test/function/parabola_x.mcfunction +8 -0
  2416. package/dist/data/test/function/parabola_y.mcfunction +17 -0
  2417. package/dist/data/test/function/particle_at_fx.mcfunction +1 -0
  2418. package/dist/data/test/function/particle_dot.mcfunction +1 -0
  2419. package/dist/data/test/function/pathfind_bfs.mcfunction +11 -0
  2420. package/dist/data/test/function/pathfind_bfs__else_33.mcfunction +4 -0
  2421. package/dist/data/test/function/pathfind_bfs__else_8.mcfunction +19 -0
  2422. package/dist/data/test/function/pathfind_bfs__loop_body_1.mcfunction +10 -0
  2423. package/dist/data/test/function/pathfind_bfs__loop_body_29.mcfunction +6 -0
  2424. package/dist/data/test/function/pathfind_bfs__loop_body_35.mcfunction +9 -0
  2425. package/dist/data/test/function/pathfind_bfs__loop_body_4.mcfunction +9 -0
  2426. package/dist/data/test/function/pathfind_bfs__loop_exit_2.mcfunction +24 -0
  2427. package/dist/data/test/function/pathfind_bfs__loop_exit_30.mcfunction +6 -0
  2428. package/dist/data/test/function/pathfind_bfs__loop_exit_36.mcfunction +1 -0
  2429. package/dist/data/test/function/pathfind_bfs__loop_exit_5.mcfunction +6 -0
  2430. package/dist/data/test/function/pathfind_bfs__loop_header_0.mcfunction +4 -0
  2431. package/dist/data/test/function/pathfind_bfs__loop_header_28.mcfunction +4 -0
  2432. package/dist/data/test/function/pathfind_bfs__loop_header_3.mcfunction +3 -0
  2433. package/dist/data/test/function/pathfind_bfs__loop_header_34.mcfunction +4 -0
  2434. package/dist/data/test/function/pathfind_bfs__merge_10.mcfunction +11 -0
  2435. package/dist/data/test/function/pathfind_bfs__merge_12.mcfunction +1 -0
  2436. package/dist/data/test/function/pathfind_bfs__merge_14.mcfunction +11 -0
  2437. package/dist/data/test/function/pathfind_bfs__merge_16.mcfunction +1 -0
  2438. package/dist/data/test/function/pathfind_bfs__merge_18.mcfunction +11 -0
  2439. package/dist/data/test/function/pathfind_bfs__merge_20.mcfunction +1 -0
  2440. package/dist/data/test/function/pathfind_bfs__merge_22.mcfunction +1 -0
  2441. package/dist/data/test/function/pathfind_bfs__merge_24.mcfunction +1 -0
  2442. package/dist/data/test/function/pathfind_bfs__merge_26.mcfunction +5 -0
  2443. package/dist/data/test/function/pathfind_bfs__merge_32.mcfunction +1 -0
  2444. package/dist/data/test/function/pathfind_bfs__merge_7.mcfunction +1 -0
  2445. package/dist/data/test/function/pathfind_bfs__then_11.mcfunction +15 -0
  2446. package/dist/data/test/function/pathfind_bfs__then_13.mcfunction +13 -0
  2447. package/dist/data/test/function/pathfind_bfs__then_15.mcfunction +15 -0
  2448. package/dist/data/test/function/pathfind_bfs__then_17.mcfunction +13 -0
  2449. package/dist/data/test/function/pathfind_bfs__then_19.mcfunction +15 -0
  2450. package/dist/data/test/function/pathfind_bfs__then_21.mcfunction +13 -0
  2451. package/dist/data/test/function/pathfind_bfs__then_23.mcfunction +15 -0
  2452. package/dist/data/test/function/pathfind_bfs__then_25.mcfunction +1 -0
  2453. package/dist/data/test/function/pathfind_bfs__then_31.mcfunction +2 -0
  2454. package/dist/data/test/function/pathfind_bfs__then_6.mcfunction +3 -0
  2455. package/dist/data/test/function/pathfind_bfs__then_9.mcfunction +13 -0
  2456. package/dist/data/test/function/pathfind_bfs_coro.mcfunction +1 -0
  2457. package/dist/data/test/function/pcg_next_hi.mcfunction +8 -0
  2458. package/dist/data/test/function/pcg_next_lo.mcfunction +7 -0
  2459. package/dist/data/test/function/pcg_output.mcfunction +14 -0
  2460. package/dist/data/test/function/pcg_output__merge_1.mcfunction +1 -0
  2461. package/dist/data/test/function/pcg_output__then_0.mcfunction +4 -0
  2462. package/dist/data/test/function/pf_heuristic.mcfunction +14 -0
  2463. package/dist/data/test/function/pf_heuristic__merge_1.mcfunction +4 -0
  2464. package/dist/data/test/function/pf_heuristic__merge_3.mcfunction +6 -0
  2465. package/dist/data/test/function/pf_heuristic__then_0.mcfunction +4 -0
  2466. package/dist/data/test/function/pf_heuristic__then_2.mcfunction +4 -0
  2467. package/dist/data/test/function/pf_is_blocked.mcfunction +7 -0
  2468. package/dist/data/test/function/pf_is_blocked__merge_1.mcfunction +4 -0
  2469. package/dist/data/test/function/pf_is_blocked__merge_10.mcfunction +4 -0
  2470. package/dist/data/test/function/pf_is_blocked__merge_4.mcfunction +4 -0
  2471. package/dist/data/test/function/pf_is_blocked__merge_7.mcfunction +4 -0
  2472. package/dist/data/test/function/pf_is_blocked__then_0.mcfunction +2 -0
  2473. package/dist/data/test/function/pf_is_blocked__then_3.mcfunction +2 -0
  2474. package/dist/data/test/function/pf_is_blocked__then_6.mcfunction +2 -0
  2475. package/dist/data/test/function/pf_is_blocked__then_9.mcfunction +2 -0
  2476. package/dist/data/test/function/pf_new_map.mcfunction +4 -0
  2477. package/dist/data/test/function/pf_new_map__loop_body_1.mcfunction +7 -0
  2478. package/dist/data/test/function/pf_new_map__loop_exit_2.mcfunction +1 -0
  2479. package/dist/data/test/function/pf_new_map__loop_header_0.mcfunction +4 -0
  2480. package/dist/data/test/function/pf_noop.mcfunction +1 -0
  2481. package/dist/data/test/function/pf_pack.mcfunction +8 -0
  2482. package/dist/data/test/function/pf_set_blocked.mcfunction +5 -0
  2483. package/dist/data/test/function/pf_set_open.mcfunction +5 -0
  2484. package/dist/data/test/function/pf_unpack_x.mcfunction +5 -0
  2485. package/dist/data/test/function/pf_unpack_z.mcfunction +5 -0
  2486. package/dist/data/test/function/popcount.mcfunction +5 -0
  2487. package/dist/data/test/function/popcount__loop_body_1.mcfunction +7 -0
  2488. package/dist/data/test/function/popcount__loop_exit_2.mcfunction +1 -0
  2489. package/dist/data/test/function/popcount__loop_header_0.mcfunction +4 -0
  2490. package/dist/data/test/function/popcount__merge_4.mcfunction +8 -0
  2491. package/dist/data/test/function/popcount__then_3.mcfunction +4 -0
  2492. package/dist/data/test/function/portal_effect.mcfunction +1 -0
  2493. package/dist/data/test/function/pow_int.mcfunction +6 -0
  2494. package/dist/data/test/function/pow_int__loop_body_4.mcfunction +7 -0
  2495. package/dist/data/test/function/pow_int__loop_exit_5.mcfunction +1 -0
  2496. package/dist/data/test/function/pow_int__loop_header_3.mcfunction +4 -0
  2497. package/dist/data/test/function/pow_int__merge_1.mcfunction +4 -0
  2498. package/dist/data/test/function/pow_int__merge_7.mcfunction +8 -0
  2499. package/dist/data/test/function/pow_int__then_0.mcfunction +2 -0
  2500. package/dist/data/test/function/pow_int__then_6.mcfunction +4 -0
  2501. package/dist/data/test/function/projectile_land_t.mcfunction +5 -0
  2502. package/dist/data/test/function/projectile_land_t__merge_1.mcfunction +7 -0
  2503. package/dist/data/test/function/projectile_land_t__then_0.mcfunction +2 -0
  2504. package/dist/data/test/function/projectile_max_height.mcfunction +10 -0
  2505. package/dist/data/test/function/projectile_vy.mcfunction +9 -0
  2506. package/dist/data/test/function/projectile_x.mcfunction +8 -0
  2507. package/dist/data/test/function/projectile_y.mcfunction +19 -0
  2508. package/dist/data/test/function/ptimer/new.mcfunction +3 -0
  2509. package/dist/data/test/function/ptimer/reset.mcfunction +1 -0
  2510. package/dist/data/test/function/ptimer/tick.mcfunction +8 -0
  2511. package/dist/data/test/function/ptimer/tick__merge_1.mcfunction +2 -0
  2512. package/dist/data/test/function/ptimer/tick__then_0.mcfunction +3 -0
  2513. package/dist/data/test/function/quadratic_disc.mcfunction +12 -0
  2514. package/dist/data/test/function/quadratic_x1.mcfunction +7 -0
  2515. package/dist/data/test/function/quadratic_x1__merge_1.mcfunction +13 -0
  2516. package/dist/data/test/function/quadratic_x1__merge_4.mcfunction +15 -0
  2517. package/dist/data/test/function/quadratic_x1__then_0.mcfunction +2 -0
  2518. package/dist/data/test/function/quadratic_x1__then_3.mcfunction +2 -0
  2519. package/dist/data/test/function/quadratic_x2.mcfunction +7 -0
  2520. package/dist/data/test/function/quadratic_x2__merge_1.mcfunction +13 -0
  2521. package/dist/data/test/function/quadratic_x2__merge_4.mcfunction +15 -0
  2522. package/dist/data/test/function/quadratic_x2__then_0.mcfunction +2 -0
  2523. package/dist/data/test/function/quadratic_x2__then_3.mcfunction +2 -0
  2524. package/dist/data/test/function/quat_cos_half.mcfunction +8 -0
  2525. package/dist/data/test/function/quat_sin_half.mcfunction +8 -0
  2526. package/dist/data/test/function/random_bool.mcfunction +6 -0
  2527. package/dist/data/test/function/random_bool__merge_1.mcfunction +4 -0
  2528. package/dist/data/test/function/random_bool__then_0.mcfunction +4 -0
  2529. package/dist/data/test/function/random_range.mcfunction +8 -0
  2530. package/dist/data/test/function/random_range__merge_1.mcfunction +7 -0
  2531. package/dist/data/test/function/random_range__then_0.mcfunction +4 -0
  2532. package/dist/data/test/function/regen.mcfunction +1 -0
  2533. package/dist/data/test/function/remove_bar.mcfunction +3 -0
  2534. package/dist/data/test/function/remove_from_teams.mcfunction +3 -0
  2535. package/dist/data/test/function/remove_item.mcfunction +1 -0
  2536. package/dist/data/test/function/resistance.mcfunction +1 -0
  2537. package/dist/data/test/function/reverse_int.mcfunction +7 -0
  2538. package/dist/data/test/function/reverse_int__loop_body_3.mcfunction +14 -0
  2539. package/dist/data/test/function/reverse_int__loop_exit_4.mcfunction +4 -0
  2540. package/dist/data/test/function/reverse_int__loop_header_2.mcfunction +4 -0
  2541. package/dist/data/test/function/reverse_int__merge_1.mcfunction +2 -0
  2542. package/dist/data/test/function/reverse_int__merge_6.mcfunction +1 -0
  2543. package/dist/data/test/function/reverse_int__then_0.mcfunction +5 -0
  2544. package/dist/data/test/function/reverse_int__then_5.mcfunction +3 -0
  2545. package/dist/data/test/function/rgb_b.mcfunction +5 -0
  2546. package/dist/data/test/function/rgb_g.mcfunction +8 -0
  2547. package/dist/data/test/function/rgb_lerp.mcfunction +71 -0
  2548. package/dist/data/test/function/rgb_pack.mcfunction +14 -0
  2549. package/dist/data/test/function/rgb_r.mcfunction +8 -0
  2550. package/dist/data/test/function/rgb_to_h.mcfunction +7 -0
  2551. package/dist/data/test/function/rgb_to_h__merge_1.mcfunction +3 -0
  2552. package/dist/data/test/function/rgb_to_h__merge_12.mcfunction +3 -0
  2553. package/dist/data/test/function/rgb_to_h__merge_14.mcfunction +1 -0
  2554. package/dist/data/test/function/rgb_to_h__merge_17.mcfunction +9 -0
  2555. package/dist/data/test/function/rgb_to_h__merge_3.mcfunction +4 -0
  2556. package/dist/data/test/function/rgb_to_h__merge_5.mcfunction +3 -0
  2557. package/dist/data/test/function/rgb_to_h__merge_7.mcfunction +7 -0
  2558. package/dist/data/test/function/rgb_to_h__merge_9.mcfunction +3 -0
  2559. package/dist/data/test/function/rgb_to_h__then_0.mcfunction +2 -0
  2560. package/dist/data/test/function/rgb_to_h__then_11.mcfunction +11 -0
  2561. package/dist/data/test/function/rgb_to_h__then_13.mcfunction +4 -0
  2562. package/dist/data/test/function/rgb_to_h__then_16.mcfunction +9 -0
  2563. package/dist/data/test/function/rgb_to_h__then_2.mcfunction +2 -0
  2564. package/dist/data/test/function/rgb_to_h__then_4.mcfunction +2 -0
  2565. package/dist/data/test/function/rgb_to_h__then_6.mcfunction +2 -0
  2566. package/dist/data/test/function/rgb_to_h__then_8.mcfunction +2 -0
  2567. package/dist/data/test/function/rgb_to_l.mcfunction +7 -0
  2568. package/dist/data/test/function/rgb_to_l__merge_1.mcfunction +3 -0
  2569. package/dist/data/test/function/rgb_to_l__merge_3.mcfunction +4 -0
  2570. package/dist/data/test/function/rgb_to_l__merge_5.mcfunction +3 -0
  2571. package/dist/data/test/function/rgb_to_l__merge_7.mcfunction +9 -0
  2572. package/dist/data/test/function/rgb_to_l__then_0.mcfunction +2 -0
  2573. package/dist/data/test/function/rgb_to_l__then_2.mcfunction +2 -0
  2574. package/dist/data/test/function/rgb_to_l__then_4.mcfunction +2 -0
  2575. package/dist/data/test/function/rgb_to_l__then_6.mcfunction +2 -0
  2576. package/dist/data/test/function/rgb_to_s.mcfunction +7 -0
  2577. package/dist/data/test/function/rgb_to_s__merge_1.mcfunction +3 -0
  2578. package/dist/data/test/function/rgb_to_s__merge_12.mcfunction +10 -0
  2579. package/dist/data/test/function/rgb_to_s__merge_3.mcfunction +4 -0
  2580. package/dist/data/test/function/rgb_to_s__merge_5.mcfunction +3 -0
  2581. package/dist/data/test/function/rgb_to_s__merge_7.mcfunction +7 -0
  2582. package/dist/data/test/function/rgb_to_s__merge_9.mcfunction +12 -0
  2583. package/dist/data/test/function/rgb_to_s__then_0.mcfunction +2 -0
  2584. package/dist/data/test/function/rgb_to_s__then_11.mcfunction +8 -0
  2585. package/dist/data/test/function/rgb_to_s__then_2.mcfunction +2 -0
  2586. package/dist/data/test/function/rgb_to_s__then_4.mcfunction +2 -0
  2587. package/dist/data/test/function/rgb_to_s__then_6.mcfunction +2 -0
  2588. package/dist/data/test/function/rgb_to_s__then_8.mcfunction +2 -0
  2589. package/dist/data/test/function/riemann_left.mcfunction +6 -0
  2590. package/dist/data/test/function/riemann_left__loop_body_1.mcfunction +7 -0
  2591. package/dist/data/test/function/riemann_left__loop_exit_2.mcfunction +6 -0
  2592. package/dist/data/test/function/riemann_left__loop_header_0.mcfunction +5 -0
  2593. package/dist/data/test/function/riemann_mid.mcfunction +6 -0
  2594. package/dist/data/test/function/riemann_mid__loop_body_1.mcfunction +7 -0
  2595. package/dist/data/test/function/riemann_mid__loop_exit_2.mcfunction +6 -0
  2596. package/dist/data/test/function/riemann_mid__loop_header_0.mcfunction +3 -0
  2597. package/dist/data/test/function/riemann_right.mcfunction +6 -0
  2598. package/dist/data/test/function/riemann_right__loop_body_1.mcfunction +7 -0
  2599. package/dist/data/test/function/riemann_right__loop_exit_2.mcfunction +6 -0
  2600. package/dist/data/test/function/riemann_right__loop_header_0.mcfunction +3 -0
  2601. package/dist/data/test/function/rotate2d_x.mcfunction +20 -0
  2602. package/dist/data/test/function/rotate2d_y.mcfunction +20 -0
  2603. package/dist/data/test/function/rotate_x_y.mcfunction +28 -0
  2604. package/dist/data/test/function/rotate_x_z.mcfunction +28 -0
  2605. package/dist/data/test/function/rotate_y_x.mcfunction +28 -0
  2606. package/dist/data/test/function/rotate_y_z.mcfunction +30 -0
  2607. package/dist/data/test/function/running_m2.mcfunction +16 -0
  2608. package/dist/data/test/function/running_mean.mcfunction +7 -0
  2609. package/dist/data/test/function/running_mean__merge_1.mcfunction +13 -0
  2610. package/dist/data/test/function/running_mean__then_0.mcfunction +1 -0
  2611. package/dist/data/test/function/scale2d_x.mcfunction +8 -0
  2612. package/dist/data/test/function/scale2d_y.mcfunction +8 -0
  2613. package/dist/data/test/function/scale3d_x.mcfunction +8 -0
  2614. package/dist/data/test/function/scale3d_y.mcfunction +8 -0
  2615. package/dist/data/test/function/scale3d_z.mcfunction +8 -0
  2616. package/dist/data/test/function/scale_x.mcfunction +8 -0
  2617. package/dist/data/test/function/scale_y.mcfunction +8 -0
  2618. package/dist/data/test/function/scale_z.mcfunction +8 -0
  2619. package/dist/data/test/function/second_deriv.mcfunction +8 -0
  2620. package/dist/data/test/function/second_deriv__merge_1.mcfunction +14 -0
  2621. package/dist/data/test/function/second_deriv__then_0.mcfunction +2 -0
  2622. package/dist/data/test/function/seconds_to_ticks.mcfunction +5 -0
  2623. package/dist/data/test/function/set_day.mcfunction +1 -0
  2624. package/dist/data/test/function/set_easy.mcfunction +1 -0
  2625. package/dist/data/test/function/set_hard.mcfunction +1 -0
  2626. package/dist/data/test/function/set_midnight.mcfunction +1 -0
  2627. package/dist/data/test/function/set_night.mcfunction +1 -0
  2628. package/dist/data/test/function/set_noon.mcfunction +1 -0
  2629. package/dist/data/test/function/set_normal.mcfunction +1 -0
  2630. package/dist/data/test/function/set_peaceful.mcfunction +1 -0
  2631. package/dist/data/test/function/setup_four_teams.mcfunction +4 -0
  2632. package/dist/data/test/function/setup_two_teams.mcfunction +2 -0
  2633. package/dist/data/test/function/show_bar.mcfunction +4 -0
  2634. package/dist/data/test/function/showcase_load.mcfunction +4 -0
  2635. package/dist/data/test/function/showcase_tick.mcfunction +1 -0
  2636. package/dist/data/test/function/sign.mcfunction +5 -0
  2637. package/dist/data/test/function/sign__merge_1.mcfunction +4 -0
  2638. package/dist/data/test/function/sign__merge_4.mcfunction +2 -0
  2639. package/dist/data/test/function/sign__then_0.mcfunction +2 -0
  2640. package/dist/data/test/function/sign__then_3.mcfunction +2 -0
  2641. package/dist/data/test/function/simpson_step.mcfunction +16 -0
  2642. package/dist/data/test/function/sin_fixed.mcfunction +9 -0
  2643. package/dist/data/test/function/sin_fixed__merge_1.mcfunction +4 -0
  2644. package/dist/data/test/function/sin_fixed__merge_3.mcfunction +4 -0
  2645. package/dist/data/test/function/sin_fixed__merge_6.mcfunction +4 -0
  2646. package/dist/data/test/function/sin_fixed__merge_9.mcfunction +10 -0
  2647. package/dist/data/test/function/sin_fixed__then_0.mcfunction +4 -0
  2648. package/dist/data/test/function/sin_fixed__then_2.mcfunction +6 -0
  2649. package/dist/data/test/function/sin_fixed__then_5.mcfunction +8 -0
  2650. package/dist/data/test/function/sin_fixed__then_8.mcfunction +10 -0
  2651. package/dist/data/test/function/sin_hp.mcfunction +8 -0
  2652. package/dist/data/test/function/slow_fall.mcfunction +1 -0
  2653. package/dist/data/test/function/smoke.mcfunction +1 -0
  2654. package/dist/data/test/function/smootherstep.mcfunction +10 -0
  2655. package/dist/data/test/function/smootherstep__merge_1.mcfunction +12 -0
  2656. package/dist/data/test/function/smootherstep__merge_4.mcfunction +4 -0
  2657. package/dist/data/test/function/smootherstep__merge_6.mcfunction +27 -0
  2658. package/dist/data/test/function/smootherstep__then_0.mcfunction +2 -0
  2659. package/dist/data/test/function/smootherstep__then_3.mcfunction +2 -0
  2660. package/dist/data/test/function/smootherstep__then_5.mcfunction +2 -0
  2661. package/dist/data/test/function/smoothstep.mcfunction +10 -0
  2662. package/dist/data/test/function/smoothstep__merge_1.mcfunction +12 -0
  2663. package/dist/data/test/function/smoothstep__merge_4.mcfunction +4 -0
  2664. package/dist/data/test/function/smoothstep__merge_6.mcfunction +15 -0
  2665. package/dist/data/test/function/smoothstep__then_0.mcfunction +2 -0
  2666. package/dist/data/test/function/smoothstep__then_3.mcfunction +2 -0
  2667. package/dist/data/test/function/smoothstep__then_5.mcfunction +2 -0
  2668. package/dist/data/test/function/solve2x2_x.mcfunction +17 -0
  2669. package/dist/data/test/function/solve2x2_x__merge_1.mcfunction +12 -0
  2670. package/dist/data/test/function/solve2x2_x__then_0.mcfunction +2 -0
  2671. package/dist/data/test/function/solve2x2_y.mcfunction +17 -0
  2672. package/dist/data/test/function/solve2x2_y__merge_1.mcfunction +12 -0
  2673. package/dist/data/test/function/solve2x2_y__then_0.mcfunction +2 -0
  2674. package/dist/data/test/function/sort2_max.mcfunction +5 -0
  2675. package/dist/data/test/function/sort2_max__merge_1.mcfunction +1 -0
  2676. package/dist/data/test/function/sort2_max__then_0.mcfunction +1 -0
  2677. package/dist/data/test/function/sort2_min.mcfunction +5 -0
  2678. package/dist/data/test/function/sort2_min__merge_1.mcfunction +1 -0
  2679. package/dist/data/test/function/sort2_min__then_0.mcfunction +1 -0
  2680. package/dist/data/test/function/sort3.mcfunction +10 -0
  2681. package/dist/data/test/function/sort3__merge_1.mcfunction +3 -0
  2682. package/dist/data/test/function/sort3__merge_10.mcfunction +1 -0
  2683. package/dist/data/test/function/sort3__merge_3.mcfunction +3 -0
  2684. package/dist/data/test/function/sort3__merge_5.mcfunction +4 -0
  2685. package/dist/data/test/function/sort3__merge_7.mcfunction +4 -0
  2686. package/dist/data/test/function/sort3__then_0.mcfunction +4 -0
  2687. package/dist/data/test/function/sort3__then_2.mcfunction +4 -0
  2688. package/dist/data/test/function/sort3__then_4.mcfunction +4 -0
  2689. package/dist/data/test/function/sort3__then_6.mcfunction +1 -0
  2690. package/dist/data/test/function/sort3__then_9.mcfunction +1 -0
  2691. package/dist/data/test/function/sort4.mcfunction +12 -0
  2692. package/dist/data/test/function/sort4__merge_1.mcfunction +3 -0
  2693. package/dist/data/test/function/sort4__merge_11.mcfunction +4 -0
  2694. package/dist/data/test/function/sort4__merge_14.mcfunction +4 -0
  2695. package/dist/data/test/function/sort4__merge_17.mcfunction +1 -0
  2696. package/dist/data/test/function/sort4__merge_3.mcfunction +3 -0
  2697. package/dist/data/test/function/sort4__merge_5.mcfunction +3 -0
  2698. package/dist/data/test/function/sort4__merge_7.mcfunction +3 -0
  2699. package/dist/data/test/function/sort4__merge_9.mcfunction +4 -0
  2700. package/dist/data/test/function/sort4__then_0.mcfunction +4 -0
  2701. package/dist/data/test/function/sort4__then_10.mcfunction +1 -0
  2702. package/dist/data/test/function/sort4__then_13.mcfunction +1 -0
  2703. package/dist/data/test/function/sort4__then_16.mcfunction +1 -0
  2704. package/dist/data/test/function/sort4__then_2.mcfunction +4 -0
  2705. package/dist/data/test/function/sort4__then_4.mcfunction +4 -0
  2706. package/dist/data/test/function/sort4__then_6.mcfunction +4 -0
  2707. package/dist/data/test/function/sort4__then_8.mcfunction +4 -0
  2708. package/dist/data/test/function/sort5.mcfunction +14 -0
  2709. package/dist/data/test/function/sort5__merge_1.mcfunction +3 -0
  2710. package/dist/data/test/function/sort5__merge_11.mcfunction +3 -0
  2711. package/dist/data/test/function/sort5__merge_13.mcfunction +3 -0
  2712. package/dist/data/test/function/sort5__merge_15.mcfunction +3 -0
  2713. package/dist/data/test/function/sort5__merge_17.mcfunction +4 -0
  2714. package/dist/data/test/function/sort5__merge_19.mcfunction +4 -0
  2715. package/dist/data/test/function/sort5__merge_22.mcfunction +4 -0
  2716. package/dist/data/test/function/sort5__merge_25.mcfunction +4 -0
  2717. package/dist/data/test/function/sort5__merge_28.mcfunction +1 -0
  2718. package/dist/data/test/function/sort5__merge_3.mcfunction +3 -0
  2719. package/dist/data/test/function/sort5__merge_5.mcfunction +3 -0
  2720. package/dist/data/test/function/sort5__merge_7.mcfunction +3 -0
  2721. package/dist/data/test/function/sort5__merge_9.mcfunction +3 -0
  2722. package/dist/data/test/function/sort5__then_0.mcfunction +4 -0
  2723. package/dist/data/test/function/sort5__then_10.mcfunction +4 -0
  2724. package/dist/data/test/function/sort5__then_12.mcfunction +4 -0
  2725. package/dist/data/test/function/sort5__then_14.mcfunction +4 -0
  2726. package/dist/data/test/function/sort5__then_16.mcfunction +4 -0
  2727. package/dist/data/test/function/sort5__then_18.mcfunction +1 -0
  2728. package/dist/data/test/function/sort5__then_2.mcfunction +4 -0
  2729. package/dist/data/test/function/sort5__then_21.mcfunction +1 -0
  2730. package/dist/data/test/function/sort5__then_24.mcfunction +1 -0
  2731. package/dist/data/test/function/sort5__then_27.mcfunction +1 -0
  2732. package/dist/data/test/function/sort5__then_4.mcfunction +4 -0
  2733. package/dist/data/test/function/sort5__then_6.mcfunction +4 -0
  2734. package/dist/data/test/function/sort5__then_8.mcfunction +4 -0
  2735. package/dist/data/test/function/sort_merge.mcfunction +10 -0
  2736. package/dist/data/test/function/sort_merge__else_11.mcfunction +7 -0
  2737. package/dist/data/test/function/sort_merge__else_14.mcfunction +2 -0
  2738. package/dist/data/test/function/sort_merge__else_5.mcfunction +3 -0
  2739. package/dist/data/test/function/sort_merge__else_8.mcfunction +7 -0
  2740. package/dist/data/test/function/sort_merge__loop_body_1.mcfunction +3 -0
  2741. package/dist/data/test/function/sort_merge__loop_exit_2.mcfunction +1 -0
  2742. package/dist/data/test/function/sort_merge__loop_header_0.mcfunction +4 -0
  2743. package/dist/data/test/function/sort_merge__merge_10.mcfunction +1 -0
  2744. package/dist/data/test/function/sort_merge__merge_13.mcfunction +1 -0
  2745. package/dist/data/test/function/sort_merge__merge_4.mcfunction +1 -0
  2746. package/dist/data/test/function/sort_merge__merge_7.mcfunction +1 -0
  2747. package/dist/data/test/function/sort_merge__then_12.mcfunction +7 -0
  2748. package/dist/data/test/function/sort_merge__then_3.mcfunction +3 -0
  2749. package/dist/data/test/function/sort_merge__then_6.mcfunction +3 -0
  2750. package/dist/data/test/function/sort_merge__then_9.mcfunction +7 -0
  2751. package/dist/data/test/function/sparkles_at.mcfunction +1 -0
  2752. package/dist/data/test/function/speed.mcfunction +1 -0
  2753. package/dist/data/test/function/sphere_contains.mcfunction +28 -0
  2754. package/dist/data/test/function/sphere_contains__merge_1.mcfunction +2 -0
  2755. package/dist/data/test/function/sphere_contains__then_0.mcfunction +2 -0
  2756. package/dist/data/test/function/spiral_ring.mcfunction +5 -0
  2757. package/dist/data/test/function/spiral_ring__merge_1.mcfunction +13 -0
  2758. package/dist/data/test/function/spiral_ring__then_0.mcfunction +2 -0
  2759. package/dist/data/test/function/spread_players.mcfunction +1 -0
  2760. package/dist/data/test/function/spring_force.mcfunction +11 -0
  2761. package/dist/data/test/function/spring_update_v.mcfunction +18 -0
  2762. package/dist/data/test/function/sqrt_fixed.mcfunction +8 -0
  2763. package/dist/data/test/function/sqrt_fx.mcfunction +8 -0
  2764. package/dist/data/test/function/sqrt_hp.mcfunction +17 -0
  2765. package/dist/data/test/function/sqrt_hp__merge_1.mcfunction +21 -0
  2766. package/dist/data/test/function/sqrt_hp__then_0.mcfunction +2 -0
  2767. package/dist/data/test/function/start.mcfunction +8 -0
  2768. package/dist/data/test/function/std_dev_approx.mcfunction +5 -0
  2769. package/dist/data/test/function/std_dev_approx__merge_1.mcfunction +13 -0
  2770. package/dist/data/test/function/std_dev_approx__then_0.mcfunction +2 -0
  2771. package/dist/data/test/function/stop.mcfunction +2 -0
  2772. package/dist/data/test/function/stop__foreach_t0.mcfunction +1 -0
  2773. package/dist/data/test/function/str_len.mcfunction +2 -0
  2774. package/dist/data/test/function/strength.mcfunction +1 -0
  2775. package/dist/data/test/function/sub2d_x.mcfunction +5 -0
  2776. package/dist/data/test/function/sub2d_y.mcfunction +5 -0
  2777. package/dist/data/test/function/sub3d_x.mcfunction +5 -0
  2778. package/dist/data/test/function/sub3d_y.mcfunction +5 -0
  2779. package/dist/data/test/function/sub3d_z.mcfunction +5 -0
  2780. package/dist/data/test/function/t.mcfunction +3 -0
  2781. package/dist/data/test/function/teleport_to.mcfunction +9 -0
  2782. package/dist/data/test/function/teleport_to_entity.mcfunction +5 -0
  2783. package/dist/data/test/function/terrain_height.mcfunction +24 -0
  2784. package/dist/data/test/function/test.mcfunction +5 -0
  2785. package/dist/data/test/function/test__loop_body_1.mcfunction +9 -0
  2786. package/dist/data/test/function/test__loop_exit_2.mcfunction +1 -0
  2787. package/dist/data/test/function/test__loop_header_0.mcfunction +3 -0
  2788. package/dist/data/test/function/tick_to_ms.mcfunction +5 -0
  2789. package/dist/data/test/function/tick_to_seconds.mcfunction +5 -0
  2790. package/dist/data/test/function/tile_center.mcfunction +10 -0
  2791. package/dist/data/test/function/tile_of.mcfunction +6 -0
  2792. package/dist/data/test/function/tile_of__merge_1.mcfunction +7 -0
  2793. package/dist/data/test/function/tile_of__then_0.mcfunction +3 -0
  2794. package/dist/data/test/function/timer/done.mcfunction +4 -0
  2795. package/dist/data/test/function/timer/elapsed.mcfunction +2 -0
  2796. package/dist/data/test/function/timer/new.mcfunction +5 -0
  2797. package/dist/data/test/function/timer/pause.mcfunction +1 -0
  2798. package/dist/data/test/function/timer/remaining.mcfunction +9 -0
  2799. package/dist/data/test/function/timer/remaining__merge_1.mcfunction +2 -0
  2800. package/dist/data/test/function/timer/remaining__then_0.mcfunction +1 -0
  2801. package/dist/data/test/function/timer/reset.mcfunction +1 -0
  2802. package/dist/data/test/function/timer/start.mcfunction +1 -0
  2803. package/dist/data/test/function/timer/tick.mcfunction +8 -0
  2804. package/dist/data/test/function/timer/tick__merge_1.mcfunction +1 -0
  2805. package/dist/data/test/function/timer/tick__merge_3.mcfunction +1 -0
  2806. package/dist/data/test/function/timer/tick__then_0.mcfunction +3 -0
  2807. package/dist/data/test/function/timer/tick__then_2.mcfunction +4 -0
  2808. package/dist/data/test/function/totem_at.mcfunction +1 -0
  2809. package/dist/data/test/function/trapezoid_step.mcfunction +11 -0
  2810. package/dist/data/test/function/uniform_frac.mcfunction +11 -0
  2811. package/dist/data/test/function/uniform_frac__merge_1.mcfunction +4 -0
  2812. package/dist/data/test/function/uniform_frac__then_0.mcfunction +4 -0
  2813. package/dist/data/test/function/uniform_int.mcfunction +13 -0
  2814. package/dist/data/test/function/uniform_int__merge_1.mcfunction +9 -0
  2815. package/dist/data/test/function/uniform_int__then_0.mcfunction +4 -0
  2816. package/dist/data/test/function/uniform_scale.mcfunction +8 -0
  2817. package/dist/data/test/function/update_bar.mcfunction +5 -0
  2818. package/dist/data/test/function/update_bar_color.mcfunction +6 -0
  2819. package/dist/data/test/function/update_bar_color__else_2.mcfunction +4 -0
  2820. package/dist/data/test/function/update_bar_color__else_5.mcfunction +4 -0
  2821. package/dist/data/test/function/update_bar_color__merge_1.mcfunction +1 -0
  2822. package/dist/data/test/function/update_bar_color__merge_4.mcfunction +1 -0
  2823. package/dist/data/test/function/update_bar_color__then_0.mcfunction +4 -0
  2824. package/dist/data/test/function/update_bar_color__then_3.mcfunction +4 -0
  2825. package/dist/data/test/function/update_pos.mcfunction +5 -0
  2826. package/dist/data/test/function/value_noise_1d.mcfunction +13 -0
  2827. package/dist/data/test/function/value_noise_1d__merge_1.mcfunction +39 -0
  2828. package/dist/data/test/function/value_noise_1d__then_0.mcfunction +7 -0
  2829. package/dist/data/test/function/value_noise_2d.mcfunction +14 -0
  2830. package/dist/data/test/function/value_noise_2d__merge_1.mcfunction +12 -0
  2831. package/dist/data/test/function/value_noise_2d__merge_3.mcfunction +98 -0
  2832. package/dist/data/test/function/value_noise_2d__then_0.mcfunction +7 -0
  2833. package/dist/data/test/function/value_noise_2d__then_2.mcfunction +7 -0
  2834. package/dist/data/test/function/variance_from_m2.mcfunction +6 -0
  2835. package/dist/data/test/function/variance_from_m2__merge_1.mcfunction +5 -0
  2836. package/dist/data/test/function/variance_from_m2__then_0.mcfunction +2 -0
  2837. package/dist/data/test/function/water_drag_fx.mcfunction +2 -0
  2838. package/dist/data/test/function/weapon_damage.mcfunction +5 -0
  2839. package/dist/data/test/function/weather_clear.mcfunction +1 -0
  2840. package/dist/data/test/function/weather_rain.mcfunction +1 -0
  2841. package/dist/data/test/function/weather_thunder.mcfunction +1 -0
  2842. package/dist/data/test/function/weighted2.mcfunction +16 -0
  2843. package/dist/data/test/function/weighted2__merge_1.mcfunction +5 -0
  2844. package/dist/data/test/function/weighted2__merge_3.mcfunction +2 -0
  2845. package/dist/data/test/function/weighted2__then_0.mcfunction +4 -0
  2846. package/dist/data/test/function/weighted2__then_2.mcfunction +2 -0
  2847. package/dist/data/test/function/weighted3.mcfunction +19 -0
  2848. package/dist/data/test/function/weighted3__merge_1.mcfunction +6 -0
  2849. package/dist/data/test/function/weighted3__merge_3.mcfunction +5 -0
  2850. package/dist/data/test/function/weighted3__merge_6.mcfunction +2 -0
  2851. package/dist/data/test/function/weighted3__then_0.mcfunction +4 -0
  2852. package/dist/data/test/function/weighted3__then_2.mcfunction +2 -0
  2853. package/dist/data/test/function/weighted3__then_5.mcfunction +2 -0
  2854. package/dist/data/test_dmul/function/__double_mul_macro.mcfunction +1 -0
  2855. package/dist/data/test_dmul/function/double_mul_fixed.mcfunction +6 -0
  2856. package/dist/data/test_dmul/function/load.mcfunction +1 -0
  2857. package/dist/data/test_double_fn/function/double_test.mcfunction +2 -0
  2858. package/dist/data/test_double_fn/function/load.mcfunction +1 -0
  2859. package/dist/data/test_double_fn2/function/double_test.mcfunction +2 -0
  2860. package/dist/data/test_double_fn2/function/load.mcfunction +1 -0
  2861. package/dist/data/test_double_pass/function/caller_fn.mcfunction +4 -0
  2862. package/dist/data/test_double_pass/function/consume_double.mcfunction +2 -0
  2863. package/dist/data/test_double_pass/function/load.mcfunction +1 -0
  2864. package/dist/data/test_macro/function/load.mcfunction +1 -0
  2865. package/dist/data/test_macro/function/macro_helper.mcfunction +1 -0
  2866. package/dist/data/test_macro3/function/__dmul_macro.mcfunction +1 -0
  2867. package/dist/data/test_macro3/function/double_mul_test.mcfunction +7 -0
  2868. package/dist/data/test_macro3/function/load.mcfunction +1 -0
  2869. package/dist/data/test_ret_double/function/load.mcfunction +1 -0
  2870. package/dist/data/test_ret_double/function/make_double.mcfunction +3 -0
  2871. package/dist/data/test_ret_double/function/use_it.mcfunction +3 -0
  2872. package/dist/data/turret/function/__load.mcfunction +5 -0
  2873. package/dist/data/turret/function/__tick.mcfunction +4 -0
  2874. package/dist/data/turret/function/__trigger_deploy_turret_dispatch.mcfunction +4 -0
  2875. package/dist/data/turret/function/deploy_turret.mcfunction +8 -0
  2876. package/dist/data/turret/function/turret_tick/at_1.mcfunction +2 -0
  2877. package/dist/data/turret/function/turret_tick/foreach_0.mcfunction +2 -0
  2878. package/dist/data/turret/function/turret_tick/foreach_2.mcfunction +2 -0
  2879. package/dist/data/turret/function/turret_tick/tick_body.mcfunction +3 -0
  2880. package/dist/data/turret/function/turret_tick/tick_skip.mcfunction +1 -0
  2881. package/dist/data/turret/function/turret_tick.mcfunction +5 -0
  2882. package/dist/diagnostics/index.d.ts +44 -0
  2883. package/dist/diagnostics/index.js +140 -0
  2884. package/dist/events/types.d.ts +35 -0
  2885. package/dist/events/types.js +59 -0
  2886. package/dist/formatter/index.d.ts +1 -0
  2887. package/dist/formatter/index.js +26 -0
  2888. package/dist/gcd2.map.json +15 -0
  2889. package/dist/gcd3.map.json +17 -0
  2890. package/dist/gcd_test.map.json +15 -0
  2891. package/dist/index.d.ts +62 -0
  2892. package/dist/ir/builder.d.ts +33 -0
  2893. package/dist/ir/builder.js +99 -0
  2894. package/dist/ir/types.d.ts +132 -0
  2895. package/dist/ir/types.js +15 -0
  2896. package/dist/isqrttest.map.json +15 -0
  2897. package/dist/lexer/index.d.ts +37 -0
  2898. package/dist/lexer/index.js +569 -0
  2899. package/dist/lowering/index.d.ts +188 -0
  2900. package/dist/lowering/index.js +3405 -0
  2901. package/dist/mathtest.map.json +6 -0
  2902. package/dist/mc-test/client.d.ts +128 -0
  2903. package/dist/mc-test/client.js +174 -0
  2904. package/dist/mc-test/runner.d.ts +28 -0
  2905. package/dist/mc-test/runner.js +150 -0
  2906. package/dist/mc-test/setup.d.ts +11 -0
  2907. package/dist/mc-test/setup.js +98 -0
  2908. package/dist/mc-validator/index.d.ts +17 -0
  2909. package/dist/mc-validator/index.js +322 -0
  2910. package/dist/mypack.map.json +27 -0
  2911. package/dist/nbt/index.d.ts +86 -0
  2912. package/dist/nbt/index.js +250 -0
  2913. package/dist/optimizer/commands.d.ts +38 -0
  2914. package/dist/optimizer/commands.js +451 -0
  2915. package/dist/optimizer/dce.d.ts +34 -0
  2916. package/dist/optimizer/dce.js +639 -0
  2917. package/dist/optimizer/passes.d.ts +34 -0
  2918. package/dist/optimizer/passes.js +243 -0
  2919. package/dist/optimizer/structure.d.ts +9 -0
  2920. package/dist/optimizer/structure.js +356 -0
  2921. package/dist/pack.mcmeta +6 -0
  2922. package/dist/parser/index.d.ts +93 -0
  2923. package/dist/parser/index.js +1687 -0
  2924. package/dist/repl.d.ts +16 -0
  2925. package/dist/repl.js +165 -0
  2926. package/dist/reqtest.map.json +4 -0
  2927. package/dist/reqtest2.map.json +4 -0
  2928. package/dist/runtime/index.d.ts +107 -0
  2929. package/dist/runtime/index.js +1409 -0
  2930. package/dist/runtime.map.json +7 -0
  2931. package/dist/src/__tests__/array-dynamic.test.js +42 -0
  2932. package/dist/src/__tests__/budget.test.js +4 -0
  2933. package/dist/src/__tests__/builtins.test.d.ts +1 -0
  2934. package/dist/src/__tests__/builtins.test.js +55 -0
  2935. package/dist/src/__tests__/cache/cache-behavior.test.d.ts +10 -0
  2936. package/dist/src/__tests__/cache/cache-behavior.test.js +425 -0
  2937. package/dist/src/__tests__/cache-extra.test.d.ts +5 -0
  2938. package/dist/src/__tests__/cache-extra.test.js +211 -0
  2939. package/dist/src/__tests__/cli-init.test.d.ts +1 -0
  2940. package/dist/src/__tests__/cli-init.test.js +97 -0
  2941. package/dist/src/__tests__/cli-publish.test.d.ts +9 -0
  2942. package/dist/src/__tests__/cli-publish.test.js +189 -0
  2943. package/dist/src/__tests__/cli.test.js +76 -0
  2944. package/dist/src/__tests__/codegen.test.d.ts +1 -0
  2945. package/dist/src/__tests__/codegen.test.js +152 -0
  2946. package/dist/src/__tests__/compile-preprocess.test.d.ts +11 -0
  2947. package/dist/src/__tests__/compile-preprocess.test.js +328 -0
  2948. package/dist/src/__tests__/compiler/break-stmt.test.d.ts +1 -0
  2949. package/dist/src/__tests__/compiler/break-stmt.test.js +58 -0
  2950. package/dist/src/__tests__/compiler/const-decl.test.d.ts +1 -0
  2951. package/dist/src/__tests__/compiler/const-decl.test.js +123 -0
  2952. package/dist/src/__tests__/compiler/continue-stmt.test.d.ts +1 -0
  2953. package/dist/src/__tests__/compiler/continue-stmt.test.js +67 -0
  2954. package/dist/src/__tests__/compiler/coroutine-extended.test.d.ts +17 -0
  2955. package/dist/src/__tests__/compiler/coroutine-extended.test.js +565 -0
  2956. package/dist/src/__tests__/compiler/deprecated.test.d.ts +4 -0
  2957. package/dist/src/__tests__/compiler/deprecated.test.js +285 -0
  2958. package/dist/src/__tests__/compiler/do-while.test.d.ts +1 -0
  2959. package/dist/src/__tests__/compiler/do-while.test.js +120 -0
  2960. package/dist/src/__tests__/compiler/enum-payload.test.d.ts +9 -0
  2961. package/dist/src/__tests__/compiler/enum-payload.test.js +272 -0
  2962. package/dist/src/__tests__/compiler/interface.test.d.ts +10 -0
  2963. package/dist/src/__tests__/compiler/interface.test.js +258 -0
  2964. package/dist/src/__tests__/compiler/labeled-loops.test.d.ts +1 -0
  2965. package/dist/src/__tests__/compiler/labeled-loops.test.js +263 -0
  2966. package/dist/src/__tests__/compiler/match-string.test.d.ts +1 -0
  2967. package/dist/src/__tests__/compiler/match-string.test.js +43 -0
  2968. package/dist/src/__tests__/compiler/memoize.test.d.ts +1 -0
  2969. package/dist/src/__tests__/compiler/memoize.test.js +113 -0
  2970. package/dist/src/__tests__/compiler/method-chain.test.d.ts +5 -0
  2971. package/dist/src/__tests__/compiler/method-chain.test.js +115 -0
  2972. package/dist/src/__tests__/compiler/module-import.test.d.ts +12 -0
  2973. package/dist/src/__tests__/compiler/module-import.test.js +261 -0
  2974. package/dist/src/__tests__/compiler/option-extensions.test.d.ts +6 -0
  2975. package/dist/src/__tests__/compiler/option-extensions.test.js +191 -0
  2976. package/dist/src/__tests__/compiler/profile-decorator.test.d.ts +1 -0
  2977. package/dist/src/__tests__/compiler/profile-decorator.test.js +69 -0
  2978. package/dist/src/__tests__/compiler/string-advanced.test.d.ts +7 -0
  2979. package/dist/src/__tests__/compiler/string-advanced.test.js +281 -0
  2980. package/dist/src/__tests__/compiler/struct-extends.test.d.ts +1 -0
  2981. package/dist/src/__tests__/compiler/struct-extends.test.js +95 -0
  2982. package/dist/src/__tests__/compiler/throttle-retry.test.d.ts +1 -0
  2983. package/dist/src/__tests__/compiler/throttle-retry.test.js +166 -0
  2984. package/dist/src/__tests__/compiler/tuple-type.test.d.ts +10 -0
  2985. package/dist/src/__tests__/compiler/tuple-type.test.js +229 -0
  2986. package/dist/src/__tests__/compiler/watch-decorator.test.d.ts +1 -0
  2987. package/dist/src/__tests__/compiler/watch-decorator.test.js +65 -0
  2988. package/dist/src/__tests__/config/project-config.test.d.ts +1 -0
  2989. package/dist/src/__tests__/config/project-config.test.js +199 -0
  2990. package/dist/src/__tests__/config-decorator.test.d.ts +8 -0
  2991. package/dist/src/__tests__/config-decorator.test.js +142 -0
  2992. package/dist/src/__tests__/debug-compile.test.d.ts +1 -0
  2993. package/dist/src/__tests__/debug-compile.test.js +24 -0
  2994. package/dist/src/__tests__/debug-compile2.test.d.ts +1 -0
  2995. package/dist/src/__tests__/debug-compile2.test.js +19 -0
  2996. package/dist/src/__tests__/debug-compile3.test.d.ts +1 -0
  2997. package/dist/src/__tests__/debug-compile3.test.js +22 -0
  2998. package/dist/src/__tests__/debug-wm.test.d.ts +1 -0
  2999. package/dist/src/__tests__/debug-wm.test.js +50 -0
  3000. package/dist/src/__tests__/debug_gen.d.ts +1 -0
  3001. package/dist/src/__tests__/debug_gen.js +24 -0
  3002. package/dist/src/__tests__/debug_scoreboard.test.d.ts +1 -0
  3003. package/dist/src/__tests__/debug_scoreboard.test.js +19 -0
  3004. package/dist/src/__tests__/debug_scoreboard2.test.d.ts +1 -0
  3005. package/dist/src/__tests__/debug_scoreboard2.test.js +27 -0
  3006. package/dist/src/__tests__/debug_scoreboard3.test.d.ts +1 -0
  3007. package/dist/src/__tests__/debug_scoreboard3.test.js +37 -0
  3008. package/dist/src/__tests__/diagnostics-extra.test.d.ts +6 -0
  3009. package/dist/src/__tests__/diagnostics-extra.test.js +132 -0
  3010. package/dist/src/__tests__/e2e/ecs-stdlib.test.d.ts +7 -0
  3011. package/dist/src/__tests__/e2e/ecs-stdlib.test.js +328 -0
  3012. package/dist/src/__tests__/e2e/events-stdlib.test.d.ts +1 -0
  3013. package/dist/src/__tests__/e2e/events-stdlib.test.js +81 -0
  3014. package/dist/src/__tests__/e2e/fft-stdlib.test.d.ts +13 -0
  3015. package/dist/src/__tests__/e2e/fft-stdlib.test.js +288 -0
  3016. package/dist/src/__tests__/e2e/ode-stdlib.test.d.ts +1 -0
  3017. package/dist/src/__tests__/e2e/ode-stdlib.test.js +91 -0
  3018. package/dist/src/__tests__/e2e/stdlib-e2e.test.js +205 -0
  3019. package/dist/src/__tests__/e2e.test.d.ts +6 -0
  3020. package/dist/src/__tests__/e2e.test.js +1789 -0
  3021. package/dist/src/__tests__/emit/compile-branches.test.d.ts +1 -0
  3022. package/dist/src/__tests__/emit/compile-branches.test.js +123 -0
  3023. package/dist/src/__tests__/emit/compile-coverage.test.d.ts +25 -0
  3024. package/dist/src/__tests__/emit/compile-coverage.test.js +617 -0
  3025. package/dist/src/__tests__/emit/compile-extra-branches.test.d.ts +12 -0
  3026. package/dist/src/__tests__/emit/compile-extra-branches.test.js +225 -0
  3027. package/dist/src/__tests__/emit/compile-mocked-branches.test.d.ts +0 -0
  3028. package/dist/src/__tests__/emit/compile-mocked-branches.test.js +238 -0
  3029. package/dist/src/__tests__/emit/compile.test.d.ts +1 -0
  3030. package/dist/src/__tests__/emit/compile.test.js +95 -0
  3031. package/dist/src/__tests__/emit/execute-chain.test.d.ts +10 -0
  3032. package/dist/src/__tests__/emit/execute-chain.test.js +94 -0
  3033. package/dist/src/__tests__/emit/index.test.d.ts +1 -0
  3034. package/dist/src/__tests__/emit/index.test.js +181 -0
  3035. package/dist/src/__tests__/emit/modules-branches.test.d.ts +1 -0
  3036. package/dist/src/__tests__/emit/modules-branches.test.js +88 -0
  3037. package/dist/src/__tests__/emit/modules-coverage.test.d.ts +15 -0
  3038. package/dist/src/__tests__/emit/modules-coverage.test.js +221 -0
  3039. package/dist/src/__tests__/emit/modules-errors.test.d.ts +12 -0
  3040. package/dist/src/__tests__/emit/modules-errors.test.js +169 -0
  3041. package/dist/src/__tests__/emit/modules-extra.test.d.ts +1 -0
  3042. package/dist/src/__tests__/emit/modules-extra.test.js +77 -0
  3043. package/dist/src/__tests__/emit/modules-rewrite.test.d.ts +17 -0
  3044. package/dist/src/__tests__/emit/modules-rewrite.test.js +204 -0
  3045. package/dist/src/__tests__/emit/source-map.test.d.ts +1 -0
  3046. package/dist/src/__tests__/emit/source-map.test.js +167 -0
  3047. package/dist/src/__tests__/entity-types.test.d.ts +1 -0
  3048. package/dist/src/__tests__/entity-types.test.js +203 -0
  3049. package/dist/src/__tests__/enum.test.js +5 -2
  3050. package/dist/src/__tests__/error-recovery.test.d.ts +7 -0
  3051. package/dist/src/__tests__/error-recovery.test.js +217 -0
  3052. package/dist/src/__tests__/events-types-extra.test.d.ts +10 -0
  3053. package/dist/src/__tests__/events-types-extra.test.js +91 -0
  3054. package/dist/src/__tests__/events-types.test.d.ts +4 -0
  3055. package/dist/src/__tests__/events-types.test.js +56 -0
  3056. package/dist/src/__tests__/for-each.test.d.ts +1 -0
  3057. package/dist/src/__tests__/for-each.test.js +125 -0
  3058. package/dist/src/__tests__/formatter.test.js +13 -5
  3059. package/dist/src/__tests__/hir/lower-extra.test.d.ts +9 -0
  3060. package/dist/src/__tests__/hir/lower-extra.test.js +140 -0
  3061. package/dist/src/__tests__/hir/monomorphize-extra.test.d.ts +15 -0
  3062. package/dist/src/__tests__/hir/monomorphize-extra.test.js +200 -0
  3063. package/dist/src/__tests__/hir/monomorphize-extra2.test.d.ts +16 -0
  3064. package/dist/src/__tests__/hir/monomorphize-extra2.test.js +316 -0
  3065. package/dist/src/__tests__/incremental.test.js +10 -2
  3066. package/dist/src/__tests__/index-extra.test.d.ts +10 -0
  3067. package/dist/src/__tests__/index-extra.test.js +71 -0
  3068. package/dist/src/__tests__/lexer.test.js +2 -2
  3069. package/dist/src/__tests__/lint/rules.test.d.ts +5 -0
  3070. package/dist/src/__tests__/lint/rules.test.js +208 -0
  3071. package/dist/src/__tests__/lir/lower.test.js +29 -0
  3072. package/dist/src/__tests__/lir/verify.test.js +30 -0
  3073. package/dist/src/__tests__/lowering.test.d.ts +1 -0
  3074. package/dist/src/__tests__/lowering.test.js +1015 -0
  3075. package/dist/src/__tests__/lsp/completion.test.d.ts +7 -0
  3076. package/dist/src/__tests__/lsp/completion.test.js +583 -0
  3077. package/dist/src/__tests__/lsp/definition.test.d.ts +7 -0
  3078. package/dist/src/__tests__/lsp/definition.test.js +454 -0
  3079. package/dist/src/__tests__/lsp/diagnostics.test.d.ts +10 -0
  3080. package/dist/src/__tests__/lsp/diagnostics.test.js +98 -0
  3081. package/dist/src/__tests__/lsp/hover-docs.test.d.ts +10 -0
  3082. package/dist/src/__tests__/lsp/hover-docs.test.js +210 -0
  3083. package/dist/src/__tests__/lsp-logic.test.d.ts +1 -0
  3084. package/dist/src/__tests__/lsp-logic.test.js +145 -0
  3085. package/dist/src/__tests__/lsp.test.js +4 -1
  3086. package/dist/src/__tests__/macro.test.d.ts +8 -0
  3087. package/dist/src/__tests__/macro.test.js +306 -0
  3088. package/dist/src/__tests__/match.test.d.ts +10 -0
  3089. package/dist/src/__tests__/match.test.js +197 -0
  3090. package/dist/src/__tests__/mc-integration/item-entity-events.test.d.ts +18 -0
  3091. package/dist/src/__tests__/mc-integration/item-entity-events.test.js +291 -0
  3092. package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.d.ts +13 -0
  3093. package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.js +837 -0
  3094. package/dist/src/__tests__/mc-integration/stdlib-coverage-3.test.d.ts +13 -0
  3095. package/dist/src/__tests__/mc-integration/stdlib-coverage-3.test.js +1227 -0
  3096. package/dist/src/__tests__/mc-integration/stdlib-coverage-4.test.d.ts +13 -0
  3097. package/dist/src/__tests__/mc-integration/stdlib-coverage-4.test.js +1509 -0
  3098. package/dist/src/__tests__/mc-integration/stdlib-coverage-5.test.d.ts +14 -0
  3099. package/dist/src/__tests__/mc-integration/stdlib-coverage-5.test.js +1374 -0
  3100. package/dist/src/__tests__/mc-integration/stdlib-coverage-6.test.d.ts +10 -0
  3101. package/dist/src/__tests__/mc-integration/stdlib-coverage-6.test.js +759 -0
  3102. package/dist/src/__tests__/mc-integration/stdlib-coverage-7.test.d.ts +13 -0
  3103. package/dist/src/__tests__/mc-integration/stdlib-coverage-7.test.js +855 -0
  3104. package/dist/src/__tests__/mc-integration/stdlib-coverage.test.d.ts +13 -0
  3105. package/dist/src/__tests__/mc-integration/stdlib-coverage.test.js +711 -0
  3106. package/dist/src/__tests__/mc-integration/syntax-coverage.test.d.ts +9 -0
  3107. package/dist/src/__tests__/mc-integration/syntax-coverage.test.js +446 -0
  3108. package/dist/src/__tests__/mc-integration.test.js +173 -7
  3109. package/dist/src/__tests__/mc-validator-coverage.test.d.ts +13 -0
  3110. package/dist/src/__tests__/mc-validator-coverage.test.js +296 -0
  3111. package/dist/src/__tests__/mc-validator-extra.test.d.ts +13 -0
  3112. package/dist/src/__tests__/mc-validator-extra.test.js +245 -0
  3113. package/dist/src/__tests__/mir/lower-extra.test.d.ts +20 -0
  3114. package/dist/src/__tests__/mir/lower-extra.test.js +361 -0
  3115. package/dist/src/__tests__/mir/lower-extra2.test.d.ts +17 -0
  3116. package/dist/src/__tests__/mir/lower-extra2.test.js +317 -0
  3117. package/dist/src/__tests__/mir/lower-extra3.test.d.ts +19 -0
  3118. package/dist/src/__tests__/mir/lower-extra3.test.js +249 -0
  3119. package/dist/src/__tests__/mir/lower-extra4.test.d.ts +23 -0
  3120. package/dist/src/__tests__/mir/lower-extra4.test.js +606 -0
  3121. package/dist/src/__tests__/mir/lower-extra5.test.d.ts +25 -0
  3122. package/dist/src/__tests__/mir/lower-extra5.test.js +543 -0
  3123. package/dist/src/__tests__/mir/lower-extra6.test.d.ts +16 -0
  3124. package/dist/src/__tests__/mir/lower-extra6.test.js +471 -0
  3125. package/dist/src/__tests__/mir/lower-extra7.test.d.ts +35 -0
  3126. package/dist/src/__tests__/mir/lower-extra7.test.js +921 -0
  3127. package/dist/src/__tests__/mir/lower-extra8.test.d.ts +19 -0
  3128. package/dist/src/__tests__/mir/lower-extra8.test.js +626 -0
  3129. package/dist/src/__tests__/mir/lower-extra9.test.d.ts +14 -0
  3130. package/dist/src/__tests__/mir/lower-extra9.test.js +717 -0
  3131. package/dist/src/__tests__/nbt.test.d.ts +1 -0
  3132. package/dist/src/__tests__/nbt.test.js +82 -0
  3133. package/dist/src/__tests__/optimizer/auto-inline.test.d.ts +1 -0
  3134. package/dist/src/__tests__/optimizer/auto-inline.test.js +176 -0
  3135. package/dist/src/__tests__/optimizer/cse.test.d.ts +4 -0
  3136. package/dist/src/__tests__/optimizer/cse.test.js +178 -0
  3137. package/dist/src/__tests__/optimizer/inline_fn.test.d.ts +1 -0
  3138. package/dist/src/__tests__/optimizer/inline_fn.test.js +221 -0
  3139. package/dist/src/__tests__/optimizer/licm.test.d.ts +1 -0
  3140. package/dist/src/__tests__/optimizer/licm.test.js +244 -0
  3141. package/dist/src/__tests__/optimizer/optimizer-extended.test.d.ts +12 -0
  3142. package/dist/src/__tests__/optimizer/optimizer-extended.test.js +993 -0
  3143. package/dist/src/__tests__/optimizer/strength-reduction.test.d.ts +1 -0
  3144. package/dist/src/__tests__/optimizer/strength-reduction.test.js +86 -0
  3145. package/dist/src/__tests__/optimizer/tco.test.d.ts +14 -0
  3146. package/dist/src/__tests__/optimizer/tco.test.js +203 -0
  3147. package/dist/src/__tests__/optimizer-advanced.test.d.ts +1 -0
  3148. package/dist/src/__tests__/optimizer-advanced.test.js +124 -0
  3149. package/dist/src/__tests__/optimizer.test.d.ts +1 -0
  3150. package/dist/src/__tests__/optimizer.test.js +149 -0
  3151. package/dist/src/__tests__/parser-coverage.test.d.ts +25 -0
  3152. package/dist/src/__tests__/parser-coverage.test.js +491 -0
  3153. package/dist/src/__tests__/parser-extra.test.d.ts +6 -0
  3154. package/dist/src/__tests__/parser-extra.test.js +451 -0
  3155. package/dist/src/__tests__/parser.test.js +15 -3
  3156. package/dist/src/__tests__/repl-extra.test.d.ts +13 -0
  3157. package/dist/src/__tests__/repl-extra.test.js +174 -0
  3158. package/dist/src/__tests__/repl-server-extra.test.d.ts +10 -0
  3159. package/dist/src/__tests__/repl-server-extra.test.js +161 -0
  3160. package/dist/src/__tests__/repl-server.test.d.ts +6 -0
  3161. package/dist/src/__tests__/repl-server.test.js +146 -0
  3162. package/dist/src/__tests__/runtime-extra.test.d.ts +15 -0
  3163. package/dist/src/__tests__/runtime-extra.test.js +732 -0
  3164. package/dist/src/__tests__/runtime.test.d.ts +1 -0
  3165. package/dist/src/__tests__/runtime.test.js +194 -0
  3166. package/dist/src/__tests__/singleton-decorator.test.d.ts +11 -0
  3167. package/dist/src/__tests__/singleton-decorator.test.js +260 -0
  3168. package/dist/src/__tests__/sourcemap.test.js +1 -1
  3169. package/dist/src/__tests__/stdlib/advanced.test.d.ts +5 -0
  3170. package/dist/src/__tests__/stdlib/advanced.test.js +301 -0
  3171. package/dist/src/__tests__/stdlib/arr-len.test.d.ts +13 -0
  3172. package/dist/src/__tests__/stdlib/arr-len.test.js +195 -0
  3173. package/dist/src/__tests__/stdlib/bigint.test.d.ts +4 -0
  3174. package/dist/src/__tests__/stdlib/bigint.test.js +83 -0
  3175. package/dist/src/__tests__/stdlib/bits.test.d.ts +4 -0
  3176. package/dist/src/__tests__/stdlib/bits.test.js +96 -0
  3177. package/dist/src/__tests__/stdlib/bossbar.test.d.ts +4 -0
  3178. package/dist/src/__tests__/stdlib/bossbar.test.js +72 -0
  3179. package/dist/src/__tests__/stdlib/color.test.d.ts +4 -0
  3180. package/dist/src/__tests__/stdlib/color.test.js +84 -0
  3181. package/dist/src/__tests__/stdlib/combat.test.d.ts +4 -0
  3182. package/dist/src/__tests__/stdlib/combat.test.js +64 -0
  3183. package/dist/src/__tests__/stdlib/cooldown.test.d.ts +4 -0
  3184. package/dist/src/__tests__/stdlib/cooldown.test.js +64 -0
  3185. package/dist/src/__tests__/stdlib/dialog.test.d.ts +6 -0
  3186. package/dist/src/__tests__/stdlib/dialog.test.js +150 -0
  3187. package/dist/src/__tests__/stdlib/ecs.test.d.ts +4 -0
  3188. package/dist/src/__tests__/stdlib/ecs.test.js +81 -0
  3189. package/dist/src/__tests__/stdlib/effects.test.d.ts +4 -0
  3190. package/dist/src/__tests__/stdlib/effects.test.js +72 -0
  3191. package/dist/src/__tests__/stdlib/events.test.d.ts +4 -0
  3192. package/dist/src/__tests__/stdlib/events.test.js +55 -0
  3193. package/dist/src/__tests__/stdlib/expr.test.d.ts +4 -0
  3194. package/dist/src/__tests__/stdlib/expr.test.js +77 -0
  3195. package/dist/src/__tests__/stdlib/fft.test.d.ts +4 -0
  3196. package/dist/src/__tests__/stdlib/fft.test.js +82 -0
  3197. package/dist/src/__tests__/stdlib/graph.test.d.ts +4 -0
  3198. package/dist/src/__tests__/stdlib/graph.test.js +102 -0
  3199. package/dist/src/__tests__/stdlib/interactions.test.d.ts +4 -0
  3200. package/dist/src/__tests__/stdlib/interactions.test.js +60 -0
  3201. package/dist/src/__tests__/stdlib/inventory.test.d.ts +4 -0
  3202. package/dist/src/__tests__/stdlib/inventory.test.js +68 -0
  3203. package/dist/src/__tests__/stdlib/linalg.test.d.ts +5 -0
  3204. package/dist/src/__tests__/stdlib/linalg.test.js +78 -0
  3205. package/dist/src/__tests__/stdlib/map.test.d.ts +1 -0
  3206. package/dist/src/__tests__/stdlib/map.test.js +84 -0
  3207. package/dist/src/__tests__/stdlib/math.test.js +19 -6
  3208. package/dist/src/__tests__/stdlib/math_hp.test.d.ts +4 -0
  3209. package/dist/src/__tests__/stdlib/math_hp.test.js +80 -0
  3210. package/dist/src/__tests__/stdlib/mobs.test.d.ts +4 -0
  3211. package/dist/src/__tests__/stdlib/mobs.test.js +61 -0
  3212. package/dist/src/__tests__/stdlib/noise.test.d.ts +4 -0
  3213. package/dist/src/__tests__/stdlib/noise.test.js +73 -0
  3214. package/dist/src/__tests__/stdlib/ode.test.d.ts +4 -0
  3215. package/dist/src/__tests__/stdlib/ode.test.js +68 -0
  3216. package/dist/src/__tests__/stdlib/parabola.test.d.ts +4 -0
  3217. package/dist/src/__tests__/stdlib/parabola.test.js +77 -0
  3218. package/dist/src/__tests__/stdlib/particles.test.d.ts +4 -0
  3219. package/dist/src/__tests__/stdlib/particles.test.js +68 -0
  3220. package/dist/src/__tests__/stdlib/physics.test.d.ts +4 -0
  3221. package/dist/src/__tests__/stdlib/physics.test.js +76 -0
  3222. package/dist/src/__tests__/stdlib/player.test.d.ts +4 -0
  3223. package/dist/src/__tests__/stdlib/player.test.js +64 -0
  3224. package/dist/src/__tests__/stdlib/quaternion.test.d.ts +4 -0
  3225. package/dist/src/__tests__/stdlib/quaternion.test.js +73 -0
  3226. package/dist/src/__tests__/stdlib/queue.test.d.ts +1 -0
  3227. package/dist/src/__tests__/stdlib/queue.test.js +97 -0
  3228. package/dist/src/__tests__/stdlib/random.test.d.ts +4 -0
  3229. package/dist/src/__tests__/stdlib/random.test.js +76 -0
  3230. package/dist/src/__tests__/stdlib/result.test.d.ts +12 -0
  3231. package/dist/src/__tests__/stdlib/result.test.js +329 -0
  3232. package/dist/src/__tests__/stdlib/scheduler.test.d.ts +6 -0
  3233. package/dist/src/__tests__/stdlib/scheduler.test.js +188 -0
  3234. package/dist/src/__tests__/stdlib/set_int.test.d.ts +1 -0
  3235. package/dist/src/__tests__/stdlib/set_int.test.js +88 -0
  3236. package/dist/src/__tests__/stdlib/sets.test.d.ts +6 -0
  3237. package/dist/src/__tests__/stdlib/sets.test.js +60 -0
  3238. package/dist/src/__tests__/stdlib/signal.test.d.ts +4 -0
  3239. package/dist/src/__tests__/stdlib/signal.test.js +84 -0
  3240. package/dist/src/__tests__/stdlib/sort-v2.test.d.ts +4 -0
  3241. package/dist/src/__tests__/stdlib/sort-v2.test.js +131 -0
  3242. package/dist/src/__tests__/stdlib/spawn.test.d.ts +4 -0
  3243. package/dist/src/__tests__/stdlib/spawn.test.js +68 -0
  3244. package/dist/src/__tests__/stdlib/state.test.d.ts +5 -0
  3245. package/dist/src/__tests__/stdlib/state.test.js +176 -0
  3246. package/dist/src/__tests__/stdlib/string.test.d.ts +12 -0
  3247. package/dist/src/__tests__/stdlib/string.test.js +231 -0
  3248. package/dist/src/__tests__/stdlib/strings.test.d.ts +4 -0
  3249. package/dist/src/__tests__/stdlib/strings.test.js +83 -0
  3250. package/dist/src/__tests__/stdlib/tags.test.d.ts +4 -0
  3251. package/dist/src/__tests__/stdlib/tags.test.js +57 -0
  3252. package/dist/src/__tests__/stdlib/teams.test.d.ts +4 -0
  3253. package/dist/src/__tests__/stdlib/teams.test.js +72 -0
  3254. package/dist/src/__tests__/stdlib/timer.test.d.ts +4 -0
  3255. package/dist/src/__tests__/stdlib/timer.test.js +79 -0
  3256. package/dist/src/__tests__/stdlib/vec.test.d.ts +5 -0
  3257. package/dist/src/__tests__/stdlib/vec.test.js +94 -0
  3258. package/dist/src/__tests__/stdlib/world.test.d.ts +4 -0
  3259. package/dist/src/__tests__/stdlib/world.test.js +72 -0
  3260. package/dist/src/__tests__/stdlib-advanced.test.d.ts +4 -0
  3261. package/dist/src/__tests__/stdlib-advanced.test.js +374 -0
  3262. package/dist/src/__tests__/stdlib-bigint.test.d.ts +7 -0
  3263. package/dist/src/__tests__/stdlib-bigint.test.js +426 -0
  3264. package/dist/src/__tests__/stdlib-math.test.d.ts +7 -0
  3265. package/dist/src/__tests__/stdlib-math.test.js +351 -0
  3266. package/dist/src/__tests__/stdlib-vec.test.d.ts +4 -0
  3267. package/dist/src/__tests__/stdlib-vec.test.js +263 -0
  3268. package/dist/src/__tests__/struct-display.test.d.ts +1 -0
  3269. package/dist/src/__tests__/struct-display.test.js +64 -0
  3270. package/dist/src/__tests__/structure-optimizer.test.d.ts +1 -0
  3271. package/dist/src/__tests__/structure-optimizer.test.js +33 -0
  3272. package/dist/src/__tests__/test-framework/runner.test.d.ts +10 -0
  3273. package/dist/src/__tests__/test-framework/runner.test.js +193 -0
  3274. package/dist/src/__tests__/timer-debug.test.d.ts +1 -0
  3275. package/dist/src/__tests__/timer-debug.test.js +33 -0
  3276. package/dist/src/__tests__/tuner/adapters.test.d.ts +14 -0
  3277. package/dist/src/__tests__/tuner/adapters.test.js +194 -0
  3278. package/dist/src/__tests__/tuner/simulator-extra.test.d.ts +4 -0
  3279. package/dist/src/__tests__/tuner/simulator-extra.test.js +193 -0
  3280. package/dist/src/__tests__/typechecker-coverage.test.d.ts +30 -0
  3281. package/dist/src/__tests__/typechecker-coverage.test.js +627 -0
  3282. package/dist/src/__tests__/typechecker.test.js +8 -6
  3283. package/dist/src/__tests__/var-allocator.test.d.ts +1 -0
  3284. package/dist/src/__tests__/var-allocator.test.js +69 -0
  3285. package/dist/src/__tests__/watch-decorator.test.d.ts +1 -0
  3286. package/dist/src/__tests__/watch-decorator.test.js +54 -0
  3287. package/dist/src/ast/types.d.ts +123 -4
  3288. package/dist/src/cache/incremental.d.ts +13 -14
  3289. package/dist/src/cache/incremental.js +106 -89
  3290. package/dist/src/cache/index.d.ts +8 -2
  3291. package/dist/src/cache/index.js +18 -6
  3292. package/dist/src/cli.d.ts +1 -0
  3293. package/dist/src/cli.js +466 -17
  3294. package/dist/src/codegen/cmdblock/index.d.ts +26 -0
  3295. package/dist/src/codegen/cmdblock/index.js +45 -0
  3296. package/dist/src/codegen/mcfunction/index.d.ts +40 -0
  3297. package/dist/src/codegen/mcfunction/index.js +606 -0
  3298. package/dist/src/codegen/structure/index.d.ts +24 -0
  3299. package/dist/src/codegen/structure/index.js +279 -0
  3300. package/dist/src/codegen/var-allocator.d.ts +45 -0
  3301. package/dist/src/codegen/var-allocator.js +104 -0
  3302. package/dist/src/config/project-config.d.ts +29 -0
  3303. package/dist/src/config/project-config.js +180 -0
  3304. package/dist/src/diagnostics/index.d.ts +9 -0
  3305. package/dist/src/diagnostics/index.js +18 -1
  3306. package/dist/src/emit/compile.d.ts +10 -0
  3307. package/dist/src/emit/compile.js +405 -50
  3308. package/dist/src/emit/index.d.ts +42 -0
  3309. package/dist/src/emit/index.js +326 -14
  3310. package/dist/src/emit/modules.js +24 -5
  3311. package/dist/src/emit/sourcemap.d.ts +23 -27
  3312. package/dist/src/emit/sourcemap.js +52 -30
  3313. package/dist/src/events/types.d.ts +1 -1
  3314. package/dist/src/events/types.js +4 -1
  3315. package/dist/src/formatter/index.js +33 -8
  3316. package/dist/src/hir/deprecated.d.ts +13 -0
  3317. package/dist/src/hir/deprecated.js +218 -0
  3318. package/dist/src/hir/lower.js +199 -9
  3319. package/dist/src/hir/monomorphize.js +32 -6
  3320. package/dist/src/hir/types.d.ts +80 -2
  3321. package/dist/src/index.d.ts +6 -0
  3322. package/dist/src/index.js +18 -3
  3323. package/dist/src/ir/builder.d.ts +33 -0
  3324. package/dist/src/ir/builder.js +99 -0
  3325. package/dist/src/ir/types.d.ts +132 -0
  3326. package/dist/src/ir/types.js +15 -0
  3327. package/dist/src/lexer/index.d.ts +2 -1
  3328. package/dist/src/lexer/index.js +39 -3
  3329. package/dist/src/lint/index.d.ts +45 -0
  3330. package/dist/src/lint/index.js +930 -0
  3331. package/dist/src/lir/lower.js +34 -0
  3332. package/dist/src/lir/types.d.ts +2 -0
  3333. package/dist/src/lowering/index.d.ts +188 -0
  3334. package/dist/src/lowering/index.js +3405 -0
  3335. package/dist/src/lsp/main.js +0 -0
  3336. package/dist/src/lsp/server.js +423 -123
  3337. package/dist/src/mir/lower.js +1075 -88
  3338. package/dist/src/mir/macro.js +36 -2
  3339. package/dist/src/mir/types.d.ts +17 -0
  3340. package/dist/src/mir/verify.js +11 -0
  3341. package/dist/src/optimizer/auto-inline.d.ts +2 -0
  3342. package/dist/src/optimizer/auto-inline.js +67 -0
  3343. package/dist/src/optimizer/commands.d.ts +38 -0
  3344. package/dist/src/optimizer/commands.js +451 -0
  3345. package/dist/src/optimizer/cse.d.ts +20 -0
  3346. package/dist/src/optimizer/cse.js +234 -0
  3347. package/dist/src/optimizer/inline.d.ts +26 -0
  3348. package/dist/src/optimizer/inline.js +286 -0
  3349. package/dist/src/optimizer/interprocedural.js +8 -0
  3350. package/dist/src/optimizer/licm.d.ts +32 -0
  3351. package/dist/src/optimizer/licm.js +371 -0
  3352. package/dist/src/optimizer/passes.d.ts +34 -0
  3353. package/dist/src/optimizer/passes.js +243 -0
  3354. package/dist/src/optimizer/pipeline.js +12 -2
  3355. package/dist/src/optimizer/strength_reduction.d.ts +15 -0
  3356. package/dist/src/optimizer/strength_reduction.js +90 -0
  3357. package/dist/src/optimizer/structure.d.ts +9 -0
  3358. package/dist/src/optimizer/structure.js +356 -0
  3359. package/dist/src/optimizer/tco.d.ts +53 -0
  3360. package/dist/src/optimizer/tco.js +238 -0
  3361. package/dist/src/parser/index.d.ts +33 -0
  3362. package/dist/src/parser/index.js +480 -71
  3363. package/dist/src/repl-server.d.ts +13 -0
  3364. package/dist/src/repl-server.js +127 -0
  3365. package/dist/src/runtime/index.js +24 -0
  3366. package/dist/src/structs/expand.d.ts +15 -0
  3367. package/dist/src/structs/expand.js +46 -0
  3368. package/dist/src/testing/runner.d.ts +40 -0
  3369. package/dist/src/testing/runner.js +237 -0
  3370. package/dist/src/typechecker/index.d.ts +3 -0
  3371. package/dist/src/typechecker/index.js +265 -13
  3372. package/dist/src2/__tests__/e2e/basic.test.d.ts +8 -0
  3373. package/dist/src2/__tests__/e2e/basic.test.js +140 -0
  3374. package/dist/src2/__tests__/e2e/macros.test.d.ts +9 -0
  3375. package/dist/src2/__tests__/e2e/macros.test.js +182 -0
  3376. package/dist/src2/__tests__/e2e/migrate.test.d.ts +13 -0
  3377. package/dist/src2/__tests__/e2e/migrate.test.js +2739 -0
  3378. package/dist/src2/__tests__/hir/desugar.test.d.ts +1 -0
  3379. package/dist/src2/__tests__/hir/desugar.test.js +234 -0
  3380. package/dist/src2/__tests__/lir/lower.test.d.ts +1 -0
  3381. package/dist/src2/__tests__/lir/lower.test.js +559 -0
  3382. package/dist/src2/__tests__/lir/types.test.d.ts +1 -0
  3383. package/dist/src2/__tests__/lir/types.test.js +185 -0
  3384. package/dist/src2/__tests__/lir/verify.test.d.ts +1 -0
  3385. package/dist/src2/__tests__/lir/verify.test.js +221 -0
  3386. package/dist/src2/__tests__/mir/arithmetic.test.d.ts +1 -0
  3387. package/dist/src2/__tests__/mir/arithmetic.test.js +130 -0
  3388. package/dist/src2/__tests__/mir/control-flow.test.d.ts +1 -0
  3389. package/dist/src2/__tests__/mir/control-flow.test.js +205 -0
  3390. package/dist/src2/__tests__/mir/verify.test.d.ts +1 -0
  3391. package/dist/src2/__tests__/mir/verify.test.js +223 -0
  3392. package/dist/src2/__tests__/optimizer/block_merge.test.d.ts +1 -0
  3393. package/dist/src2/__tests__/optimizer/block_merge.test.js +78 -0
  3394. package/dist/src2/__tests__/optimizer/branch_simplify.test.d.ts +1 -0
  3395. package/dist/src2/__tests__/optimizer/branch_simplify.test.js +58 -0
  3396. package/dist/src2/__tests__/optimizer/constant_fold.test.d.ts +1 -0
  3397. package/dist/src2/__tests__/optimizer/constant_fold.test.js +131 -0
  3398. package/dist/src2/__tests__/optimizer/copy_prop.test.d.ts +1 -0
  3399. package/dist/src2/__tests__/optimizer/copy_prop.test.js +91 -0
  3400. package/dist/src2/__tests__/optimizer/dce.test.d.ts +1 -0
  3401. package/dist/src2/__tests__/optimizer/dce.test.js +76 -0
  3402. package/dist/src2/__tests__/optimizer/pipeline.test.d.ts +1 -0
  3403. package/dist/src2/__tests__/optimizer/pipeline.test.js +102 -0
  3404. package/dist/src2/emit/compile.d.ts +19 -0
  3405. package/dist/src2/emit/compile.js +80 -0
  3406. package/dist/src2/emit/index.d.ts +17 -0
  3407. package/dist/src2/emit/index.js +172 -0
  3408. package/dist/src2/hir/lower.d.ts +15 -0
  3409. package/dist/src2/hir/lower.js +378 -0
  3410. package/dist/src2/hir/types.d.ts +373 -0
  3411. package/dist/src2/hir/types.js +16 -0
  3412. package/dist/src2/lir/lower.d.ts +15 -0
  3413. package/dist/src2/lir/lower.js +453 -0
  3414. package/dist/src2/lir/types.d.ts +136 -0
  3415. package/dist/src2/lir/types.js +11 -0
  3416. package/dist/src2/lir/verify.d.ts +14 -0
  3417. package/dist/src2/lir/verify.js +113 -0
  3418. package/dist/src2/mir/lower.d.ts +9 -0
  3419. package/dist/src2/mir/lower.js +1030 -0
  3420. package/dist/src2/mir/macro.d.ts +22 -0
  3421. package/dist/src2/mir/macro.js +168 -0
  3422. package/dist/src2/mir/types.d.ts +183 -0
  3423. package/dist/src2/mir/types.js +11 -0
  3424. package/dist/src2/mir/verify.d.ts +16 -0
  3425. package/dist/src2/mir/verify.js +216 -0
  3426. package/dist/src2/optimizer/block_merge.d.ts +12 -0
  3427. package/dist/src2/optimizer/block_merge.js +84 -0
  3428. package/dist/src2/optimizer/branch_simplify.d.ts +9 -0
  3429. package/dist/src2/optimizer/branch_simplify.js +28 -0
  3430. package/dist/src2/optimizer/constant_fold.d.ts +10 -0
  3431. package/dist/src2/optimizer/constant_fold.js +85 -0
  3432. package/dist/src2/optimizer/copy_prop.d.ts +9 -0
  3433. package/dist/src2/optimizer/copy_prop.js +113 -0
  3434. package/dist/src2/optimizer/dce.d.ts +8 -0
  3435. package/dist/src2/optimizer/dce.js +155 -0
  3436. package/dist/src2/optimizer/pipeline.d.ts +10 -0
  3437. package/dist/src2/optimizer/pipeline.js +42 -0
  3438. package/dist/swap_test.map.json +14 -0
  3439. package/dist/tsconfig.tsbuildinfo +1 -0
  3440. package/dist/typechecker/index.d.ts +61 -0
  3441. package/dist/typechecker/index.js +1034 -0
  3442. package/dist/types/entity-hierarchy.d.ts +29 -0
  3443. package/dist/types/entity-hierarchy.js +107 -0
  3444. package/doc-drafts/redscript-docs/docs/en/stdlib/graph.md +104 -0
  3445. package/doc-drafts/redscript-docs/docs/en/stdlib/parabola.md +113 -0
  3446. package/doc-drafts/redscript-docs/docs/en/stdlib/pathfind.md +104 -0
  3447. package/doc-drafts/redscript-docs/docs/en/stdlib/physics.md +134 -0
  3448. package/doc-drafts/redscript-docs/docs/en/stdlib/quaternion.md +135 -0
  3449. package/doc-drafts/redscript-docs/docs/zh/stdlib/graph.md +104 -0
  3450. package/doc-drafts/redscript-docs/docs/zh/stdlib/parabola.md +113 -0
  3451. package/doc-drafts/redscript-docs/docs/zh/stdlib/pathfind.md +104 -0
  3452. package/doc-drafts/redscript-docs/docs/zh/stdlib/physics.md +134 -0
  3453. package/doc-drafts/redscript-docs/docs/zh/stdlib/quaternion.md +135 -0
  3454. package/docs/stdlib/result.md +156 -0
  3455. package/docs/stdlib/result.zh.md +156 -0
  3456. package/editors/vscode/fixtures/test.mcrs +7 -0
  3457. package/editors/vscode/out/extension.js +2763 -340
  3458. package/editors/vscode/out/lsp-server.js +15322 -0
  3459. package/editors/vscode/package-lock.json +9 -4
  3460. package/editors/vscode/package.json +1 -1
  3461. package/editors/vscode/snippets/redscript.json +109 -30
  3462. package/editors/vscode/src/extension.ts +4 -7
  3463. package/examples/display-demo.mcrs +64 -0
  3464. package/examples/game/racing.mcrs +301 -0
  3465. package/examples/game/tower_defense.mcrs +311 -0
  3466. package/examples/math/physics_sim.mcrs +322 -0
  3467. package/examples/rpg/boss_fight.mcrs +313 -0
  3468. package/examples/rpg/health_system.mcrs +237 -0
  3469. package/examples/rpg/inventory.mcrs +265 -0
  3470. package/examples/util/debug_hud.mcrs +279 -0
  3471. package/jest.config.js +15 -2
  3472. package/package.json +12 -3
  3473. package/playground/index.html +823 -0
  3474. package/scripts/gen-docs.ts +533 -0
  3475. package/scripts/update-redscript-docs-stdlib.sh +770 -0
  3476. package/src/__tests__/array-dynamic.test.ts +42 -0
  3477. package/src/__tests__/budget.test.ts +5 -0
  3478. package/src/__tests__/builtins.test.ts +66 -0
  3479. package/src/__tests__/cache/cache-behavior.test.ts +480 -0
  3480. package/src/__tests__/cache-extra.test.ts +199 -0
  3481. package/src/__tests__/cli-docs.test.ts +77 -0
  3482. package/src/__tests__/cli-init.test.ts +91 -0
  3483. package/src/__tests__/cli-publish.test.ts +190 -0
  3484. package/src/__tests__/cli.test.ts +117 -1
  3485. package/src/__tests__/compile-preprocess.test.ts +366 -0
  3486. package/src/__tests__/compiler/break-stmt.test.ts +66 -0
  3487. package/src/__tests__/compiler/const-decl.test.ts +141 -0
  3488. package/src/__tests__/compiler/continue-stmt.test.ts +81 -0
  3489. package/src/__tests__/compiler/coroutine-extended.test.ts +723 -0
  3490. package/src/__tests__/compiler/deprecated.test.ts +305 -0
  3491. package/src/__tests__/compiler/do-while.test.ts +130 -0
  3492. package/src/__tests__/compiler/enum-payload.test.ts +299 -0
  3493. package/src/__tests__/compiler/interface.test.ts +287 -0
  3494. package/src/__tests__/compiler/labeled-loops.test.ts +279 -0
  3495. package/src/__tests__/compiler/match-string.test.ts +45 -0
  3496. package/src/__tests__/compiler/memoize.test.ts +126 -0
  3497. package/src/__tests__/compiler/method-chain.test.ts +121 -0
  3498. package/src/__tests__/compiler/module-import.test.ts +240 -0
  3499. package/src/__tests__/compiler/option-extensions.test.ts +207 -0
  3500. package/src/__tests__/compiler/profile-decorator.test.ts +79 -0
  3501. package/src/__tests__/compiler/string-advanced.test.ts +310 -0
  3502. package/src/__tests__/compiler/struct-extends.test.ts +109 -0
  3503. package/src/__tests__/compiler/throttle-retry.test.ts +191 -0
  3504. package/src/__tests__/compiler/tuple-type.test.ts +263 -0
  3505. package/src/__tests__/compiler/watch-decorator.test.ts +72 -0
  3506. package/src/__tests__/config/project-config.test.ts +181 -0
  3507. package/src/__tests__/config-decorator.test.ts +157 -0
  3508. package/src/__tests__/diagnostics-extra.test.ts +155 -0
  3509. package/src/__tests__/e2e/ecs-stdlib.test.ts +371 -0
  3510. package/src/__tests__/e2e/events-stdlib.test.ts +50 -0
  3511. package/src/__tests__/e2e/fft-stdlib.test.ts +313 -0
  3512. package/src/__tests__/e2e/ode-stdlib.test.ts +68 -0
  3513. package/src/__tests__/e2e/stdlib-e2e.test.ts +266 -0
  3514. package/src/__tests__/emit/compile-branches.test.ts +135 -0
  3515. package/src/__tests__/emit/compile-coverage.test.ts +696 -0
  3516. package/src/__tests__/emit/compile-extra-branches.test.ts +228 -0
  3517. package/src/__tests__/emit/compile-mocked-branches.test.ts +249 -0
  3518. package/src/__tests__/emit/compile.test.ts +107 -0
  3519. package/src/__tests__/emit/execute-chain.test.ts +114 -0
  3520. package/src/__tests__/emit/index.test.ts +190 -0
  3521. package/src/__tests__/emit/modules-branches.test.ts +90 -0
  3522. package/src/__tests__/emit/modules-coverage.test.ts +241 -0
  3523. package/src/__tests__/emit/modules-errors.test.ts +192 -0
  3524. package/src/__tests__/emit/modules-extra.test.ts +80 -0
  3525. package/src/__tests__/emit/modules-rewrite.test.ts +232 -0
  3526. package/src/__tests__/emit/source-map.test.ts +152 -0
  3527. package/src/__tests__/enum.test.ts +5 -2
  3528. package/src/__tests__/error-recovery.test.ts +226 -0
  3529. package/src/__tests__/events-types-extra.test.ts +110 -0
  3530. package/src/__tests__/events-types.test.ts +66 -0
  3531. package/src/__tests__/for-each.test.ts +135 -0
  3532. package/src/__tests__/formatter.test.ts +15 -5
  3533. package/src/__tests__/generics.test.ts +16 -9
  3534. package/src/__tests__/hir/lower-extra.test.ts +151 -0
  3535. package/src/__tests__/hir/monomorphize-coverage.test.ts +432 -0
  3536. package/src/__tests__/hir/monomorphize-extra.test.ts +220 -0
  3537. package/src/__tests__/hir/monomorphize-extra2.test.ts +350 -0
  3538. package/src/__tests__/impl.test.ts +12 -8
  3539. package/src/__tests__/incremental.test.ts +10 -2
  3540. package/src/__tests__/index-extra.test.ts +79 -0
  3541. package/src/__tests__/lexer.test.ts +2 -2
  3542. package/src/__tests__/lint/hir-coverage.test.ts +1716 -0
  3543. package/src/__tests__/lint/rules-coverage.test.ts +598 -0
  3544. package/src/__tests__/lint/rules.test.ts +230 -0
  3545. package/src/__tests__/lir/lower.test.ts +33 -0
  3546. package/src/__tests__/lir/verify.test.ts +33 -0
  3547. package/src/__tests__/lsp/completion.test.ts +687 -0
  3548. package/src/__tests__/lsp/definition.test.ts +499 -0
  3549. package/src/__tests__/lsp/diagnostics.test.ts +108 -0
  3550. package/src/__tests__/lsp/hover-docs.test.ts +222 -0
  3551. package/src/__tests__/lsp-logic.test.ts +162 -0
  3552. package/src/__tests__/lsp.test.ts +4 -1
  3553. package/src/__tests__/match.test.ts +212 -0
  3554. package/src/__tests__/mc-integration/item-entity-events.test.ts +303 -0
  3555. package/src/__tests__/mc-integration/stdlib-coverage-2.test.ts +822 -0
  3556. package/src/__tests__/mc-integration/stdlib-coverage-3.test.ts +1105 -0
  3557. package/src/__tests__/mc-integration/stdlib-coverage-4.test.ts +1366 -0
  3558. package/src/__tests__/mc-integration/stdlib-coverage-5.test.ts +1245 -0
  3559. package/src/__tests__/mc-integration/stdlib-coverage-6.test.ts +755 -0
  3560. package/src/__tests__/mc-integration/stdlib-coverage-7.test.ts +771 -0
  3561. package/src/__tests__/mc-integration/stdlib-coverage.test.ts +704 -0
  3562. package/src/__tests__/mc-integration/syntax-coverage.test.ts +469 -0
  3563. package/src/__tests__/mc-integration.test.ts +184 -6
  3564. package/src/__tests__/mc-validator-coverage.test.ts +325 -0
  3565. package/src/__tests__/mc-validator-extra.test.ts +252 -0
  3566. package/src/__tests__/mir/lower-extra.test.ts +402 -0
  3567. package/src/__tests__/mir/lower-extra2.test.ts +348 -0
  3568. package/src/__tests__/mir/lower-extra3.test.ts +277 -0
  3569. package/src/__tests__/mir/lower-extra4.test.ts +636 -0
  3570. package/src/__tests__/mir/lower-extra5.test.ts +612 -0
  3571. package/src/__tests__/mir/lower-extra6.test.ts +520 -0
  3572. package/src/__tests__/mir/lower-extra7.test.ts +1045 -0
  3573. package/src/__tests__/mir/lower-extra8.test.ts +704 -0
  3574. package/src/__tests__/mir/lower-extra9.test.ts +821 -0
  3575. package/src/__tests__/optimizer/auto-inline.test.ts +206 -0
  3576. package/src/__tests__/optimizer/cse.test.ts +195 -0
  3577. package/src/__tests__/optimizer/inline_fn.test.ts +263 -0
  3578. package/src/__tests__/optimizer/licm.test.ts +358 -0
  3579. package/src/__tests__/optimizer/nbt-coalesce.test.ts +147 -0
  3580. package/src/__tests__/optimizer/optimizer-extended.test.ts +1081 -0
  3581. package/src/__tests__/optimizer/scoreboard-batch.test.ts +141 -0
  3582. package/src/__tests__/optimizer/strength-reduction.test.ts +111 -0
  3583. package/src/__tests__/optimizer/tco-coverage.test.ts +309 -0
  3584. package/src/__tests__/optimizer/tco.test.ts +238 -0
  3585. package/src/__tests__/option.test.ts +14 -7
  3586. package/src/__tests__/parser-coverage.test.ts +576 -0
  3587. package/src/__tests__/parser-extra.test.ts +531 -0
  3588. package/src/__tests__/parser.test.ts +17 -3
  3589. package/src/__tests__/repl-extra.test.ts +195 -0
  3590. package/src/__tests__/repl-server-extra.test.ts +150 -0
  3591. package/src/__tests__/repl-server.test.ts +122 -0
  3592. package/src/__tests__/runtime-extra.test.ts +862 -0
  3593. package/src/__tests__/runtime.test.ts +194 -0
  3594. package/src/__tests__/singleton-decorator.test.ts +285 -0
  3595. package/src/__tests__/sourcemap.test.ts +1 -1
  3596. package/src/__tests__/stdlib/advanced.test.ts +312 -0
  3597. package/src/__tests__/stdlib/arr-len.test.ts +231 -0
  3598. package/src/__tests__/stdlib/bigint.test.ts +57 -0
  3599. package/src/__tests__/stdlib/bits.test.ts +75 -0
  3600. package/src/__tests__/stdlib/bossbar.test.ts +45 -0
  3601. package/src/__tests__/stdlib/color.test.ts +60 -0
  3602. package/src/__tests__/stdlib/combat.test.ts +35 -0
  3603. package/src/__tests__/stdlib/cooldown.test.ts +35 -0
  3604. package/src/__tests__/stdlib/dialog.test.ts +140 -0
  3605. package/src/__tests__/stdlib/ecs.test.ts +54 -0
  3606. package/src/__tests__/stdlib/effects.test.ts +45 -0
  3607. package/src/__tests__/stdlib/events.test.ts +23 -0
  3608. package/src/__tests__/stdlib/expr.test.ts +48 -0
  3609. package/src/__tests__/stdlib/fft.test.ts +54 -0
  3610. package/src/__tests__/stdlib/graph.test.ts +77 -0
  3611. package/src/__tests__/stdlib/interactions.test.ts +30 -0
  3612. package/src/__tests__/stdlib/inventory.test.ts +40 -0
  3613. package/src/__tests__/stdlib/linalg.test.ts +52 -0
  3614. package/src/__tests__/stdlib/map.test.ts +55 -0
  3615. package/src/__tests__/stdlib/math.test.ts +19 -5
  3616. package/src/__tests__/stdlib/math_hp.test.ts +55 -0
  3617. package/src/__tests__/stdlib/mobs.test.ts +40 -0
  3618. package/src/__tests__/stdlib/noise.test.ts +46 -0
  3619. package/src/__tests__/stdlib/ode.test.ts +40 -0
  3620. package/src/__tests__/stdlib/parabola.test.ts +51 -0
  3621. package/src/__tests__/stdlib/particles.test.ts +40 -0
  3622. package/src/__tests__/stdlib/physics.test.ts +50 -0
  3623. package/src/__tests__/stdlib/player.test.ts +35 -0
  3624. package/src/__tests__/stdlib/quaternion.test.ts +46 -0
  3625. package/src/__tests__/stdlib/queue.test.ts +73 -0
  3626. package/src/__tests__/stdlib/random.test.ts +50 -0
  3627. package/src/__tests__/stdlib/result.test.ts +326 -0
  3628. package/src/__tests__/stdlib/scheduler.test.ts +182 -0
  3629. package/src/__tests__/stdlib/set_int.test.ts +62 -0
  3630. package/src/__tests__/stdlib/sets.test.ts +28 -0
  3631. package/src/__tests__/stdlib/signal.test.ts +60 -0
  3632. package/src/__tests__/stdlib/sort-v2.test.ts +111 -0
  3633. package/src/__tests__/stdlib/spawn.test.ts +40 -0
  3634. package/src/__tests__/stdlib/state.test.ts +164 -0
  3635. package/src/__tests__/stdlib/string.test.ts +224 -0
  3636. package/src/__tests__/stdlib/strings.test.ts +55 -0
  3637. package/src/__tests__/stdlib/tags.test.ts +32 -0
  3638. package/src/__tests__/stdlib/teams.test.ts +45 -0
  3639. package/src/__tests__/stdlib/timer.test.ts +53 -0
  3640. package/src/__tests__/stdlib/vec.test.ts +72 -0
  3641. package/src/__tests__/stdlib/world.test.ts +45 -0
  3642. package/src/__tests__/struct-display.test.ts +69 -0
  3643. package/src/__tests__/test-framework/runner.test.ts +208 -0
  3644. package/src/__tests__/tuner/adapters.test.ts +232 -0
  3645. package/src/__tests__/tuner/simulator-extra.test.ts +222 -0
  3646. package/src/__tests__/tuple.test.ts +11 -4
  3647. package/src/__tests__/typechecker-coverage.test.ts +671 -0
  3648. package/src/__tests__/typechecker.test.ts +9 -6
  3649. package/src/__tests__/watch-decorator.test.ts +59 -0
  3650. package/src/ast/types.ts +78 -4
  3651. package/src/cache/incremental.ts +128 -99
  3652. package/src/cache/index.ts +35 -8
  3653. package/src/cli.ts +538 -29
  3654. package/src/config/project-config.ts +176 -0
  3655. package/src/diagnostics/index.ts +22 -0
  3656. package/src/docs.ts +98 -0
  3657. package/src/emit/compile.ts +417 -51
  3658. package/src/emit/index.ts +389 -18
  3659. package/src/emit/modules.ts +21 -4
  3660. package/src/emit/sourcemap.ts +64 -43
  3661. package/src/events/types.ts +4 -1
  3662. package/src/examples/capture_the_flag.mcrs +2 -2
  3663. package/src/examples/hunger_games.mcrs +4 -4
  3664. package/src/examples/parkour_race.mcrs +8 -8
  3665. package/src/examples/tutorial_02_variables.mcrs +5 -5
  3666. package/src/examples/tutorial_03_functions_structs.mcrs +6 -6
  3667. package/src/examples/tutorial_04_selectors.mcrs +1 -1
  3668. package/src/examples/tutorial_05_decorators.mcrs +3 -3
  3669. package/src/examples/tutorial_06_math_particles.mcrs +9 -9
  3670. package/src/examples/tutorial_07_random.mcrs +4 -4
  3671. package/src/examples/tutorial_08_coroutine.mcrs +7 -7
  3672. package/src/examples/tutorial_09_precision.mcrs +12 -12
  3673. package/src/examples/tutorial_10_kill_race.mcrs +7 -7
  3674. package/src/examples/zombie_survival.mcrs +7 -7
  3675. package/src/formatter/index.ts +35 -8
  3676. package/src/hir/deprecated.ts +212 -0
  3677. package/src/hir/lower.ts +225 -11
  3678. package/src/hir/monomorphize.ts +34 -7
  3679. package/src/hir/types.ts +38 -2
  3680. package/src/index.ts +23 -3
  3681. package/src/lexer/index.ts +45 -6
  3682. package/src/lint/index.ts +922 -0
  3683. package/src/lir/lower.ts +36 -0
  3684. package/src/lir/types.ts +4 -0
  3685. package/src/lsp/server.ts +418 -118
  3686. package/src/mir/lower.ts +1080 -92
  3687. package/src/mir/macro.ts +30 -2
  3688. package/src/mir/types.ts +14 -0
  3689. package/src/mir/verify.ts +12 -2
  3690. package/src/optimizer/auto-inline.ts +86 -0
  3691. package/src/optimizer/copy_prop.ts +2 -2
  3692. package/src/optimizer/coroutine.ts +3 -3
  3693. package/src/optimizer/cse.ts +205 -0
  3694. package/src/optimizer/dce.ts +2 -2
  3695. package/src/optimizer/inline.ts +335 -0
  3696. package/src/optimizer/interprocedural.ts +9 -1
  3697. package/src/optimizer/licm.ts +454 -0
  3698. package/src/optimizer/nbt-coalesce.ts +109 -0
  3699. package/src/optimizer/pipeline.ts +16 -2
  3700. package/src/optimizer/scoreboard-batch.ts +52 -0
  3701. package/src/optimizer/strength_reduction.ts +95 -0
  3702. package/src/optimizer/tco.ts +267 -0
  3703. package/src/optimizer/unroll.ts +2 -2
  3704. package/src/parser/index.ts +488 -66
  3705. package/src/repl-server.ts +102 -0
  3706. package/src/runtime/index.ts +26 -0
  3707. package/src/stdlib/advanced.mcrs +271 -101
  3708. package/src/stdlib/bigint.mcrs +224 -11
  3709. package/src/stdlib/bits.mcrs +75 -12
  3710. package/src/stdlib/bossbar.mcrs +37 -8
  3711. package/src/stdlib/calculus.mcrs +82 -26
  3712. package/src/stdlib/color.mcrs +98 -16
  3713. package/src/stdlib/combat.mcrs +36 -12
  3714. package/src/stdlib/cooldown.mcrs +19 -0
  3715. package/src/stdlib/dialog.mcrs +93 -0
  3716. package/src/stdlib/easing.mcrs +132 -12
  3717. package/src/stdlib/ecs.mcrs +355 -0
  3718. package/src/stdlib/effects.mcrs +88 -12
  3719. package/src/stdlib/events.mcrs +48 -0
  3720. package/src/stdlib/expr.mcrs +18 -3
  3721. package/src/stdlib/fft.mcrs +187 -0
  3722. package/src/stdlib/geometry.mcrs +137 -39
  3723. package/src/stdlib/graph.mcrs +347 -0
  3724. package/src/stdlib/heap.mcrs +49 -8
  3725. package/src/stdlib/i18n/zh.yaml +2891 -0
  3726. package/src/stdlib/interactions.mcrs +43 -20
  3727. package/src/stdlib/inventory.mcrs +14 -3
  3728. package/src/stdlib/linalg.mcrs +415 -0
  3729. package/src/stdlib/list.mcrs +168 -18
  3730. package/src/stdlib/map.mcrs +112 -0
  3731. package/src/stdlib/math.mcrs +68 -18
  3732. package/src/stdlib/math_hp.mcrs +124 -33
  3733. package/src/stdlib/matrix.mcrs +237 -11
  3734. package/src/stdlib/mobs.mcrs +87 -0
  3735. package/src/stdlib/noise.mcrs +65 -21
  3736. package/src/stdlib/ode.mcrs +264 -0
  3737. package/src/stdlib/parabola.mcrs +104 -29
  3738. package/src/stdlib/particles.mcrs +78 -21
  3739. package/src/stdlib/pathfind.mcrs +89 -35
  3740. package/src/stdlib/physics.mcrs +134 -26
  3741. package/src/stdlib/player.mcrs +18 -0
  3742. package/src/stdlib/quaternion.mcrs +213 -9
  3743. package/src/stdlib/queue.mcrs +123 -0
  3744. package/src/stdlib/random.mcrs +63 -18
  3745. package/src/stdlib/result.mcrs +111 -0
  3746. package/src/stdlib/scheduler.mcrs +320 -0
  3747. package/src/stdlib/set_int.mcrs +240 -0
  3748. package/src/stdlib/sets.mcrs +49 -19
  3749. package/src/stdlib/signal.mcrs +151 -79
  3750. package/src/stdlib/sort.mcrs +111 -6
  3751. package/src/stdlib/spawn.mcrs +30 -7
  3752. package/src/stdlib/state.mcrs +100 -0
  3753. package/src/stdlib/strings.mcrs +131 -3
  3754. package/src/stdlib/tags.mcrs +2 -2
  3755. package/src/stdlib/teams.mcrs +22 -10
  3756. package/src/stdlib/timer.mcrs +36 -6
  3757. package/src/stdlib/vec.mcrs +44 -9
  3758. package/src/stdlib/world.mcrs +57 -25
  3759. package/src/structs/expand.ts +64 -0
  3760. package/src/testing/runner.ts +271 -0
  3761. package/src/typechecker/index.ts +287 -13
  3762. package/test_trig.ts +43 -0
@@ -18107,7 +18107,7 @@ var require_diagnostics = __commonJS({
18107
18107
  "../../dist/src/diagnostics/index.js"(exports2) {
18108
18108
  "use strict";
18109
18109
  Object.defineProperty(exports2, "__esModule", { value: true });
18110
- exports2.DiagnosticCollector = exports2.DiagnosticError = void 0;
18110
+ exports2.DiagnosticCollector = exports2.CheckFailedError = exports2.DiagnosticBundleError = exports2.DiagnosticError = void 0;
18111
18111
  exports2.parseErrorMessage = parseErrorMessage;
18112
18112
  exports2.formatError = formatError;
18113
18113
  function formatSourcePointer(sourceLines, line, col) {
@@ -18164,6 +18164,23 @@ var require_diagnostics = __commonJS({
18164
18164
  }
18165
18165
  };
18166
18166
  exports2.DiagnosticError = DiagnosticError;
18167
+ var DiagnosticBundleError = class extends Error {
18168
+ constructor(diagnostics) {
18169
+ super(diagnostics[0]?.message ?? "Multiple diagnostics");
18170
+ this.name = "DiagnosticBundleError";
18171
+ this.diagnostics = diagnostics;
18172
+ }
18173
+ };
18174
+ exports2.DiagnosticBundleError = DiagnosticBundleError;
18175
+ var CheckFailedError = class extends Error {
18176
+ constructor(diagnostics, warnings) {
18177
+ super(diagnostics[0]?.message ?? "Check failed");
18178
+ this.name = "CheckFailedError";
18179
+ this.diagnostics = diagnostics;
18180
+ this.warnings = warnings;
18181
+ }
18182
+ };
18183
+ exports2.CheckFailedError = CheckFailedError;
18167
18184
  var DiagnosticCollector = class {
18168
18185
  constructor(source, filePath) {
18169
18186
  this.diagnostics = [];
@@ -18241,6 +18258,8 @@ var require_lexer = __commonJS({
18241
18258
  while: "while",
18242
18259
  for: "for",
18243
18260
  foreach: "foreach",
18261
+ do: "do",
18262
+ repeat: "repeat",
18244
18263
  match: "match",
18245
18264
  return: "return",
18246
18265
  break: "break",
@@ -18260,6 +18279,8 @@ var require_lexer = __commonJS({
18260
18279
  unless: "unless",
18261
18280
  declare: "declare",
18262
18281
  export: "export",
18282
+ import: "import",
18283
+ interface: "interface",
18263
18284
  int: "int",
18264
18285
  bool: "bool",
18265
18286
  float: "float",
@@ -18410,6 +18431,9 @@ var require_lexer = __commonJS({
18410
18431
  if (char === "." && this.peek() === ".") {
18411
18432
  this.advance();
18412
18433
  let value = "..";
18434
+ if (this.peek() === "=") {
18435
+ value += this.advance();
18436
+ }
18413
18437
  while (/[0-9]/.test(this.peek())) {
18414
18438
  value += this.advance();
18415
18439
  }
@@ -18499,7 +18523,13 @@ var require_lexer = __commonJS({
18499
18523
  return;
18500
18524
  }
18501
18525
  if (char === '"') {
18502
- this.scanString(startLine, startCol);
18526
+ if (this.peek() === '"' && this.peek(1) === '"') {
18527
+ this.advance();
18528
+ this.advance();
18529
+ this.scanMultiLineString(startLine, startCol);
18530
+ } else {
18531
+ this.scanString(startLine, startCol);
18532
+ }
18503
18533
  return;
18504
18534
  }
18505
18535
  if (char === "#") {
@@ -18573,6 +18603,28 @@ var require_lexer = __commonJS({
18573
18603
  }
18574
18604
  return result;
18575
18605
  }
18606
+ scanMultiLineString(startLine, startCol) {
18607
+ let value = "";
18608
+ while (!this.isAtEnd()) {
18609
+ if (this.peek() === '"' && this.peek(1) === '"' && this.peek(2) === '"') {
18610
+ this.advance();
18611
+ this.advance();
18612
+ this.advance();
18613
+ break;
18614
+ }
18615
+ if (this.peek() === "\\" && this.peek(1) === '"') {
18616
+ this.advance();
18617
+ value += this.advance();
18618
+ continue;
18619
+ }
18620
+ value += this.advance();
18621
+ }
18622
+ if (value.startsWith("\n"))
18623
+ value = value.slice(1);
18624
+ if (value.endsWith("\n"))
18625
+ value = value.slice(0, -1);
18626
+ this.addToken("string_lit", value, startLine, startCol);
18627
+ }
18576
18628
  scanString(startLine, startCol) {
18577
18629
  let value = "";
18578
18630
  let interpolationDepth = 0;
@@ -18662,6 +18714,9 @@ var require_lexer = __commonJS({
18662
18714
  if (this.peek() === "." && this.peek(1) === ".") {
18663
18715
  value += this.advance();
18664
18716
  value += this.advance();
18717
+ if (this.peek() === "=") {
18718
+ value += this.advance();
18719
+ }
18665
18720
  while (/[0-9]/.test(this.peek())) {
18666
18721
  value += this.advance();
18667
18722
  }
@@ -18828,6 +18883,7 @@ var require_parser = __commonJS({
18828
18883
  this.pos = 0;
18829
18884
  this.inLibraryMode = false;
18830
18885
  this.warnings = [];
18886
+ this.parseErrors = [];
18831
18887
  this.tokens = tokens;
18832
18888
  this.sourceLines = source?.split("\n") ?? [];
18833
18889
  this.filePath = filePath;
@@ -18889,6 +18945,60 @@ var require_parser = __commonJS({
18889
18945
  return { kind: "eof", value: "", line: span.line, col: span.col };
18890
18946
  }
18891
18947
  // -------------------------------------------------------------------------
18948
+ // Error Recovery
18949
+ // -------------------------------------------------------------------------
18950
+ /**
18951
+ * Synchronize to the next top-level declaration boundary after a parse error.
18952
+ * Skips tokens until we find a keyword that starts a top-level declaration,
18953
+ * or a `}` (end of a block), or EOF.
18954
+ */
18955
+ syncToNextDecl() {
18956
+ const TOP_LEVEL_KEYWORDS = /* @__PURE__ */ new Set([
18957
+ "fn",
18958
+ "struct",
18959
+ "impl",
18960
+ "enum",
18961
+ "const",
18962
+ "let",
18963
+ "export",
18964
+ "declare",
18965
+ "import",
18966
+ "namespace",
18967
+ "module"
18968
+ ]);
18969
+ while (!this.check("eof")) {
18970
+ const kind = this.peek().kind;
18971
+ if (kind === "}") {
18972
+ this.advance();
18973
+ return;
18974
+ }
18975
+ if (TOP_LEVEL_KEYWORDS.has(kind)) {
18976
+ return;
18977
+ }
18978
+ if (kind === "ident" && this.peek().value === "import") {
18979
+ return;
18980
+ }
18981
+ this.advance();
18982
+ }
18983
+ }
18984
+ /**
18985
+ * Synchronize to the next statement boundary inside a block after a parse error.
18986
+ * Skips tokens until we reach `;`, `}`, or EOF.
18987
+ */
18988
+ syncToNextStmt() {
18989
+ while (!this.check("eof")) {
18990
+ const kind = this.peek().kind;
18991
+ if (kind === ";") {
18992
+ this.advance();
18993
+ return;
18994
+ }
18995
+ if (kind === "}") {
18996
+ return;
18997
+ }
18998
+ this.advance();
18999
+ }
19000
+ }
19001
+ // -------------------------------------------------------------------------
18892
19002
  // Program
18893
19003
  // -------------------------------------------------------------------------
18894
19004
  parse(defaultNamespace = "redscript") {
@@ -18900,6 +19010,7 @@ var require_parser = __commonJS({
18900
19010
  const enums = [];
18901
19011
  const consts = [];
18902
19012
  const imports = [];
19013
+ const interfaces = [];
18903
19014
  let isLibrary = false;
18904
19015
  let moduleName;
18905
19016
  if (this.check("namespace")) {
@@ -18920,40 +19031,74 @@ var require_parser = __commonJS({
18920
19031
  this.match(";");
18921
19032
  }
18922
19033
  while (!this.check("eof")) {
18923
- if (this.check("let")) {
18924
- globals.push(this.parseGlobalDecl(true));
18925
- } else if (this.check("struct")) {
18926
- structs.push(this.parseStructDecl());
18927
- } else if (this.check("impl")) {
18928
- implBlocks.push(this.parseImplBlock());
18929
- } else if (this.check("enum")) {
18930
- enums.push(this.parseEnumDecl());
18931
- } else if (this.check("const")) {
18932
- consts.push(this.parseConstDecl());
18933
- } else if (this.check("declare")) {
18934
- this.advance();
18935
- this.parseDeclareStub();
18936
- } else if (this.check("export")) {
18937
- declarations.push(this.parseExportedFnDecl());
18938
- } else if (this.check("ident") && this.peek().value === "import") {
18939
- this.advance();
18940
- const importToken = this.peek();
18941
- const modName = this.expect("ident").value;
18942
- this.expect("::");
18943
- let symbol;
18944
- if (this.check("*")) {
19034
+ try {
19035
+ if (this.check("decorator") && this.peek().value.startsWith("@config")) {
19036
+ const decorToken = this.advance();
19037
+ const decorator = this.parseDecoratorValue(decorToken.value);
19038
+ if (!this.check("let")) {
19039
+ this.error("@config decorator must be followed by a let declaration");
19040
+ }
19041
+ const g = this.parseGlobalDecl(true);
19042
+ g.configKey = decorator.args?.configKey;
19043
+ g.configDefault = decorator.args?.configDefault;
19044
+ globals.push(g);
19045
+ } else if (this.check("let")) {
19046
+ globals.push(this.parseGlobalDecl(true));
19047
+ } else if (this.check("decorator") && this.peek().value === "@singleton") {
19048
+ this.advance();
19049
+ if (!this.check("struct")) {
19050
+ this.error("@singleton decorator must be followed by a struct declaration");
19051
+ }
19052
+ const s = this.parseStructDecl();
19053
+ s.isSingleton = true;
19054
+ structs.push(s);
19055
+ } else if (this.check("struct")) {
19056
+ structs.push(this.parseStructDecl());
19057
+ } else if (this.check("impl")) {
19058
+ implBlocks.push(this.parseImplBlock());
19059
+ } else if (this.check("interface")) {
19060
+ interfaces.push(this.parseInterfaceDecl());
19061
+ } else if (this.check("enum")) {
19062
+ enums.push(this.parseEnumDecl());
19063
+ } else if (this.check("const")) {
19064
+ consts.push(this.parseConstDecl());
19065
+ } else if (this.check("declare")) {
19066
+ this.advance();
19067
+ this.parseDeclareStub();
19068
+ } else if (this.check("export")) {
19069
+ declarations.push(this.parseExportedFnDecl());
19070
+ } else if (this.check("import") || this.check("ident") && this.peek().value === "import") {
18945
19071
  this.advance();
18946
- symbol = "*";
19072
+ const importToken = this.peek();
19073
+ const modName = this.expect("ident").value;
19074
+ if (this.check("::")) {
19075
+ this.advance();
19076
+ let symbol;
19077
+ if (this.check("*")) {
19078
+ this.advance();
19079
+ symbol = "*";
19080
+ } else {
19081
+ symbol = this.expect("ident").value;
19082
+ }
19083
+ this.match(";");
19084
+ imports.push(this.withLoc({ moduleName: modName, symbol }, importToken));
19085
+ } else {
19086
+ this.match(";");
19087
+ imports.push(this.withLoc({ moduleName: modName, symbol: void 0 }, importToken));
19088
+ }
18947
19089
  } else {
18948
- symbol = this.expect("ident").value;
19090
+ declarations.push(this.parseFnDecl());
19091
+ }
19092
+ } catch (err) {
19093
+ if (err instanceof diagnostics_1.DiagnosticError) {
19094
+ this.parseErrors.push(err);
19095
+ this.syncToNextDecl();
19096
+ } else {
19097
+ throw err;
18949
19098
  }
18950
- this.match(";");
18951
- imports.push(this.withLoc({ moduleName: modName, symbol }, importToken));
18952
- } else {
18953
- declarations.push(this.parseFnDecl());
18954
19099
  }
18955
19100
  }
18956
- return { namespace, moduleName, globals, declarations, structs, implBlocks, enums, consts, imports, isLibrary };
19101
+ return { namespace, moduleName, globals, declarations, structs, implBlocks, enums, consts, imports, interfaces, isLibrary };
18957
19102
  }
18958
19103
  // -------------------------------------------------------------------------
18959
19104
  // Struct Declaration
@@ -18982,6 +19127,20 @@ var require_parser = __commonJS({
18982
19127
  while (!this.check("}") && !this.check("eof")) {
18983
19128
  const variantToken = this.expect("ident");
18984
19129
  const variant = { name: variantToken.value };
19130
+ if (this.check("(")) {
19131
+ this.advance();
19132
+ const fields = [];
19133
+ while (!this.check(")") && !this.check("eof")) {
19134
+ const fieldName = this.expect("ident").value;
19135
+ this.expect(":");
19136
+ const fieldType = this.parseType();
19137
+ fields.push({ name: fieldName, type: fieldType });
19138
+ if (!this.match(","))
19139
+ break;
19140
+ }
19141
+ this.expect(")");
19142
+ variant.fields = fields;
19143
+ }
18985
19144
  if (this.match("=")) {
18986
19145
  const valueToken = this.expect("int_lit");
18987
19146
  variant.value = parseInt(valueToken.value, 10);
@@ -18999,14 +19158,72 @@ var require_parser = __commonJS({
18999
19158
  }
19000
19159
  parseImplBlock() {
19001
19160
  const implToken = this.expect("impl");
19002
- const typeName = this.expect("ident").value;
19161
+ let traitName;
19162
+ let typeName;
19163
+ const firstName = this.expect("ident").value;
19164
+ if (this.match("for")) {
19165
+ traitName = firstName;
19166
+ typeName = this.expect("ident").value;
19167
+ } else {
19168
+ typeName = firstName;
19169
+ }
19003
19170
  this.expect("{");
19004
19171
  const methods = [];
19005
19172
  while (!this.check("}") && !this.check("eof")) {
19006
19173
  methods.push(this.parseFnDecl(typeName));
19007
19174
  }
19008
19175
  this.expect("}");
19009
- return this.withLoc({ kind: "impl_block", typeName, methods }, implToken);
19176
+ return this.withLoc({ kind: "impl_block", traitName, typeName, methods }, implToken);
19177
+ }
19178
+ /**
19179
+ * Parse an interface declaration:
19180
+ * interface <Name> {
19181
+ * fn <method>(<params>): <retType>
19182
+ * ...
19183
+ * }
19184
+ * Method signatures have no body — they are prototype-only.
19185
+ */
19186
+ parseInterfaceDecl() {
19187
+ const ifaceToken = this.expect("interface");
19188
+ const name = this.expect("ident").value;
19189
+ this.expect("{");
19190
+ const methods = [];
19191
+ while (!this.check("}") && !this.check("eof")) {
19192
+ const fnToken = this.expect("fn");
19193
+ const methodName = this.expect("ident").value;
19194
+ this.expect("(");
19195
+ const params = this.parseInterfaceParams();
19196
+ this.expect(")");
19197
+ let returnType;
19198
+ if (this.match(":")) {
19199
+ returnType = this.parseType();
19200
+ }
19201
+ methods.push(this.withLoc({ name: methodName, params, returnType }, fnToken));
19202
+ }
19203
+ this.expect("}");
19204
+ return this.withLoc({ name, methods }, ifaceToken);
19205
+ }
19206
+ /**
19207
+ * Parse interface method params — like parseParams but allows bare `self`
19208
+ * (no `:` required for the first param named 'self').
19209
+ */
19210
+ parseInterfaceParams() {
19211
+ const params = [];
19212
+ if (!this.check(")")) {
19213
+ do {
19214
+ const paramToken = this.expect("ident");
19215
+ const paramName = paramToken.value;
19216
+ let type;
19217
+ if (params.length === 0 && paramName === "self" && !this.check(":")) {
19218
+ type = { kind: "named", name: "void" };
19219
+ } else {
19220
+ this.expect(":");
19221
+ type = this.parseType();
19222
+ }
19223
+ params.push(this.withLoc({ name: paramName, type }, paramToken));
19224
+ } while (this.match(","));
19225
+ }
19226
+ return params;
19010
19227
  }
19011
19228
  parseConstDecl() {
19012
19229
  const constToken = this.expect("const");
@@ -19026,8 +19243,12 @@ var require_parser = __commonJS({
19026
19243
  const name = this.expect("ident").value;
19027
19244
  this.expect(":");
19028
19245
  const type = this.parseType();
19029
- this.expect("=");
19030
- const init = this.parseExpr();
19246
+ let init;
19247
+ if (this.match("=")) {
19248
+ init = this.parseExpr();
19249
+ } else {
19250
+ init = { kind: "int_lit", value: 0 };
19251
+ }
19031
19252
  this.match(";");
19032
19253
  return this.withLoc({ kind: "global", name, type, init, mutable }, token);
19033
19254
  }
@@ -19043,6 +19264,7 @@ var require_parser = __commonJS({
19043
19264
  }
19044
19265
  parseFnDecl(implTypeName) {
19045
19266
  const decorators = this.parseDecorators();
19267
+ const watchObjective = decorators.find((decorator) => decorator.name === "watch")?.args?.objective;
19046
19268
  let isExported;
19047
19269
  const filteredDecorators = decorators.filter((d) => {
19048
19270
  if (d.name === "keep") {
@@ -19070,6 +19292,7 @@ var require_parser = __commonJS({
19070
19292
  returnType = this.parseType();
19071
19293
  }
19072
19294
  const body = this.parseBlock();
19295
+ const closingBraceLine = this.tokens[this.pos - 1]?.line;
19073
19296
  const fn = this.withLoc({
19074
19297
  name,
19075
19298
  typeParams,
@@ -19078,8 +19301,11 @@ var require_parser = __commonJS({
19078
19301
  decorators: filteredDecorators,
19079
19302
  body,
19080
19303
  isLibraryFn: this.inLibraryMode || void 0,
19081
- isExported
19304
+ isExported,
19305
+ watchObjective
19082
19306
  }, fnToken);
19307
+ if (fn.span && closingBraceLine)
19308
+ fn.span.endLine = closingBraceLine;
19083
19309
  return fn;
19084
19310
  }
19085
19311
  /** Parse a `declare fn name(params): returnType;` stub — no body, just discard. */
@@ -19110,7 +19336,7 @@ var require_parser = __commonJS({
19110
19336
  return decorators;
19111
19337
  }
19112
19338
  parseDecoratorValue(value) {
19113
- const match = value.match(/^@(\w+)(?:\(([^)]*)\))?$/);
19339
+ const match = value.match(/^@(\w+)(?:\((.*)\))?$/s);
19114
19340
  if (!match) {
19115
19341
  this.error(`Invalid decorator: ${value}`);
19116
19342
  }
@@ -19119,6 +19345,9 @@ var require_parser = __commonJS({
19119
19345
  if (!argsStr) {
19120
19346
  return { name };
19121
19347
  }
19348
+ if (name === "profile") {
19349
+ this.error("@profile decorator does not accept arguments");
19350
+ }
19122
19351
  const args = {};
19123
19352
  if (name === "on") {
19124
19353
  const eventTypeMatch = argsStr.match(/^([A-Za-z_][A-Za-z0-9_]*)$/);
@@ -19127,10 +19356,12 @@ var require_parser = __commonJS({
19127
19356
  return { name, args };
19128
19357
  }
19129
19358
  }
19130
- if (name === "on_trigger" || name === "on_advancement" || name === "on_craft" || name === "on_join_team") {
19359
+ if (name === "watch" || name === "on_trigger" || name === "on_advancement" || name === "on_craft" || name === "on_join_team") {
19131
19360
  const strMatch = argsStr.match(/^"([^"]*)"$/);
19132
19361
  if (strMatch) {
19133
- if (name === "on_trigger") {
19362
+ if (name === "watch") {
19363
+ args.objective = strMatch[1];
19364
+ } else if (name === "on_trigger") {
19134
19365
  args.trigger = strMatch[1];
19135
19366
  } else if (name === "on_advancement") {
19136
19367
  args.advancement = strMatch[1];
@@ -19142,6 +19373,24 @@ var require_parser = __commonJS({
19142
19373
  return { name, args };
19143
19374
  }
19144
19375
  }
19376
+ if (name === "config") {
19377
+ const configMatch = argsStr.match(/^"([^"]+)"\s*,\s*default\s*:\s*(-?\d+(?:\.\d+)?)$/);
19378
+ if (configMatch) {
19379
+ return { name, args: { configKey: configMatch[1], configDefault: parseFloat(configMatch[2]) } };
19380
+ }
19381
+ const keyOnlyMatch = argsStr.match(/^"([^"]+)"$/);
19382
+ if (keyOnlyMatch) {
19383
+ return { name, args: { configKey: keyOnlyMatch[1] } };
19384
+ }
19385
+ this.error(`Invalid @config syntax. Expected: @config("key", default: value) or @config("key")`);
19386
+ }
19387
+ if (name === "deprecated") {
19388
+ const strMatch = argsStr.match(/^"([^"]*)"$/);
19389
+ if (strMatch) {
19390
+ return { name, args: { message: strMatch[1] } };
19391
+ }
19392
+ return { name, args: {} };
19393
+ }
19145
19394
  if (name === "require_on_load") {
19146
19395
  const rawArgs = [];
19147
19396
  for (const part of argsStr.split(",")) {
@@ -19167,7 +19416,7 @@ var require_parser = __commonJS({
19167
19416
  } else if (key === "batch") {
19168
19417
  args.batch = parseInt(val, 10);
19169
19418
  } else if (key === "onDone") {
19170
- args.onDone = val;
19419
+ args.onDone = val.replace(/^["']|["']$/g, "");
19171
19420
  } else if (key === "trigger") {
19172
19421
  args.trigger = val;
19173
19422
  } else if (key === "advancement") {
@@ -19277,7 +19526,16 @@ var require_parser = __commonJS({
19277
19526
  this.expect("{");
19278
19527
  const stmts = [];
19279
19528
  while (!this.check("}") && !this.check("eof")) {
19280
- stmts.push(this.parseStmt());
19529
+ try {
19530
+ stmts.push(this.parseStmt());
19531
+ } catch (err) {
19532
+ if (err instanceof diagnostics_1.DiagnosticError) {
19533
+ this.parseErrors.push(err);
19534
+ this.syncToNextStmt();
19535
+ } else {
19536
+ throw err;
19537
+ }
19538
+ }
19281
19539
  }
19282
19540
  this.expect("}");
19283
19541
  return stmts;
@@ -19286,6 +19544,9 @@ var require_parser = __commonJS({
19286
19544
  if (this.check("let")) {
19287
19545
  return this.parseLetStmt();
19288
19546
  }
19547
+ if (this.check("const")) {
19548
+ return this.parseLocalConstDecl();
19549
+ }
19289
19550
  if (this.check("return")) {
19290
19551
  return this.parseReturnStmt();
19291
19552
  }
@@ -19305,6 +19566,12 @@ var require_parser = __commonJS({
19305
19566
  if (this.check("while")) {
19306
19567
  return this.parseWhileStmt();
19307
19568
  }
19569
+ if (this.check("do")) {
19570
+ return this.parseDoWhileStmt();
19571
+ }
19572
+ if (this.check("repeat")) {
19573
+ return this.parseRepeatStmt();
19574
+ }
19308
19575
  if (this.check("for")) {
19309
19576
  return this.parseForStmt();
19310
19577
  }
@@ -19359,6 +19626,16 @@ var require_parser = __commonJS({
19359
19626
  this.match(";");
19360
19627
  return this.withLoc({ kind: "let", name, type, init }, letToken);
19361
19628
  }
19629
+ parseLocalConstDecl() {
19630
+ const constToken = this.expect("const");
19631
+ const name = this.expect("ident").value;
19632
+ this.expect(":");
19633
+ const type = this.parseType();
19634
+ this.expect("=");
19635
+ const value = this.parseExpr();
19636
+ this.match(";");
19637
+ return this.withLoc({ kind: "const_decl", name, type, value }, constToken);
19638
+ }
19362
19639
  parseReturnStmt() {
19363
19640
  const returnToken = this.expect("return");
19364
19641
  let value;
@@ -19389,9 +19666,7 @@ var require_parser = __commonJS({
19389
19666
  }
19390
19667
  return this.withLoc({ kind: "if_let_some", binding, init, then: then2, else_: else_2 }, ifToken);
19391
19668
  }
19392
- this.expect("(");
19393
- const cond = this.parseExpr();
19394
- this.expect(")");
19669
+ const cond = this.parseParenOptionalCond();
19395
19670
  const then = this.parseBlock();
19396
19671
  let else_;
19397
19672
  if (this.match("else")) {
@@ -19405,12 +19680,44 @@ var require_parser = __commonJS({
19405
19680
  }
19406
19681
  parseWhileStmt() {
19407
19682
  const whileToken = this.expect("while");
19408
- this.expect("(");
19409
- const cond = this.parseExpr();
19410
- this.expect(")");
19683
+ if (this.check("let") && this.peek(1).kind === "ident" && this.peek(1).value === "Some") {
19684
+ this.advance();
19685
+ this.advance();
19686
+ this.expect("(");
19687
+ const binding = this.expect("ident").value;
19688
+ this.expect(")");
19689
+ this.expect("=");
19690
+ const init = this.parseExpr();
19691
+ const body2 = this.parseBlock();
19692
+ return this.withLoc({ kind: "while_let_some", binding, init, body: body2 }, whileToken);
19693
+ }
19694
+ const cond = this.parseParenOptionalCond();
19411
19695
  const body = this.parseBlock();
19412
19696
  return this.withLoc({ kind: "while", cond, body }, whileToken);
19413
19697
  }
19698
+ parseDoWhileStmt() {
19699
+ const doToken = this.expect("do");
19700
+ const body = this.parseBlock();
19701
+ this.expect("while");
19702
+ const cond = this.parseParenOptionalCond();
19703
+ this.match(";");
19704
+ return this.withLoc({ kind: "do_while", cond, body }, doToken);
19705
+ }
19706
+ parseRepeatStmt() {
19707
+ const repeatToken = this.expect("repeat");
19708
+ const countToken = this.expect("int_lit");
19709
+ const count = parseInt(countToken.value, 10);
19710
+ const body = this.parseBlock();
19711
+ return this.withLoc({ kind: "repeat", count, body }, repeatToken);
19712
+ }
19713
+ parseParenOptionalCond() {
19714
+ if (this.match("(")) {
19715
+ const cond = this.parseExpr();
19716
+ this.expect(")");
19717
+ return cond;
19718
+ }
19719
+ return this.parseExpr();
19720
+ }
19414
19721
  parseForStmt() {
19415
19722
  const forToken = this.expect("for");
19416
19723
  if (this.check("ident") && this.peek(1).kind === "in") {
@@ -19454,9 +19761,13 @@ var require_parser = __commonJS({
19454
19761
  this.expect("in");
19455
19762
  let start;
19456
19763
  let end;
19764
+ let inclusive = false;
19457
19765
  if (this.check("range_lit")) {
19458
19766
  const rangeToken = this.advance();
19459
- const range = this.parseRangeValue(rangeToken.value);
19767
+ const raw = rangeToken.value;
19768
+ const incl = raw.includes("..=");
19769
+ inclusive = incl;
19770
+ const range = this.parseRangeValue(raw);
19460
19771
  start = this.withLoc({ kind: "int_lit", value: range.min ?? 0 }, rangeToken);
19461
19772
  if (range.max !== null && range.max !== void 0) {
19462
19773
  end = this.withLoc({ kind: "int_lit", value: range.max }, rangeToken);
@@ -19464,12 +19775,29 @@ var require_parser = __commonJS({
19464
19775
  end = this.parseUnaryExpr();
19465
19776
  }
19466
19777
  } else {
19467
- start = this.withLoc({ kind: "int_lit", value: 0 }, this.peek());
19468
- end = this.withLoc({ kind: "int_lit", value: 0 }, this.peek());
19469
- this.error("Dynamic range start requires a literal integer (e.g. 0..count)");
19778
+ const arrayOrStart = this.parseExpr();
19779
+ if (!this.check("range_lit")) {
19780
+ const body2 = this.parseBlock();
19781
+ return this.withLoc({ kind: "for_each", binding: varName, array: arrayOrStart, body: body2 }, forToken);
19782
+ }
19783
+ start = arrayOrStart;
19784
+ if (this.check("range_lit")) {
19785
+ const rangeOp = this.advance();
19786
+ inclusive = rangeOp.value.includes("=");
19787
+ const afterOp = rangeOp.value.replace(/^\.\.=?/, "");
19788
+ if (afterOp.length > 0) {
19789
+ end = this.withLoc({ kind: "int_lit", value: parseInt(afterOp, 10) }, rangeOp);
19790
+ } else {
19791
+ end = this.parseExpr();
19792
+ }
19793
+ } else {
19794
+ this.error("Expected .. or ..= in for-range expression");
19795
+ start = this.withLoc({ kind: "int_lit", value: 0 }, this.peek());
19796
+ end = this.withLoc({ kind: "int_lit", value: 0 }, this.peek());
19797
+ }
19470
19798
  }
19471
19799
  const body = this.parseBlock();
19472
- return this.withLoc({ kind: "for_range", varName, start, end, body }, forToken);
19800
+ return this.withLoc({ kind: "for_range", varName, start, end, inclusive, body }, forToken);
19473
19801
  }
19474
19802
  parseForeachStmt() {
19475
19803
  const foreachToken = this.expect("foreach");
@@ -19490,23 +19818,67 @@ var require_parser = __commonJS({
19490
19818
  const body = this.parseBlock();
19491
19819
  return this.withLoc({ kind: "foreach", binding, iterable, body, executeContext }, foreachToken);
19492
19820
  }
19821
+ parseMatchPattern() {
19822
+ if (this.check("ident") && this.peek().value === "_") {
19823
+ this.advance();
19824
+ return { kind: "PatWild" };
19825
+ }
19826
+ if (this.check("ident") && this.peek().value === "None") {
19827
+ this.advance();
19828
+ return { kind: "PatNone" };
19829
+ }
19830
+ if (this.check("ident") && this.peek().value === "Some") {
19831
+ this.advance();
19832
+ this.expect("(");
19833
+ const binding = this.expect("ident").value;
19834
+ this.expect(")");
19835
+ return { kind: "PatSome", binding };
19836
+ }
19837
+ if (this.check("ident") && this.peek(1).kind === "::") {
19838
+ const enumName = this.advance().value;
19839
+ this.expect("::");
19840
+ const variant = this.expect("ident").value;
19841
+ const bindings = [];
19842
+ if (this.check("(")) {
19843
+ this.advance();
19844
+ while (!this.check(")") && !this.check("eof")) {
19845
+ bindings.push(this.expect("ident").value);
19846
+ if (!this.match(","))
19847
+ break;
19848
+ }
19849
+ this.expect(")");
19850
+ }
19851
+ return { kind: "PatEnum", enumName, variant, bindings };
19852
+ }
19853
+ if (this.check("int_lit")) {
19854
+ const tok = this.advance();
19855
+ return { kind: "PatInt", value: parseInt(tok.value, 10) };
19856
+ }
19857
+ if (this.check("-") && this.peek(1).kind === "int_lit") {
19858
+ this.advance();
19859
+ const tok = this.advance();
19860
+ return { kind: "PatInt", value: -parseInt(tok.value, 10) };
19861
+ }
19862
+ const e = this.parseExpr();
19863
+ return { kind: "PatExpr", expr: e };
19864
+ }
19493
19865
  parseMatchStmt() {
19494
19866
  const matchToken = this.expect("match");
19495
- this.expect("(");
19496
- const expr = this.parseExpr();
19497
- this.expect(")");
19867
+ let expr;
19868
+ if (this.check("(")) {
19869
+ this.advance();
19870
+ expr = this.parseExpr();
19871
+ this.expect(")");
19872
+ } else {
19873
+ expr = this.parseExpr();
19874
+ }
19498
19875
  this.expect("{");
19499
19876
  const arms = [];
19500
19877
  while (!this.check("}") && !this.check("eof")) {
19501
- let pattern;
19502
- if (this.check("ident") && this.peek().value === "_") {
19503
- this.advance();
19504
- pattern = null;
19505
- } else {
19506
- pattern = this.parseExpr();
19507
- }
19878
+ const pattern = this.parseMatchPattern();
19508
19879
  this.expect("=>");
19509
19880
  const body = this.parseBlock();
19881
+ this.match(",");
19510
19882
  arms.push({ pattern, body });
19511
19883
  }
19512
19884
  this.expect("}");
@@ -19810,6 +20182,12 @@ var require_parser = __commonJS({
19810
20182
  continue;
19811
20183
  }
19812
20184
  if (expr.kind === "member") {
20185
+ if (expr.field === "unwrap_or") {
20186
+ const defaultExpr = this.parseExpr();
20187
+ this.expect(")");
20188
+ expr = this.withLoc({ kind: "unwrap_or", opt: expr.obj, default_: defaultExpr }, this.getLocToken(expr) ?? openParenToken);
20189
+ continue;
20190
+ }
19813
20191
  const methodMap = {
19814
20192
  "tag": "__entity_tag",
19815
20193
  "untag": "__entity_untag",
@@ -19887,6 +20265,21 @@ var require_parser = __commonJS({
19887
20265
  this.expect("::");
19888
20266
  const memberToken = this.expect("ident");
19889
20267
  if (this.check("(")) {
20268
+ const isNamedArgs = this.peek(1).kind === "ident" && this.peek(2).kind === ":";
20269
+ if (isNamedArgs) {
20270
+ this.advance();
20271
+ const args2 = [];
20272
+ while (!this.check(")") && !this.check("eof")) {
20273
+ const fieldName = this.expect("ident").value;
20274
+ this.expect(":");
20275
+ const value = this.parseExpr();
20276
+ args2.push({ name: fieldName, value });
20277
+ if (!this.match(","))
20278
+ break;
20279
+ }
20280
+ this.expect(")");
20281
+ return this.withLoc({ kind: "enum_construct", enumName: typeToken.value, variant: memberToken.value, args: args2 }, typeToken);
20282
+ }
19890
20283
  this.advance();
19891
20284
  const args = this.parseArgs();
19892
20285
  this.expect(")");
@@ -19962,6 +20355,10 @@ var require_parser = __commonJS({
19962
20355
  sel: this.parseSelectorValue(token.value)
19963
20356
  }, token);
19964
20357
  }
20358
+ if (token.kind === "ident" && this.peek(1).kind === "{" && this.peek(2).kind === "ident" && this.peek(3).kind === ":") {
20359
+ this.advance();
20360
+ return this.parseStructLit();
20361
+ }
19965
20362
  if (token.kind === "ident" && token.value === "Some" && this.peek(1).kind === "(") {
19966
20363
  this.advance();
19967
20364
  this.advance();
@@ -20483,18 +20880,36 @@ var require_parser = __commonJS({
20483
20880
  return scores;
20484
20881
  }
20485
20882
  parseRangeValue(value) {
20883
+ if (value.startsWith("..=")) {
20884
+ const rest = value.slice(3);
20885
+ if (!rest)
20886
+ return {};
20887
+ const max = parseInt(rest, 10);
20888
+ return { max };
20889
+ }
20486
20890
  if (value.startsWith("..")) {
20487
- const max = parseInt(value.slice(2), 10);
20891
+ const rest = value.slice(2);
20892
+ if (!rest)
20893
+ return {};
20894
+ const max = parseInt(rest, 10);
20488
20895
  return { max };
20489
20896
  }
20490
- if (value.endsWith("..")) {
20491
- const min = parseInt(value.slice(0, -2), 10);
20492
- return { min };
20897
+ const inclIdx = value.indexOf("..=");
20898
+ if (inclIdx !== -1) {
20899
+ const min = parseInt(value.slice(0, inclIdx), 10);
20900
+ const rest = value.slice(inclIdx + 3);
20901
+ if (!rest)
20902
+ return { min };
20903
+ const max = parseInt(rest, 10);
20904
+ return { min, max };
20493
20905
  }
20494
20906
  const dotIndex = value.indexOf("..");
20495
20907
  if (dotIndex !== -1) {
20496
20908
  const min = parseInt(value.slice(0, dotIndex), 10);
20497
- const max = parseInt(value.slice(dotIndex + 2), 10);
20909
+ const rest = value.slice(dotIndex + 2);
20910
+ if (!rest)
20911
+ return { min };
20912
+ const max = parseInt(rest, 10);
20498
20913
  return { min, max };
20499
20914
  }
20500
20915
  const val = parseInt(value, 10);
@@ -20693,16 +21108,18 @@ var require_lower = __commonJS({
20693
21108
  structs: program.structs.map((s) => ({
20694
21109
  name: s.name,
20695
21110
  fields: s.fields.map((f) => ({ name: f.name, type: f.type })),
21111
+ isSingleton: s.isSingleton,
20696
21112
  span: s.span
20697
21113
  })),
20698
21114
  implBlocks: program.implBlocks.map((ib) => ({
20699
21115
  typeName: ib.typeName,
21116
+ traitName: ib.traitName,
20700
21117
  methods: ib.methods.map(lowerFunction),
20701
21118
  span: ib.span
20702
21119
  })),
20703
21120
  enums: program.enums.map((e) => ({
20704
21121
  name: e.name,
20705
- variants: e.variants.map((v) => ({ name: v.name, value: v.value })),
21122
+ variants: e.variants.map((v) => ({ name: v.name, value: v.value, fields: v.fields })),
20706
21123
  span: e.span
20707
21124
  })),
20708
21125
  consts: program.consts.map((c) => ({
@@ -20714,6 +21131,22 @@ var require_lower = __commonJS({
20714
21131
  isLibrary: program.isLibrary
20715
21132
  };
20716
21133
  }
21134
+ function lowerMatchPattern(pat) {
21135
+ switch (pat.kind) {
21136
+ case "PatSome":
21137
+ return pat;
21138
+ case "PatNone":
21139
+ return pat;
21140
+ case "PatInt":
21141
+ return pat;
21142
+ case "PatWild":
21143
+ return pat;
21144
+ case "PatExpr":
21145
+ return { kind: "PatExpr", expr: lowerExpr(pat.expr) };
21146
+ case "PatEnum":
21147
+ return { kind: "PatEnum", enumName: pat.enumName, variant: pat.variant, bindings: pat.bindings };
21148
+ }
21149
+ }
20717
21150
  function lowerGlobal(g) {
20718
21151
  return {
20719
21152
  name: g.name,
@@ -20733,7 +21166,8 @@ var require_lower = __commonJS({
20733
21166
  body: lowerBlock(fn.body),
20734
21167
  isLibraryFn: fn.isLibraryFn,
20735
21168
  isExported: fn.isExported,
20736
- span: fn.span
21169
+ span: fn.span,
21170
+ watchObjective: fn.watchObjective
20737
21171
  };
20738
21172
  }
20739
21173
  function lowerParam(p) {
@@ -20761,6 +21195,8 @@ var require_lower = __commonJS({
20761
21195
  return { kind: "let", name: stmt.name, type: stmt.type, init: lowerExpr(stmt.init), span: stmt.span };
20762
21196
  case "let_destruct":
20763
21197
  return { kind: "let_destruct", names: stmt.names, type: stmt.type, init: lowerExpr(stmt.init), span: stmt.span };
21198
+ case "const_decl":
21199
+ return { kind: "const_decl", name: stmt.name, type: stmt.type, value: lowerExpr(stmt.value), span: stmt.span };
20764
21200
  case "expr":
20765
21201
  return { kind: "expr", expr: lowerExpr(stmt.expr), span: stmt.span };
20766
21202
  case "return":
@@ -20822,7 +21258,7 @@ var require_lower = __commonJS({
20822
21258
  kind: "while",
20823
21259
  cond: {
20824
21260
  kind: "binary",
20825
- op: "<",
21261
+ op: stmt.inclusive ? "<=" : "<",
20826
21262
  left: { kind: "ident", name: varName },
20827
21263
  right: lowerExpr(stmt.end)
20828
21264
  },
@@ -20883,39 +21319,104 @@ var require_lower = __commonJS({
20883
21319
  };
20884
21320
  return [initStmt, whileStmt];
20885
21321
  }
20886
- case "foreach":
20887
- return {
20888
- kind: "foreach",
20889
- binding: stmt.binding,
20890
- iterable: lowerExpr(stmt.iterable),
20891
- body: lowerBlock(stmt.body),
20892
- executeContext: stmt.executeContext,
21322
+ // --- Desugaring: for_each → let __for_len = arr.len(); let __for_i = 0; while(__for_i < __for_len) { let item = arr[__for_i]; body; __for_i = __for_i + 1 } ---
21323
+ case "for_each": {
21324
+ const id = forEachCounter++;
21325
+ const idxName = `__foreach_i_${id}`;
21326
+ const lenName = `__foreach_len_${id}`;
21327
+ const arrExpr = lowerExpr(stmt.array);
21328
+ const lenInitStmt = {
21329
+ kind: "let",
21330
+ name: lenName,
21331
+ type: { kind: "named", name: "int" },
21332
+ init: {
21333
+ kind: "invoke",
21334
+ callee: { kind: "member", obj: arrExpr, field: "len" },
21335
+ args: []
21336
+ },
20893
21337
  span: stmt.span
20894
21338
  };
20895
- case "match":
20896
- return {
20897
- kind: "match",
20898
- expr: lowerExpr(stmt.expr),
20899
- arms: stmt.arms.map((arm) => ({
20900
- pattern: arm.pattern ? lowerExpr(arm.pattern) : null,
20901
- body: lowerBlock(arm.body)
20902
- })),
21339
+ const idxInitStmt = {
21340
+ kind: "let",
21341
+ name: idxName,
21342
+ type: { kind: "named", name: "int" },
21343
+ init: { kind: "int_lit", value: 0 },
20903
21344
  span: stmt.span
20904
21345
  };
20905
- // --- Desugaring: as_block → execute [as] ---
20906
- case "as_block":
20907
- return {
20908
- kind: "execute",
20909
- subcommands: [{ kind: "as", selector: stmt.selector }],
20910
- body: lowerBlock(stmt.body),
21346
+ const bindingInit = {
21347
+ kind: "let",
21348
+ name: stmt.binding,
21349
+ type: void 0,
21350
+ init: {
21351
+ kind: "index",
21352
+ obj: arrExpr,
21353
+ index: { kind: "ident", name: idxName }
21354
+ },
20911
21355
  span: stmt.span
20912
21356
  };
20913
- // --- Desugaring: at_block → execute [at] ---
20914
- case "at_block":
20915
- return {
20916
- kind: "execute",
20917
- subcommands: [{ kind: "at", selector: stmt.selector }],
20918
- body: lowerBlock(stmt.body),
21357
+ const stepStmt = {
21358
+ kind: "expr",
21359
+ expr: {
21360
+ kind: "assign",
21361
+ target: idxName,
21362
+ value: {
21363
+ kind: "binary",
21364
+ op: "+",
21365
+ left: { kind: "ident", name: idxName },
21366
+ right: { kind: "int_lit", value: 1 }
21367
+ }
21368
+ },
21369
+ span: stmt.span
21370
+ };
21371
+ const body = [bindingInit, ...lowerBlock(stmt.body)];
21372
+ const step = [stepStmt];
21373
+ const whileStmt = {
21374
+ kind: "while",
21375
+ cond: {
21376
+ kind: "binary",
21377
+ op: "<",
21378
+ left: { kind: "ident", name: idxName },
21379
+ right: { kind: "ident", name: lenName }
21380
+ },
21381
+ body,
21382
+ step,
21383
+ span: stmt.span
21384
+ };
21385
+ return [lenInitStmt, idxInitStmt, whileStmt];
21386
+ }
21387
+ case "foreach":
21388
+ return {
21389
+ kind: "foreach",
21390
+ binding: stmt.binding,
21391
+ iterable: lowerExpr(stmt.iterable),
21392
+ body: lowerBlock(stmt.body),
21393
+ executeContext: stmt.executeContext,
21394
+ span: stmt.span
21395
+ };
21396
+ case "match":
21397
+ return {
21398
+ kind: "match",
21399
+ expr: lowerExpr(stmt.expr),
21400
+ arms: stmt.arms.map((arm) => ({
21401
+ pattern: lowerMatchPattern(arm.pattern),
21402
+ body: lowerBlock(arm.body)
21403
+ })),
21404
+ span: stmt.span
21405
+ };
21406
+ // --- Desugaring: as_block → execute [as] ---
21407
+ case "as_block":
21408
+ return {
21409
+ kind: "execute",
21410
+ subcommands: [{ kind: "as", selector: stmt.selector }],
21411
+ body: lowerBlock(stmt.body),
21412
+ span: stmt.span
21413
+ };
21414
+ // --- Desugaring: at_block → execute [at] ---
21415
+ case "at_block":
21416
+ return {
21417
+ kind: "execute",
21418
+ subcommands: [{ kind: "at", selector: stmt.selector }],
21419
+ body: lowerBlock(stmt.body),
20919
21420
  span: stmt.span
20920
21421
  };
20921
21422
  // --- Desugaring: as_at → execute [as, at] ---
@@ -20947,6 +21448,68 @@ var require_lower = __commonJS({
20947
21448
  else_: stmt.else_ ? lowerBlock(stmt.else_) : void 0,
20948
21449
  span: stmt.span
20949
21450
  };
21451
+ // --- Desugaring: do_while → body + while(cond) { body } ---
21452
+ // Emits the body once unconditionally, then a while loop:
21453
+ // <body>
21454
+ // while (cond) { <body> }
21455
+ case "do_while": {
21456
+ const firstBody = lowerBlock(stmt.body);
21457
+ const loopBody = lowerBlock(stmt.body);
21458
+ const whileStmt = {
21459
+ kind: "while",
21460
+ cond: lowerExpr(stmt.cond),
21461
+ body: loopBody,
21462
+ span: stmt.span
21463
+ };
21464
+ return [...firstBody, whileStmt];
21465
+ }
21466
+ // --- Desugaring: repeat N → let __repeat_i = 0; while(__repeat_i < N) { body; __repeat_i = __repeat_i + 1 } ---
21467
+ case "repeat": {
21468
+ const id = repeatCounter++;
21469
+ const idxName = `__repeat_i_${id}`;
21470
+ const initStmt = {
21471
+ kind: "let",
21472
+ name: idxName,
21473
+ type: { kind: "named", name: "int" },
21474
+ init: { kind: "int_lit", value: 0 },
21475
+ span: stmt.span
21476
+ };
21477
+ const body = lowerBlock(stmt.body);
21478
+ const step = [{
21479
+ kind: "expr",
21480
+ expr: {
21481
+ kind: "assign",
21482
+ target: idxName,
21483
+ value: {
21484
+ kind: "binary",
21485
+ op: "+",
21486
+ left: { kind: "ident", name: idxName },
21487
+ right: { kind: "int_lit", value: 1 }
21488
+ }
21489
+ }
21490
+ }];
21491
+ const whileStmt = {
21492
+ kind: "while",
21493
+ cond: {
21494
+ kind: "binary",
21495
+ op: "<",
21496
+ left: { kind: "ident", name: idxName },
21497
+ right: { kind: "int_lit", value: stmt.count }
21498
+ },
21499
+ body,
21500
+ step,
21501
+ span: stmt.span
21502
+ };
21503
+ return [initStmt, whileStmt];
21504
+ }
21505
+ case "while_let_some":
21506
+ return {
21507
+ kind: "while_let_some",
21508
+ binding: stmt.binding,
21509
+ init: lowerExpr(stmt.init),
21510
+ body: lowerBlock(stmt.body),
21511
+ span: stmt.span
21512
+ };
20950
21513
  default: {
20951
21514
  const _exhaustive = stmt;
20952
21515
  throw new Error(`Unknown statement kind: ${_exhaustive.kind}`);
@@ -20956,6 +21519,8 @@ var require_lower = __commonJS({
20956
21519
  function lowerExecuteSubcommand(sub) {
20957
21520
  return sub;
20958
21521
  }
21522
+ var forEachCounter = 0;
21523
+ var repeatCounter = 0;
20959
21524
  var COMPOUND_TO_BINOP = {
20960
21525
  "+=": "+",
20961
21526
  "-=": "-",
@@ -20998,8 +21563,10 @@ var require_lower = __commonJS({
20998
21563
  parts: expr.parts.map((p) => typeof p === "string" ? p : lowerExpr(p)),
20999
21564
  span: expr.span
21000
21565
  };
21001
- case "f_string":
21002
- return { kind: "f_string", parts: expr.parts, span: expr.span };
21566
+ case "f_string": {
21567
+ const hirParts = expr.parts.map((part) => part.kind === "text" ? { kind: "text", value: part.value } : { kind: "expr", expr: lowerExpr(part.expr) });
21568
+ return { kind: "f_string", parts: hirParts, span: expr.span };
21569
+ }
21003
21570
  // Binary ops — && and || preserved as-is (short-circuit → control flow in MIR)
21004
21571
  case "binary":
21005
21572
  return {
@@ -21104,12 +21671,22 @@ var require_lower = __commonJS({
21104
21671
  };
21105
21672
  case "path_expr":
21106
21673
  return { kind: "path_expr", enumName: expr.enumName, variant: expr.variant, span: expr.span };
21674
+ case "enum_construct":
21675
+ return {
21676
+ kind: "enum_construct",
21677
+ enumName: expr.enumName,
21678
+ variant: expr.variant,
21679
+ args: expr.args.map((a) => ({ name: a.name, value: lowerExpr(a.value) })),
21680
+ span: expr.span
21681
+ };
21107
21682
  case "tuple_lit":
21108
21683
  return { kind: "tuple_lit", elements: expr.elements.map(lowerExpr), span: expr.span };
21109
21684
  case "some_lit":
21110
21685
  return { kind: "some_lit", value: lowerExpr(expr.value), span: expr.span };
21111
21686
  case "none_lit":
21112
21687
  return { kind: "none_lit", span: expr.span };
21688
+ case "unwrap_or":
21689
+ return { kind: "unwrap_or", opt: lowerExpr(expr.opt), default_: lowerExpr(expr.default_), span: expr.span };
21113
21690
  case "type_cast":
21114
21691
  return { kind: "type_cast", expr: lowerExpr(expr.expr), targetType: expr.targetType, span: expr.span };
21115
21692
  case "lambda": {
@@ -21323,10 +21900,15 @@ var require_monomorphize = __commonJS({
21323
21900
  return {
21324
21901
  ...stmt,
21325
21902
  expr: this.rewriteExpr(stmt.expr, ctx),
21326
- arms: stmt.arms.map((arm) => ({
21327
- pattern: arm.pattern ? this.rewriteExpr(arm.pattern, ctx) : null,
21328
- body: this.rewriteBlock(arm.body, ctx)
21329
- }))
21903
+ arms: stmt.arms.map((arm) => {
21904
+ let pattern;
21905
+ if (arm.pattern.kind === "PatExpr") {
21906
+ pattern = { kind: "PatExpr", expr: this.rewriteExpr(arm.pattern.expr, ctx) };
21907
+ } else {
21908
+ pattern = arm.pattern;
21909
+ }
21910
+ return { pattern, body: this.rewriteBlock(arm.body, ctx) };
21911
+ })
21330
21912
  };
21331
21913
  case "execute":
21332
21914
  return { ...stmt, body: this.rewriteBlock(stmt.body, ctx) };
@@ -21337,6 +21919,14 @@ var require_monomorphize = __commonJS({
21337
21919
  then: this.rewriteBlock(stmt.then, ctx),
21338
21920
  else_: stmt.else_ ? this.rewriteBlock(stmt.else_, ctx) : void 0
21339
21921
  };
21922
+ case "while_let_some":
21923
+ return {
21924
+ ...stmt,
21925
+ init: this.rewriteExpr(stmt.init, ctx),
21926
+ body: this.rewriteBlock(stmt.body, ctx)
21927
+ };
21928
+ case "const_decl":
21929
+ return { ...stmt, value: this.rewriteExpr(stmt.value, ctx) };
21340
21930
  case "break":
21341
21931
  case "continue":
21342
21932
  case "raw":
@@ -21394,11 +21984,16 @@ var require_monomorphize = __commonJS({
21394
21984
  case "str_interp":
21395
21985
  return { ...expr, parts: expr.parts.map((p) => typeof p === "string" ? p : this.rewriteExpr(p, ctx)) };
21396
21986
  case "f_string":
21397
- return expr;
21987
+ return {
21988
+ ...expr,
21989
+ parts: expr.parts.map((p) => p.kind === "text" ? p : { kind: "expr", expr: this.rewriteExpr(p.expr, ctx) })
21990
+ };
21398
21991
  case "some_lit":
21399
21992
  return { ...expr, value: this.rewriteExpr(expr.value, ctx) };
21400
21993
  case "none_lit":
21401
21994
  return expr;
21995
+ case "unwrap_or":
21996
+ return { ...expr, opt: this.rewriteExpr(expr.opt, ctx), default_: this.rewriteExpr(expr.default_, ctx) };
21402
21997
  // Literals / terminals — pass through unchanged
21403
21998
  default:
21404
21999
  return expr;
@@ -21481,6 +22076,212 @@ var require_monomorphize = __commonJS({
21481
22076
  }
21482
22077
  });
21483
22078
 
22079
+ // ../../dist/src/hir/deprecated.js
22080
+ var require_deprecated = __commonJS({
22081
+ "../../dist/src/hir/deprecated.js"(exports2) {
22082
+ "use strict";
22083
+ Object.defineProperty(exports2, "__esModule", { value: true });
22084
+ exports2.checkDeprecatedCalls = checkDeprecatedCalls;
22085
+ function buildDeprecatedMap(hir) {
22086
+ const deprecated = /* @__PURE__ */ new Map();
22087
+ for (const fn of hir.functions) {
22088
+ const dep = getDeprecatedDecorator(fn.decorators);
22089
+ if (dep !== null) {
22090
+ deprecated.set(fn.name, dep);
22091
+ }
22092
+ }
22093
+ for (const ib of hir.implBlocks) {
22094
+ for (const m of ib.methods) {
22095
+ const dep = getDeprecatedDecorator(m.decorators);
22096
+ if (dep !== null) {
22097
+ deprecated.set(`${ib.typeName}::${m.name}`, dep);
22098
+ }
22099
+ }
22100
+ }
22101
+ return deprecated;
22102
+ }
22103
+ function getDeprecatedDecorator(decorators) {
22104
+ for (const dec of decorators) {
22105
+ if (dec.name === "deprecated") {
22106
+ return dec.args?.message ?? "";
22107
+ }
22108
+ }
22109
+ return null;
22110
+ }
22111
+ function checkDeprecatedCalls(hir) {
22112
+ const deprecated = buildDeprecatedMap(hir);
22113
+ if (deprecated.size === 0)
22114
+ return [];
22115
+ const warnings = [];
22116
+ for (const fn of hir.functions) {
22117
+ walkBlock(fn.body, fn.name, deprecated, warnings);
22118
+ }
22119
+ for (const ib of hir.implBlocks) {
22120
+ for (const m of ib.methods) {
22121
+ walkBlock(m.body, `${ib.typeName}::${m.name}`, deprecated, warnings);
22122
+ }
22123
+ }
22124
+ return warnings;
22125
+ }
22126
+ function walkBlock(block, caller, deprecated, warnings) {
22127
+ for (const stmt of block) {
22128
+ walkStmt(stmt, caller, deprecated, warnings);
22129
+ }
22130
+ }
22131
+ function walkStmt(stmt, caller, deprecated, warnings) {
22132
+ switch (stmt.kind) {
22133
+ case "let":
22134
+ case "let_destruct":
22135
+ walkExpr(stmt.init, caller, deprecated, warnings);
22136
+ break;
22137
+ case "expr":
22138
+ walkExpr(stmt.expr, caller, deprecated, warnings);
22139
+ break;
22140
+ case "return":
22141
+ if (stmt.value)
22142
+ walkExpr(stmt.value, caller, deprecated, warnings);
22143
+ break;
22144
+ case "if":
22145
+ walkExpr(stmt.cond, caller, deprecated, warnings);
22146
+ walkBlock(stmt.then, caller, deprecated, warnings);
22147
+ if (stmt.else_)
22148
+ walkBlock(stmt.else_, caller, deprecated, warnings);
22149
+ break;
22150
+ case "while":
22151
+ walkExpr(stmt.cond, caller, deprecated, warnings);
22152
+ walkBlock(stmt.body, caller, deprecated, warnings);
22153
+ if (stmt.step)
22154
+ walkBlock(stmt.step, caller, deprecated, warnings);
22155
+ break;
22156
+ case "foreach":
22157
+ walkExpr(stmt.iterable, caller, deprecated, warnings);
22158
+ walkBlock(stmt.body, caller, deprecated, warnings);
22159
+ break;
22160
+ case "match":
22161
+ walkExpr(stmt.expr, caller, deprecated, warnings);
22162
+ for (const arm of stmt.arms) {
22163
+ walkBlock(arm.body, caller, deprecated, warnings);
22164
+ }
22165
+ break;
22166
+ // break/continue/raw/execute: no sub-exprs to walk for deprecation purposes
22167
+ default:
22168
+ break;
22169
+ }
22170
+ }
22171
+ function walkExpr(expr, caller, deprecated, warnings) {
22172
+ switch (expr.kind) {
22173
+ case "call": {
22174
+ if (deprecated.has(expr.fn)) {
22175
+ const msg = deprecated.get(expr.fn);
22176
+ const location = expr.span ? `line ${expr.span.line}, col ${expr.span.col}: ` : "";
22177
+ const detail = msg ? `: ${msg}` : "";
22178
+ warnings.push(`[DeprecatedUsage] ${location}'${expr.fn}' is deprecated${detail} (called from '${caller}')`);
22179
+ }
22180
+ for (const arg of expr.args)
22181
+ walkExpr(arg, caller, deprecated, warnings);
22182
+ break;
22183
+ }
22184
+ case "static_call": {
22185
+ const qualName = `${expr.type}::${expr.method}`;
22186
+ if (deprecated.has(qualName)) {
22187
+ const msg = deprecated.get(qualName);
22188
+ const location = expr.span ? `line ${expr.span.line}, col ${expr.span.col}: ` : "";
22189
+ const detail = msg ? `: ${msg}` : "";
22190
+ warnings.push(`[DeprecatedUsage] ${location}'${qualName}' is deprecated${detail} (called from '${caller}')`);
22191
+ }
22192
+ for (const arg of expr.args)
22193
+ walkExpr(arg, caller, deprecated, warnings);
22194
+ break;
22195
+ }
22196
+ case "invoke":
22197
+ walkExpr(expr.callee, caller, deprecated, warnings);
22198
+ for (const arg of expr.args)
22199
+ walkExpr(arg, caller, deprecated, warnings);
22200
+ break;
22201
+ case "binary":
22202
+ walkExpr(expr.left, caller, deprecated, warnings);
22203
+ walkExpr(expr.right, caller, deprecated, warnings);
22204
+ break;
22205
+ case "unary":
22206
+ walkExpr(expr.operand, caller, deprecated, warnings);
22207
+ break;
22208
+ case "is_check":
22209
+ walkExpr(expr.expr, caller, deprecated, warnings);
22210
+ break;
22211
+ case "type_cast":
22212
+ walkExpr(expr.expr, caller, deprecated, warnings);
22213
+ break;
22214
+ case "assign":
22215
+ walkExpr(expr.value, caller, deprecated, warnings);
22216
+ break;
22217
+ case "member_assign":
22218
+ walkExpr(expr.obj, caller, deprecated, warnings);
22219
+ walkExpr(expr.value, caller, deprecated, warnings);
22220
+ break;
22221
+ case "index_assign":
22222
+ walkExpr(expr.obj, caller, deprecated, warnings);
22223
+ walkExpr(expr.index, caller, deprecated, warnings);
22224
+ walkExpr(expr.value, caller, deprecated, warnings);
22225
+ break;
22226
+ case "member":
22227
+ walkExpr(expr.obj, caller, deprecated, warnings);
22228
+ break;
22229
+ case "index":
22230
+ walkExpr(expr.obj, caller, deprecated, warnings);
22231
+ walkExpr(expr.index, caller, deprecated, warnings);
22232
+ break;
22233
+ case "array_lit":
22234
+ for (const el of expr.elements)
22235
+ walkExpr(el, caller, deprecated, warnings);
22236
+ break;
22237
+ case "struct_lit":
22238
+ for (const f of expr.fields)
22239
+ walkExpr(f.value, caller, deprecated, warnings);
22240
+ break;
22241
+ case "str_interp":
22242
+ for (const part of expr.parts) {
22243
+ if (typeof part !== "string")
22244
+ walkExpr(part, caller, deprecated, warnings);
22245
+ }
22246
+ break;
22247
+ case "f_string":
22248
+ for (const part of expr.parts) {
22249
+ if (part.kind === "expr")
22250
+ walkExpr(part.expr, caller, deprecated, warnings);
22251
+ }
22252
+ break;
22253
+ case "some_lit":
22254
+ walkExpr(expr.value, caller, deprecated, warnings);
22255
+ break;
22256
+ case "unwrap_or":
22257
+ walkExpr(expr.opt, caller, deprecated, warnings);
22258
+ walkExpr(expr.default_, caller, deprecated, warnings);
22259
+ break;
22260
+ case "lambda": {
22261
+ const body = expr.body;
22262
+ if (Array.isArray(body)) {
22263
+ walkBlock(body, caller, deprecated, warnings);
22264
+ } else {
22265
+ walkExpr(body, caller, deprecated, warnings);
22266
+ }
22267
+ break;
22268
+ }
22269
+ case "tuple_lit":
22270
+ for (const el of expr.elements)
22271
+ walkExpr(el, caller, deprecated, warnings);
22272
+ break;
22273
+ case "enum_construct":
22274
+ for (const arg of expr.args)
22275
+ walkExpr(arg.value, caller, deprecated, warnings);
22276
+ break;
22277
+ // Terminals: int_lit, float_lit, bool_lit, str_lit, ident, selector, etc.
22278
+ default:
22279
+ break;
22280
+ }
22281
+ }
22282
+ }
22283
+ });
22284
+
21484
22285
  // ../../dist/src/mir/macro.js
21485
22286
  var require_macro = __commonJS({
21486
22287
  "../../dist/src/mir/macro.js"(exports2) {
@@ -21667,23 +22468,35 @@ var require_lower2 = __commonJS({
21667
22468
  var macro_1 = require_macro();
21668
22469
  function lowerToMIR(hir, sourceFile) {
21669
22470
  const structDefs = /* @__PURE__ */ new Map();
22471
+ const singletonStructs = /* @__PURE__ */ new Set();
21670
22472
  for (const s of hir.structs) {
21671
22473
  structDefs.set(s.name, s.fields.map((f) => f.name));
22474
+ if (s.isSingleton)
22475
+ singletonStructs.add(s.name);
21672
22476
  }
21673
22477
  const enumDefs = /* @__PURE__ */ new Map();
22478
+ const enumPayloads = /* @__PURE__ */ new Map();
21674
22479
  for (const e of hir.enums) {
21675
22480
  const variants = /* @__PURE__ */ new Map();
22481
+ const payloads = /* @__PURE__ */ new Map();
21676
22482
  for (const v of e.variants) {
21677
22483
  variants.set(v.name, v.value ?? 0);
22484
+ if (v.fields && v.fields.length > 0) {
22485
+ payloads.set(v.name, v.fields);
22486
+ }
21678
22487
  }
21679
22488
  enumDefs.set(e.name, variants);
22489
+ if (payloads.size > 0) {
22490
+ enumPayloads.set(e.name, payloads);
22491
+ }
21680
22492
  }
21681
22493
  const implMethods = /* @__PURE__ */ new Map();
21682
22494
  for (const ib of hir.implBlocks) {
21683
22495
  const methods = /* @__PURE__ */ new Map();
21684
22496
  for (const m of ib.methods) {
21685
22497
  const hasSelf = m.params.length > 0 && m.params[0].name === "self";
21686
- methods.set(m.name, { hasSelf });
22498
+ const returnStructName = m.returnType.kind === "struct" ? m.returnType.name : void 0;
22499
+ methods.set(m.name, { hasSelf, returnStructName });
21687
22500
  }
21688
22501
  implMethods.set(ib.typeName, methods);
21689
22502
  }
@@ -21703,14 +22516,23 @@ var require_lower2 = __commonJS({
21703
22516
  hirFnMap.set(f.name, f);
21704
22517
  }
21705
22518
  const specializedFnsRegistry = /* @__PURE__ */ new Map();
22519
+ const constValues = /* @__PURE__ */ new Map();
22520
+ for (const c of hir.consts) {
22521
+ if (c.value.kind === "int_lit")
22522
+ constValues.set(c.name, c.value.value);
22523
+ else if (c.value.kind === "bool_lit")
22524
+ constValues.set(c.name, c.value.value ? 1 : 0);
22525
+ else if (c.value.kind === "float_lit")
22526
+ constValues.set(c.name, Math.round(c.value.value * 1e4));
22527
+ }
21706
22528
  const allFunctions = [];
21707
22529
  for (const f of hir.functions) {
21708
- const { fn, helpers } = lowerFunction(f, hir.namespace, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, sourceFile, timerCounter, void 0, hirFnMap, specializedFnsRegistry);
22530
+ const { fn, helpers } = lowerFunction(f, hir.namespace, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, sourceFile, timerCounter, void 0, hirFnMap, specializedFnsRegistry, void 0, enumPayloads, constValues, singletonStructs);
21709
22531
  allFunctions.push(fn, ...helpers);
21710
22532
  }
21711
22533
  for (const ib of hir.implBlocks) {
21712
22534
  for (const m of ib.methods) {
21713
- const { fn, helpers } = lowerImplMethod(m, ib.typeName, hir.namespace, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, sourceFile, timerCounter);
22535
+ const { fn, helpers } = lowerImplMethod(m, ib.typeName, hir.namespace, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, sourceFile, timerCounter, enumPayloads, constValues);
21714
22536
  allFunctions.push(fn, ...helpers);
21715
22537
  }
21716
22538
  }
@@ -21724,7 +22546,7 @@ var require_lower2 = __commonJS({
21724
22546
  };
21725
22547
  }
21726
22548
  var FnContext = class {
21727
- constructor(namespace, fnName, structDefs = /* @__PURE__ */ new Map(), implMethods = /* @__PURE__ */ new Map(), macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), timerCounter = { count: 0, timerId: 0 }) {
22549
+ constructor(namespace, fnName, structDefs = /* @__PURE__ */ new Map(), implMethods = /* @__PURE__ */ new Map(), macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), timerCounter = { count: 0, timerId: 0 }, enumPayloads = /* @__PURE__ */ new Map()) {
21728
22550
  this.tempCounter = 0;
21729
22551
  this.blockCounter = 0;
21730
22552
  this.blocks = [];
@@ -21733,14 +22555,18 @@ var require_lower2 = __commonJS({
21733
22555
  this.structVars = /* @__PURE__ */ new Map();
21734
22556
  this.tupleVars = /* @__PURE__ */ new Map();
21735
22557
  this.arrayVars = /* @__PURE__ */ new Map();
22558
+ this.stringVars = /* @__PURE__ */ new Map();
21736
22559
  this.currentSourceLoc = void 0;
21737
22560
  this.sourceFile = void 0;
21738
22561
  this.constTemps = /* @__PURE__ */ new Map();
21739
22562
  this.floatTemps = /* @__PURE__ */ new Set();
21740
22563
  this.doubleVars = /* @__PURE__ */ new Map();
21741
22564
  this.doubleVarCount = 0;
22565
+ this.stringVarCount = 0;
21742
22566
  this.hirFunctions = /* @__PURE__ */ new Map();
21743
22567
  this.specializedFnsRegistry = /* @__PURE__ */ new Map();
22568
+ this.constValues = /* @__PURE__ */ new Map();
22569
+ this.singletonStructs = /* @__PURE__ */ new Set();
21744
22570
  this.namespace = namespace;
21745
22571
  this.fnName = fnName;
21746
22572
  this.structDefs = structDefs;
@@ -21749,6 +22575,7 @@ var require_lower2 = __commonJS({
21749
22575
  this.fnParamInfo = fnParamInfo;
21750
22576
  this.currentMacroParams = macroInfo.get(fnName)?.macroParams ?? /* @__PURE__ */ new Set();
21751
22577
  this.enumDefs = enumDefs;
22578
+ this.enumPayloads = enumPayloads;
21752
22579
  this.timerCounter = timerCounter;
21753
22580
  const entry = this.makeBlock("entry");
21754
22581
  this.currentBlock = entry;
@@ -21809,11 +22636,17 @@ var require_lower2 = __commonJS({
21809
22636
  this.doubleVars.set(varName, path3);
21810
22637
  return path3;
21811
22638
  }
22639
+ /** Allocate a unique NBT storage path for a string value */
22640
+ freshStringVar(varName) {
22641
+ return `${this.namespace}_${this.fnName}_${varName}_${this.stringVarCount++}`;
22642
+ }
21812
22643
  };
21813
- function lowerFunction(fn, namespace, structDefs = /* @__PURE__ */ new Map(), implMethods = /* @__PURE__ */ new Map(), macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), sourceFile, timerCounter = { count: 0, timerId: 0 }, arrayArgBindings, hirFnMap, specializedFnsRegistry, overrideName) {
22644
+ function lowerFunction(fn, namespace, structDefs = /* @__PURE__ */ new Map(), implMethods = /* @__PURE__ */ new Map(), macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), sourceFile, timerCounter = { count: 0, timerId: 0 }, arrayArgBindings, hirFnMap, specializedFnsRegistry, overrideName, enumPayloads = /* @__PURE__ */ new Map(), constValues = /* @__PURE__ */ new Map(), singletonStructs = /* @__PURE__ */ new Set()) {
21814
22645
  const mirFnName = overrideName ?? fn.name;
21815
- const ctx = new FnContext(namespace, mirFnName, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, timerCounter);
22646
+ const ctx = new FnContext(namespace, mirFnName, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, timerCounter, enumPayloads);
21816
22647
  ctx.sourceFile = sourceFile;
22648
+ ctx.constValues = constValues;
22649
+ ctx.singletonStructs = singletonStructs;
21817
22650
  if (hirFnMap)
21818
22651
  ctx.hirFunctions = hirFnMap;
21819
22652
  if (specializedFnsRegistry)
@@ -21827,6 +22660,7 @@ var require_lower2 = __commonJS({
21827
22660
  const params = [];
21828
22661
  const scope = /* @__PURE__ */ new Map();
21829
22662
  let doubleParamSlot = 0;
22663
+ let stringParamSlot = 0;
21830
22664
  fn.params.forEach((p) => {
21831
22665
  if (p.type.kind === "array" && arrayArgBindings?.has(p.name)) {
21832
22666
  return;
@@ -21836,6 +22670,10 @@ var require_lower2 = __commonJS({
21836
22670
  ctx.doubleVars.set(p.name, path3);
21837
22671
  return;
21838
22672
  }
22673
+ if (p.type.kind === "named" && (p.type.name === "string" || p.type.name === "format_string")) {
22674
+ ctx.stringVars.set(p.name, `__sp${stringParamSlot++}`);
22675
+ return;
22676
+ }
21839
22677
  const t = ctx.freshTemp();
21840
22678
  params.push({ name: t, isMacroParam: fnMacroInfo?.macroParams.has(p.name) ?? false });
21841
22679
  scope.set(p.name, t);
@@ -21857,10 +22695,11 @@ var require_lower2 = __commonJS({
21857
22695
  };
21858
22696
  return { fn: result, helpers: ctx.helperFunctions };
21859
22697
  }
21860
- function lowerImplMethod(method, typeName, namespace, structDefs, implMethods, macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), sourceFile, timerCounter = { count: 0, timerId: 0 }) {
22698
+ function lowerImplMethod(method, typeName, namespace, structDefs, implMethods, macroInfo = /* @__PURE__ */ new Map(), fnParamInfo = /* @__PURE__ */ new Map(), enumDefs = /* @__PURE__ */ new Map(), sourceFile, timerCounter = { count: 0, timerId: 0 }, enumPayloads = /* @__PURE__ */ new Map(), constValues = /* @__PURE__ */ new Map()) {
21861
22699
  const fnName = `${typeName}::${method.name}`;
21862
- const ctx = new FnContext(namespace, fnName, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, timerCounter);
22700
+ const ctx = new FnContext(namespace, fnName, structDefs, implMethods, macroInfo, fnParamInfo, enumDefs, timerCounter, enumPayloads);
21863
22701
  ctx.sourceFile = sourceFile;
22702
+ ctx.constValues = constValues;
21864
22703
  const fields = structDefs.get(typeName) ?? [];
21865
22704
  const hasSelf = method.params.length > 0 && method.params[0].name === "self";
21866
22705
  const params = [];
@@ -21874,15 +22713,40 @@ var require_lower2 = __commonJS({
21874
22713
  }
21875
22714
  ctx.structVars.set("self", { typeName, fields: selfFields });
21876
22715
  for (let i = 1; i < method.params.length; i++) {
21877
- const t = ctx.freshTemp();
21878
- params.push({ name: t, isMacroParam: false });
21879
- scope.set(method.params[i].name, t);
22716
+ const p = method.params[i];
22717
+ const paramTypeName = p.type.kind === "named" ? p.type.name : p.type.kind === "struct" ? p.type.name : null;
22718
+ const paramFields = paramTypeName ? ctx.structDefs.get(paramTypeName) : null;
22719
+ if (paramFields && paramFields.length > 0) {
22720
+ const paramFieldTemps = /* @__PURE__ */ new Map();
22721
+ for (const fieldName of paramFields) {
22722
+ const t = ctx.freshTemp();
22723
+ params.push({ name: t, isMacroParam: false });
22724
+ paramFieldTemps.set(fieldName, t);
22725
+ }
22726
+ ctx.structVars.set(p.name, { typeName: paramTypeName, fields: paramFieldTemps });
22727
+ } else {
22728
+ const t = ctx.freshTemp();
22729
+ params.push({ name: t, isMacroParam: false });
22730
+ scope.set(p.name, t);
22731
+ }
21880
22732
  }
21881
22733
  } else {
21882
22734
  for (const p of method.params) {
21883
- const t = ctx.freshTemp();
21884
- params.push({ name: t, isMacroParam: false });
21885
- scope.set(p.name, t);
22735
+ const paramTypeName = p.type.kind === "named" ? p.type.name : p.type.kind === "struct" ? p.type.name : null;
22736
+ const paramFields = paramTypeName ? ctx.structDefs.get(paramTypeName) : null;
22737
+ if (paramFields && paramFields.length > 0) {
22738
+ const paramFieldTemps = /* @__PURE__ */ new Map();
22739
+ for (const fieldName of paramFields) {
22740
+ const t = ctx.freshTemp();
22741
+ params.push({ name: t, isMacroParam: false });
22742
+ paramFieldTemps.set(fieldName, t);
22743
+ }
22744
+ ctx.structVars.set(p.name, { typeName: paramTypeName, fields: paramFieldTemps });
22745
+ } else {
22746
+ const t = ctx.freshTemp();
22747
+ params.push({ name: t, isMacroParam: false });
22748
+ scope.set(p.name, t);
22749
+ }
21886
22750
  }
21887
22751
  }
21888
22752
  lowerBlock(method.body, ctx, scope);
@@ -21959,7 +22823,13 @@ var require_lower2 = __commonJS({
21959
22823
  }
21960
22824
  switch (stmt.kind) {
21961
22825
  case "let": {
21962
- if (stmt.init.kind === "some_lit") {
22826
+ if (stmt.type?.kind === "named" && (stmt.type.name === "string" || stmt.type.name === "format_string")) {
22827
+ const path3 = lowerStringExprToPath(stmt.init, ctx, scope, stmt.name) ?? ctx.freshStringVar(stmt.name);
22828
+ ctx.stringVars.set(stmt.name, path3);
22829
+ const t = ctx.freshTemp();
22830
+ ctx.emit({ kind: "const", dst: t, value: 0 });
22831
+ scope.set(stmt.name, t);
22832
+ } else if (stmt.init.kind === "some_lit") {
21963
22833
  const hasTemp = `__opt_${stmt.name}_has`;
21964
22834
  const valTemp = `__opt_${stmt.name}_val`;
21965
22835
  ctx.emit({ kind: "const", dst: hasTemp, value: 1 });
@@ -21978,10 +22848,26 @@ var require_lower2 = __commonJS({
21978
22848
  const typeName = stmt.type?.kind === "struct" ? stmt.type.name : "__anon";
21979
22849
  const fieldTemps = /* @__PURE__ */ new Map();
21980
22850
  for (const field of stmt.init.fields) {
21981
- const val = lowerExpr(field.value, ctx, scope);
21982
- const t = ctx.freshTemp();
21983
- ctx.emit({ kind: "copy", dst: t, src: val });
21984
- fieldTemps.set(field.name, t);
22851
+ if (field.value.kind === "struct_lit") {
22852
+ const nestedVarName = `${stmt.name}.${field.name}`;
22853
+ const nestedTypeName = "__anon";
22854
+ const nestedFieldTemps = /* @__PURE__ */ new Map();
22855
+ for (const nestedField of field.value.fields) {
22856
+ const nval = lowerExpr(nestedField.value, ctx, scope);
22857
+ const nt = ctx.freshTemp();
22858
+ ctx.emit({ kind: "copy", dst: nt, src: nval });
22859
+ nestedFieldTemps.set(nestedField.name, nt);
22860
+ }
22861
+ ctx.structVars.set(nestedVarName, { typeName: nestedTypeName, fields: nestedFieldTemps });
22862
+ const t = ctx.freshTemp();
22863
+ ctx.emit({ kind: "const", dst: t, value: 0 });
22864
+ fieldTemps.set(field.name, t);
22865
+ } else {
22866
+ const val = lowerExpr(field.value, ctx, scope);
22867
+ const t = ctx.freshTemp();
22868
+ ctx.emit({ kind: "copy", dst: t, src: val });
22869
+ fieldTemps.set(field.name, t);
22870
+ }
21985
22871
  }
21986
22872
  ctx.structVars.set(stmt.name, { typeName, fields: fieldTemps });
21987
22873
  } else if (stmt.type?.kind === "option") {
@@ -21992,8 +22878,12 @@ var require_lower2 = __commonJS({
21992
22878
  ctx.emit({ kind: "copy", dst: valTemp, src: { kind: "temp", name: "__rf_val" } });
21993
22879
  const fieldTemps = /* @__PURE__ */ new Map([["has", hasTemp], ["val", valTemp]]);
21994
22880
  ctx.structVars.set(stmt.name, { typeName: "__option", fields: fieldTemps });
21995
- } else if (stmt.type?.kind === "struct") {
21996
- const fields = ctx.structDefs.get(stmt.type.name);
22881
+ } else if (
22882
+ // Struct-typed let: explicit annotation OR inferred from @singleton::get() return
22883
+ stmt.type?.kind === "struct" || stmt.init.kind === "static_call" && ctx.singletonStructs.has(stmt.init.type) && stmt.init.method === "get"
22884
+ ) {
22885
+ const inferredStructName = stmt.type?.kind === "struct" ? stmt.type.name : stmt.init.type;
22886
+ const fields = ctx.structDefs.get(inferredStructName);
21997
22887
  if (fields) {
21998
22888
  lowerExpr(stmt.init, ctx, scope);
21999
22889
  const fieldTemps = /* @__PURE__ */ new Map();
@@ -22007,7 +22897,7 @@ var require_lower2 = __commonJS({
22007
22897
  ctx.constTemps.set(t, constVal);
22008
22898
  }
22009
22899
  }
22010
- ctx.structVars.set(stmt.name, { typeName: stmt.type.name, fields: fieldTemps });
22900
+ ctx.structVars.set(stmt.name, { typeName: inferredStructName, fields: fieldTemps });
22011
22901
  } else {
22012
22902
  const valOp = lowerExpr(stmt.init, ctx, scope);
22013
22903
  const t = ctx.freshTemp();
@@ -22031,25 +22921,33 @@ var require_lower2 = __commonJS({
22031
22921
  } else if (stmt.init.kind === "array_lit") {
22032
22922
  const ns = `${ctx.getNamespace()}:arrays`;
22033
22923
  const pathPrefix = stmt.name;
22034
- ctx.arrayVars.set(stmt.name, { ns, pathPrefix });
22924
+ ctx.arrayVars.set(stmt.name, { ns, pathPrefix, knownLen: stmt.init.elements.length });
22035
22925
  const elems = stmt.init.elements;
22036
22926
  const allConst = elems.every((e) => e.kind === "int_lit");
22037
22927
  if (allConst) {
22038
22928
  const vals = elems.map((e) => e.value).join(", ");
22039
22929
  ctx.emit({ kind: "call", dst: null, fn: `__raw:data modify storage ${ns} ${pathPrefix} set value [${vals}]`, args: [] });
22040
22930
  } else {
22041
- const zeros = elems.map(() => "0").join(", ");
22042
- ctx.emit({ kind: "call", dst: null, fn: `__raw:data modify storage ${ns} ${pathPrefix} set value [${zeros}]`, args: [] });
22931
+ const initVals = elems.map((e) => e.kind === "int_lit" ? String(e.value) : "0").join(", ");
22932
+ ctx.emit({ kind: "call", dst: null, fn: `__raw:data modify storage ${ns} ${pathPrefix} set value [${initVals}]`, args: [] });
22043
22933
  for (let i = 0; i < elems.length; i++) {
22934
+ if (elems[i].kind === "int_lit")
22935
+ continue;
22044
22936
  const elemOp = lowerExpr(elems[i], ctx, scope);
22045
- if (elemOp.kind !== "const" || elems[i].kind !== "int_lit") {
22046
- ctx.emit({ kind: "nbt_write", ns, path: `${pathPrefix}[${i}]`, type: "int", scale: 1, src: elemOp });
22047
- }
22937
+ ctx.emit({ kind: "nbt_write", ns, path: `${pathPrefix}[${i}]`, type: "int", scale: 1, src: elemOp });
22048
22938
  }
22049
22939
  }
22050
22940
  const lenTemp = ctx.freshTemp();
22051
22941
  ctx.emit({ kind: "const", dst: lenTemp, value: elems.length });
22052
22942
  scope.set(stmt.name, lenTemp);
22943
+ } else if (stmt.type?.kind === "array") {
22944
+ const ns = `${ctx.getNamespace()}:arrays`;
22945
+ const pathPrefix = stmt.name;
22946
+ ctx.arrayVars.set(stmt.name, { ns, pathPrefix });
22947
+ lowerExpr(stmt.init, ctx, scope);
22948
+ const lenTemp = ctx.freshTemp();
22949
+ ctx.emit({ kind: "const", dst: lenTemp, value: 0 });
22950
+ scope.set(stmt.name, lenTemp);
22053
22951
  } else {
22054
22952
  const valOp = lowerExpr(stmt.init, ctx, scope);
22055
22953
  const t = ctx.freshTemp();
@@ -22102,6 +23000,12 @@ var require_lower2 = __commonJS({
22102
23000
  }
22103
23001
  break;
22104
23002
  }
23003
+ case "const_decl": {
23004
+ const op = lowerExpr(stmt.value, ctx, scope);
23005
+ const numericValue = op.kind === "const" ? op.value : 0;
23006
+ ctx.constValues.set(stmt.name, numericValue);
23007
+ break;
23008
+ }
22105
23009
  case "expr": {
22106
23010
  lowerExpr(stmt.expr, ctx, scope);
22107
23011
  break;
@@ -22268,47 +23172,113 @@ var require_lower2 = __commonJS({
22268
23172
  break;
22269
23173
  }
22270
23174
  case "match": {
22271
- const matchVal = lowerExpr(stmt.expr, ctx, scope);
23175
+ const hasStringPats = stmt.arms.some((a) => a.pattern.kind === "PatExpr" && a.pattern.expr.kind === "str_lit");
23176
+ if (hasStringPats) {
23177
+ const matchPath = lowerStringExprToPath(stmt.expr, ctx, scope, "match");
23178
+ if (!matchPath) {
23179
+ throw new Error("String match requires a string literal or tracked string variable");
23180
+ }
23181
+ const mergeBlock2 = ctx.newBlock("match_merge");
23182
+ for (let i = 0; i < stmt.arms.length; i++) {
23183
+ const arm = stmt.arms[i];
23184
+ const pat = arm.pattern;
23185
+ if (pat.kind === "PatWild") {
23186
+ lowerBlock(arm.body, ctx, new Map(scope));
23187
+ if (isPlaceholderTerm(ctx.current().term)) {
23188
+ ctx.terminate({ kind: "jump", target: mergeBlock2.id });
23189
+ }
23190
+ continue;
23191
+ }
23192
+ if (pat.kind === "PatExpr" && pat.expr.kind === "str_lit") {
23193
+ const cmpTemp = ctx.freshTemp();
23194
+ ctx.emit({ kind: "string_match", dst: cmpTemp, ns: "rs:strings", path: matchPath, value: pat.expr.value });
23195
+ const armBody = ctx.newBlock("match_arm");
23196
+ const nextArm = ctx.newBlock("match_next");
23197
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
23198
+ ctx.switchTo(armBody);
23199
+ lowerBlock(arm.body, ctx, new Map(scope));
23200
+ if (isPlaceholderTerm(ctx.current().term)) {
23201
+ ctx.terminate({ kind: "jump", target: mergeBlock2.id });
23202
+ }
23203
+ ctx.switchTo(nextArm);
23204
+ continue;
23205
+ }
23206
+ throw new Error(`Unsupported string match pattern: ${pat.kind}`);
23207
+ }
23208
+ if (isPlaceholderTerm(ctx.current().term)) {
23209
+ ctx.terminate({ kind: "jump", target: mergeBlock2.id });
23210
+ }
23211
+ ctx.switchTo(mergeBlock2);
23212
+ break;
23213
+ }
22272
23214
  const mergeBlock = ctx.newBlock("match_merge");
23215
+ const hasOptionPats = stmt.arms.some((a) => a.pattern.kind === "PatSome" || a.pattern.kind === "PatNone");
23216
+ let optHasOp;
23217
+ let optValTemp;
23218
+ if (hasOptionPats) {
23219
+ if (stmt.expr.kind === "ident") {
23220
+ const sv = ctx.structVars.get(stmt.expr.name);
23221
+ if (sv && sv.typeName === "__option") {
23222
+ optHasOp = { kind: "temp", name: sv.fields.get("has") };
23223
+ optValTemp = sv.fields.get("val");
23224
+ } else {
23225
+ lowerExpr(stmt.expr, ctx, scope);
23226
+ const hasT = ctx.freshTemp();
23227
+ const valT = ctx.freshTemp();
23228
+ ctx.emit({ kind: "copy", dst: hasT, src: { kind: "temp", name: "__rf_has" } });
23229
+ ctx.emit({ kind: "copy", dst: valT, src: { kind: "temp", name: "__rf_val" } });
23230
+ optHasOp = { kind: "temp", name: hasT };
23231
+ optValTemp = valT;
23232
+ }
23233
+ } else {
23234
+ lowerExpr(stmt.expr, ctx, scope);
23235
+ const hasT = ctx.freshTemp();
23236
+ const valT = ctx.freshTemp();
23237
+ ctx.emit({ kind: "copy", dst: hasT, src: { kind: "temp", name: "__rf_has" } });
23238
+ ctx.emit({ kind: "copy", dst: valT, src: { kind: "temp", name: "__rf_val" } });
23239
+ optHasOp = { kind: "temp", name: hasT };
23240
+ optValTemp = valT;
23241
+ }
23242
+ }
23243
+ const matchVal = hasOptionPats ? optHasOp : lowerExpr(stmt.expr, ctx, scope);
22273
23244
  for (let i = 0; i < stmt.arms.length; i++) {
22274
23245
  const arm = stmt.arms[i];
22275
- if (arm.pattern === null) {
23246
+ const pat = arm.pattern;
23247
+ if (pat.kind === "PatWild") {
22276
23248
  lowerBlock(arm.body, ctx, new Map(scope));
22277
23249
  if (isPlaceholderTerm(ctx.current().term)) {
22278
23250
  ctx.terminate({ kind: "jump", target: mergeBlock.id });
22279
23251
  }
22280
- } else if (arm.pattern.kind === "range_lit") {
22281
- const range = arm.pattern.range;
23252
+ } else if (pat.kind === "PatNone") {
23253
+ const cmpTemp = ctx.freshTemp();
23254
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: optHasOp, b: { kind: "const", value: 0 } });
22282
23255
  const armBody = ctx.newBlock("match_arm");
22283
23256
  const nextArm = ctx.newBlock("match_next");
22284
- const checks = [];
22285
- if (range.min !== void 0)
22286
- checks.push({ op: "ge", bound: range.min });
22287
- if (range.max !== void 0)
22288
- checks.push({ op: "le", bound: range.max });
22289
- if (checks.length === 0) {
22290
- ctx.terminate({ kind: "jump", target: armBody.id });
22291
- } else {
22292
- for (let ci = 0; ci < checks.length; ci++) {
22293
- const { op, bound } = checks[ci];
22294
- const cmpTemp = ctx.freshTemp();
22295
- ctx.emit({ kind: "cmp", dst: cmpTemp, op, a: matchVal, b: { kind: "const", value: bound } });
22296
- const passBlock = ci === checks.length - 1 ? armBody : ctx.newBlock("match_range_check");
22297
- ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: passBlock.id, else: nextArm.id });
22298
- if (ci < checks.length - 1)
22299
- ctx.switchTo(passBlock);
22300
- }
22301
- }
23257
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
22302
23258
  ctx.switchTo(armBody);
22303
23259
  lowerBlock(arm.body, ctx, new Map(scope));
22304
23260
  if (isPlaceholderTerm(ctx.current().term)) {
22305
23261
  ctx.terminate({ kind: "jump", target: mergeBlock.id });
22306
23262
  }
22307
23263
  ctx.switchTo(nextArm);
22308
- } else {
22309
- const patOp = lowerExpr(arm.pattern, ctx, scope);
23264
+ } else if (pat.kind === "PatSome") {
22310
23265
  const cmpTemp = ctx.freshTemp();
22311
- ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: matchVal, b: patOp });
23266
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: optHasOp, b: { kind: "const", value: 1 } });
23267
+ const armBody = ctx.newBlock("match_arm");
23268
+ const nextArm = ctx.newBlock("match_next");
23269
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
23270
+ ctx.switchTo(armBody);
23271
+ const armScope = new Map(scope);
23272
+ if (optValTemp)
23273
+ armScope.set(pat.binding, optValTemp);
23274
+ lowerBlock(arm.body, ctx, armScope);
23275
+ if (isPlaceholderTerm(ctx.current().term)) {
23276
+ ctx.terminate({ kind: "jump", target: mergeBlock.id });
23277
+ }
23278
+ ctx.switchTo(nextArm);
23279
+ } else if (pat.kind === "PatInt") {
23280
+ const cmpTemp = ctx.freshTemp();
23281
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: matchVal, b: { kind: "const", value: pat.value } });
22312
23282
  const armBody = ctx.newBlock("match_arm");
22313
23283
  const nextArm = ctx.newBlock("match_next");
22314
23284
  ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
@@ -22318,6 +23288,79 @@ var require_lower2 = __commonJS({
22318
23288
  ctx.terminate({ kind: "jump", target: mergeBlock.id });
22319
23289
  }
22320
23290
  ctx.switchTo(nextArm);
23291
+ } else if (pat.kind === "PatEnum") {
23292
+ const tagValue = ctx.enumDefs.get(pat.enumName)?.get(pat.variant) ?? 0;
23293
+ const cmpTemp = ctx.freshTemp();
23294
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: matchVal, b: { kind: "const", value: tagValue } });
23295
+ const armBody = ctx.newBlock("match_arm");
23296
+ const nextArm = ctx.newBlock("match_next");
23297
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
23298
+ ctx.switchTo(armBody);
23299
+ const armScope = new Map(scope);
23300
+ const payloadFields = ctx.enumPayloads.get(pat.enumName)?.get(pat.variant) ?? [];
23301
+ for (let bi = 0; bi < pat.bindings.length; bi++) {
23302
+ const binding = pat.bindings[bi];
23303
+ const fieldDef = payloadFields[bi];
23304
+ const fieldName = fieldDef ? fieldDef.name : binding;
23305
+ const bindTemp = ctx.freshTemp();
23306
+ ctx.emit({
23307
+ kind: "nbt_read",
23308
+ dst: bindTemp,
23309
+ ns: "rs:enums",
23310
+ path: `${pat.enumName}_${fieldName}`,
23311
+ scale: 1
23312
+ });
23313
+ armScope.set(binding, bindTemp);
23314
+ }
23315
+ lowerBlock(arm.body, ctx, armScope);
23316
+ if (isPlaceholderTerm(ctx.current().term)) {
23317
+ ctx.terminate({ kind: "jump", target: mergeBlock.id });
23318
+ }
23319
+ ctx.switchTo(nextArm);
23320
+ } else if (pat.kind === "PatExpr") {
23321
+ const expr = pat.expr;
23322
+ if (expr.kind === "range_lit") {
23323
+ const range = expr.range;
23324
+ const armBody = ctx.newBlock("match_arm");
23325
+ const nextArm = ctx.newBlock("match_next");
23326
+ const checks = [];
23327
+ if (range.min !== void 0)
23328
+ checks.push({ op: "ge", bound: range.min });
23329
+ if (range.max !== void 0)
23330
+ checks.push({ op: "le", bound: range.max });
23331
+ if (checks.length === 0) {
23332
+ ctx.terminate({ kind: "jump", target: armBody.id });
23333
+ } else {
23334
+ for (let ci = 0; ci < checks.length; ci++) {
23335
+ const { op, bound } = checks[ci];
23336
+ const cmpTemp = ctx.freshTemp();
23337
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op, a: matchVal, b: { kind: "const", value: bound } });
23338
+ const passBlock = ci === checks.length - 1 ? armBody : ctx.newBlock("match_range_check");
23339
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: passBlock.id, else: nextArm.id });
23340
+ if (ci < checks.length - 1)
23341
+ ctx.switchTo(passBlock);
23342
+ }
23343
+ }
23344
+ ctx.switchTo(armBody);
23345
+ lowerBlock(arm.body, ctx, new Map(scope));
23346
+ if (isPlaceholderTerm(ctx.current().term)) {
23347
+ ctx.terminate({ kind: "jump", target: mergeBlock.id });
23348
+ }
23349
+ ctx.switchTo(nextArm);
23350
+ } else {
23351
+ const patOp = lowerExpr(expr, ctx, scope);
23352
+ const cmpTemp = ctx.freshTemp();
23353
+ ctx.emit({ kind: "cmp", dst: cmpTemp, op: "eq", a: matchVal, b: patOp });
23354
+ const armBody = ctx.newBlock("match_arm");
23355
+ const nextArm = ctx.newBlock("match_next");
23356
+ ctx.terminate({ kind: "branch", cond: { kind: "temp", name: cmpTemp }, then: armBody.id, else: nextArm.id });
23357
+ ctx.switchTo(armBody);
23358
+ lowerBlock(arm.body, ctx, new Map(scope));
23359
+ if (isPlaceholderTerm(ctx.current().term)) {
23360
+ ctx.terminate({ kind: "jump", target: mergeBlock.id });
23361
+ }
23362
+ ctx.switchTo(nextArm);
23363
+ }
22321
23364
  }
22322
23365
  }
22323
23366
  if (isPlaceholderTerm(ctx.current().term)) {
@@ -22376,6 +23419,47 @@ var require_lower2 = __commonJS({
22376
23419
  ctx.switchTo(mergeBlock);
22377
23420
  break;
22378
23421
  }
23422
+ case "while_let_some": {
23423
+ const headerBlock = ctx.newBlock("whl_header");
23424
+ const bodyBlock = ctx.newBlock("whl_body");
23425
+ const exitBlock = ctx.newBlock("whl_exit");
23426
+ ctx.terminate({ kind: "jump", target: headerBlock.id });
23427
+ ctx.switchTo(headerBlock);
23428
+ let hasOp;
23429
+ let valTemp;
23430
+ const sv = (() => {
23431
+ if (stmt.init.kind === "ident")
23432
+ return ctx.structVars.get(stmt.init.name);
23433
+ return void 0;
23434
+ })();
23435
+ if (sv && sv.typeName === "__option") {
23436
+ const hasT = sv.fields.get("has");
23437
+ const valT = sv.fields.get("val");
23438
+ hasOp = { kind: "temp", name: hasT };
23439
+ valTemp = valT;
23440
+ } else {
23441
+ lowerExpr(stmt.init, ctx, scope);
23442
+ const hasT = ctx.freshTemp();
23443
+ const valT = ctx.freshTemp();
23444
+ ctx.emit({ kind: "copy", dst: hasT, src: { kind: "temp", name: "__rf_has" } });
23445
+ ctx.emit({ kind: "copy", dst: valT, src: { kind: "temp", name: "__rf_val" } });
23446
+ hasOp = { kind: "temp", name: hasT };
23447
+ valTemp = valT;
23448
+ }
23449
+ ctx.terminate({ kind: "branch", cond: hasOp, then: bodyBlock.id, else: exitBlock.id });
23450
+ ctx.switchTo(bodyBlock);
23451
+ const bodyScope = new Map(scope);
23452
+ if (valTemp)
23453
+ bodyScope.set(stmt.binding, valTemp);
23454
+ ctx.pushLoop(headerBlock.id, exitBlock.id, headerBlock.id);
23455
+ lowerBlock(stmt.body, ctx, bodyScope);
23456
+ ctx.popLoop();
23457
+ if (isPlaceholderTerm(ctx.current().term)) {
23458
+ ctx.terminate({ kind: "jump", target: headerBlock.id });
23459
+ }
23460
+ ctx.switchTo(exitBlock);
23461
+ break;
23462
+ }
22379
23463
  default: {
22380
23464
  const _exhaustive = stmt;
22381
23465
  throw new Error(`Unknown HIR statement kind: ${_exhaustive.kind}`);
@@ -22438,6 +23522,9 @@ var require_lower2 = __commonJS({
22438
23522
  const temp = scope.get(expr.name);
22439
23523
  if (temp)
22440
23524
  return { kind: "temp", name: temp };
23525
+ if (ctx.constValues.has(expr.name)) {
23526
+ return { kind: "const", value: ctx.constValues.get(expr.name) };
23527
+ }
22441
23528
  const t = ctx.freshTemp();
22442
23529
  ctx.emit({ kind: "copy", dst: t, src: { kind: "const", value: 0 } });
22443
23530
  scope.set(expr.name, t);
@@ -22556,6 +23643,27 @@ var require_lower2 = __commonJS({
22556
23643
  const value = variants?.get(expr.variant) ?? 0;
22557
23644
  return { kind: "const", value };
22558
23645
  }
23646
+ case "enum_construct": {
23647
+ const variants = ctx.enumDefs.get(expr.enumName);
23648
+ const tagValue = variants?.get(expr.variant) ?? 0;
23649
+ const tagTemp = ctx.freshTemp();
23650
+ ctx.emit({ kind: "const", dst: tagTemp, value: tagValue });
23651
+ const payloadFields = ctx.enumPayloads.get(expr.enumName)?.get(expr.variant) ?? [];
23652
+ for (const arg of expr.args) {
23653
+ const fieldDef = payloadFields.find((f) => f.name === arg.name);
23654
+ const argOp = lowerExpr(arg.value, ctx, scope);
23655
+ const nbtType = fieldDef && fieldDef.type.kind === "named" && (fieldDef.type.name === "float" || fieldDef.type.name === "fixed") ? "float" : "int";
23656
+ ctx.emit({
23657
+ kind: "nbt_write",
23658
+ ns: "rs:enums",
23659
+ path: `${expr.enumName}_${arg.name}`,
23660
+ type: nbtType,
23661
+ scale: 1,
23662
+ src: argOp
23663
+ });
23664
+ }
23665
+ return { kind: "temp", name: tagTemp };
23666
+ }
22559
23667
  case "member": {
22560
23668
  if (expr.obj.kind === "ident") {
22561
23669
  const enumVariants = ctx.enumDefs.get(expr.obj.name);
@@ -22571,6 +23679,15 @@ var require_lower2 = __commonJS({
22571
23679
  return { kind: "temp", name: fieldTemp };
22572
23680
  }
22573
23681
  }
23682
+ if (expr.obj.kind === "member" && expr.obj.obj.kind === "ident") {
23683
+ const syntheticName = `${expr.obj.obj.name}.${expr.obj.field}`;
23684
+ const nestedSv = ctx.structVars.get(syntheticName);
23685
+ if (nestedSv) {
23686
+ const fieldTemp = nestedSv.fields.get(expr.field);
23687
+ if (fieldTemp)
23688
+ return { kind: "temp", name: fieldTemp };
23689
+ }
23690
+ }
22574
23691
  const obj = lowerExpr(expr.obj, ctx, scope);
22575
23692
  const t = ctx.freshTemp();
22576
23693
  ctx.emit({ kind: "copy", dst: t, src: obj });
@@ -22613,15 +23730,35 @@ var require_lower2 = __commonJS({
22613
23730
  return valOp;
22614
23731
  }
22615
23732
  case "call": {
23733
+ if (expr.fn === "len" && expr.args.length === 1 && expr.args[0].kind === "ident") {
23734
+ const arrName = expr.args[0].name;
23735
+ const arrInfo = ctx.arrayVars.get(arrName);
23736
+ if (arrInfo) {
23737
+ if (arrInfo.knownLen !== void 0) {
23738
+ const t3 = ctx.freshTemp();
23739
+ ctx.emit({ kind: "const", dst: t3, value: arrInfo.knownLen });
23740
+ return { kind: "temp", name: t3 };
23741
+ }
23742
+ const t2 = ctx.freshTemp();
23743
+ ctx.emit({ kind: "nbt_list_len", dst: t2, ns: arrInfo.ns, path: arrInfo.pathPrefix });
23744
+ return { kind: "temp", name: t2 };
23745
+ }
23746
+ const lenTemp = scope.get(arrName);
23747
+ if (lenTemp !== void 0) {
23748
+ return { kind: "temp", name: lenTemp };
23749
+ }
23750
+ }
22616
23751
  if (expr.fn === "scoreboard_get" || expr.fn === "score") {
22617
- const player = hirExprToStringLiteral(expr.args[0]);
23752
+ const playerArg = exprToCommandArg(expr.args[0], ctx.currentMacroParams);
23753
+ const player = !playerArg.isMacro && expr.args[0].kind === "ident" ? "@s" : playerArg.str || "@s";
22618
23754
  const obj = hirExprToStringLiteral(expr.args[1]);
22619
23755
  const t2 = ctx.freshTemp();
22620
23756
  ctx.emit({ kind: "score_read", dst: t2, player, obj });
22621
23757
  return { kind: "temp", name: t2 };
22622
23758
  }
22623
23759
  if (expr.fn === "scoreboard_set") {
22624
- const player = hirExprToStringLiteral(expr.args[0]);
23760
+ const playerArg = exprToCommandArg(expr.args[0], ctx.currentMacroParams);
23761
+ const player = !playerArg.isMacro && expr.args[0].kind === "ident" ? "@s" : playerArg.str || "@s";
22625
23762
  const obj = hirExprToStringLiteral(expr.args[1]);
22626
23763
  const src = lowerExpr(expr.args[2], ctx, scope);
22627
23764
  ctx.emit({ kind: "score_write", player, obj, src });
@@ -22629,6 +23766,82 @@ var require_lower2 = __commonJS({
22629
23766
  ctx.emit({ kind: "const", dst: t2, value: 0 });
22630
23767
  return { kind: "temp", name: t2 };
22631
23768
  }
23769
+ if (expr.fn === "storage_set_array" && expr.args.length >= 3) {
23770
+ const storagePath = hirExprToStringLiteral(expr.args[0]);
23771
+ const fieldName = hirExprToStringLiteral(expr.args[1]);
23772
+ const nbtLiteral = hirExprToStringLiteral(expr.args[2]);
23773
+ ctx.emit({ kind: "call", dst: null, fn: `__raw:data modify storage ${storagePath} ${fieldName} set value ${nbtLiteral}`, args: [] });
23774
+ const t2 = ctx.freshTemp();
23775
+ ctx.emit({ kind: "const", dst: t2, value: 0 });
23776
+ return { kind: "temp", name: t2 };
23777
+ }
23778
+ if (expr.fn === "storage_get_int" && expr.args.length >= 3) {
23779
+ const storagePath = hirExprToStringLiteral(expr.args[0]);
23780
+ const fieldName = hirExprToStringLiteral(expr.args[1]);
23781
+ const indexOp = lowerExpr(expr.args[2], ctx, scope);
23782
+ const t2 = ctx.freshTemp();
23783
+ if (indexOp.kind === "const") {
23784
+ ctx.emit({ kind: "nbt_read", dst: t2, ns: storagePath, path: `${fieldName}[${indexOp.value}]`, scale: 1 });
23785
+ } else {
23786
+ ctx.emit({ kind: "nbt_read_dynamic", dst: t2, ns: storagePath, pathPrefix: fieldName, indexSrc: indexOp });
23787
+ }
23788
+ return { kind: "temp", name: t2 };
23789
+ }
23790
+ if (expr.fn === "__entity_tag" || expr.fn === "__entity_untag") {
23791
+ const selArg = expr.args[0];
23792
+ const tagArg = expr.args[1];
23793
+ const tagStr = tagArg.kind === "str_lit" ? tagArg.value : "unknown";
23794
+ const selStr = selArg.kind === "selector" ? selectorToString(selArg.sel ?? selArg) : "@s";
23795
+ const op = expr.fn === "__entity_tag" ? "add" : "remove";
23796
+ const t2 = ctx.freshTemp();
23797
+ ctx.emit({ kind: "call", dst: null, fn: `__raw:tag ${selStr} ${op} ${tagStr}`, args: [] });
23798
+ ctx.emit({ kind: "const", dst: t2, value: 0 });
23799
+ return { kind: "temp", name: t2 };
23800
+ }
23801
+ if (expr.fn === "__entity_has_tag") {
23802
+ const tagArg = expr.args[1];
23803
+ const tagStr = tagArg.kind === "str_lit" ? tagArg.value : "unknown";
23804
+ const selArg = expr.args[0];
23805
+ const selStr = selArg.kind === "selector" ? selectorToString(selArg.sel ?? selArg) : "@s";
23806
+ const t2 = ctx.freshTemp();
23807
+ const ns = ctx.getNamespace();
23808
+ ctx.emit({ kind: "call", dst: t2, fn: `__raw:execute store success score $ret __${ns} if entity ${selStr}[tag=${tagStr}]`, args: [] });
23809
+ return { kind: "temp", name: t2 };
23810
+ }
23811
+ if (expr.fn === "__array_push") {
23812
+ if (expr.args[0].kind === "ident") {
23813
+ const arrInfo = ctx.arrayVars.get(expr.args[0].name);
23814
+ if (arrInfo) {
23815
+ const valOp = lowerExpr(expr.args[1], ctx, scope);
23816
+ ctx.emit({ kind: "call", dst: null, fn: `__raw:data modify storage ${arrInfo.ns} ${arrInfo.pathPrefix} append value 0`, args: [] });
23817
+ ctx.emit({ kind: "nbt_write", ns: arrInfo.ns, path: `${arrInfo.pathPrefix}[-1]`, type: "int", scale: 1, src: valOp });
23818
+ const t2 = ctx.freshTemp();
23819
+ ctx.emit({ kind: "const", dst: t2, value: 0 });
23820
+ return { kind: "temp", name: t2 };
23821
+ }
23822
+ }
23823
+ }
23824
+ if (expr.fn === "__array_pop") {
23825
+ if (expr.args[0].kind === "ident") {
23826
+ const arrInfo = ctx.arrayVars.get(expr.args[0].name);
23827
+ if (arrInfo) {
23828
+ ctx.emit({ kind: "call", dst: null, fn: `__raw:data remove storage ${arrInfo.ns} ${arrInfo.pathPrefix}[-1]`, args: [] });
23829
+ const t2 = ctx.freshTemp();
23830
+ ctx.emit({ kind: "const", dst: t2, value: 0 });
23831
+ return { kind: "temp", name: t2 };
23832
+ }
23833
+ }
23834
+ }
23835
+ if (expr.fn === "__array_length") {
23836
+ if (expr.args[0].kind === "ident") {
23837
+ const arrInfo = ctx.arrayVars.get(expr.args[0].name);
23838
+ if (arrInfo) {
23839
+ const t2 = ctx.freshTemp();
23840
+ ctx.emit({ kind: "nbt_read", dst: t2, ns: arrInfo.ns, path: `${arrInfo.pathPrefix}`, scale: 1 });
23841
+ return { kind: "temp", name: t2 };
23842
+ }
23843
+ }
23844
+ }
22632
23845
  if (expr.fn === "list_push") {
22633
23846
  if (expr.args[0].kind === "ident") {
22634
23847
  const arrInfo = ctx.arrayVars.get(expr.args[0].name);
@@ -22711,13 +23924,37 @@ var require_lower2 = __commonJS({
22711
23924
  ctx.emit({ kind: "const", dst: t2, value: 0 });
22712
23925
  return { kind: "temp", name: t2 };
22713
23926
  }
23927
+ if (expr.fn === "int_to_str" || expr.fn === "bool_to_str") {
23928
+ if (expr.args.length === 1) {
23929
+ return lowerExpr(expr.args[0], ctx, scope);
23930
+ }
23931
+ const t2 = ctx.freshTemp();
23932
+ ctx.emit({ kind: "const", dst: t2, value: 0 });
23933
+ return { kind: "temp", name: t2 };
23934
+ }
22714
23935
  if (macro_1.BUILTIN_SET.has(expr.fn)) {
22715
- const cmd = formatBuiltinCall(expr.fn, expr.args, ctx.currentMacroParams);
23936
+ const TEXT_BUILTINS_SET = /* @__PURE__ */ new Set(["tell", "tellraw", "title", "subtitle", "actionbar", "announce"]);
23937
+ let resolvedArgs = expr.args;
23938
+ if (TEXT_BUILTINS_SET.has(expr.fn)) {
23939
+ resolvedArgs = expr.args.map((arg) => arg.kind === "f_string" ? precomputeFStringParts(arg, ctx, scope) : arg);
23940
+ }
23941
+ const cmd = formatBuiltinCall(expr.fn, resolvedArgs, ctx.currentMacroParams, ctx.getNamespace());
22716
23942
  ctx.emit({ kind: "call", dst: null, fn: `__raw:${cmd}`, args: [] });
22717
23943
  const t2 = ctx.freshTemp();
22718
23944
  ctx.emit({ kind: "const", dst: t2, value: 0 });
22719
23945
  return { kind: "temp", name: t2 };
22720
23946
  }
23947
+ const PARSER_METHOD_REMAP = {
23948
+ "set_add": "add",
23949
+ "set_contains": "contains",
23950
+ "set_remove": "remove",
23951
+ "set_clear": "clear",
23952
+ "__array_push": "push",
23953
+ "__array_pop": "pop",
23954
+ "__entity_tag": "tag",
23955
+ "__entity_untag": "untag",
23956
+ "__entity_has_tag": "has_tag"
23957
+ };
22721
23958
  if (expr.args.length > 0 && expr.args[0].kind === "ident") {
22722
23959
  const sv = ctx.structVars.get(expr.args[0].name);
22723
23960
  if (sv) {
@@ -22728,17 +23965,32 @@ var require_lower2 = __commonJS({
22728
23965
  return lowerTimerMethod(expr.fn, timerId, sv, ctx, scope, expr.args.slice(1));
22729
23966
  }
22730
23967
  }
22731
- const methodInfo = ctx.implMethods.get(sv.typeName)?.get(expr.fn);
23968
+ const originalMethodName = PARSER_METHOD_REMAP[expr.fn] ?? expr.fn;
23969
+ const methodInfo = ctx.implMethods.get(sv.typeName)?.get(expr.fn) ?? ctx.implMethods.get(sv.typeName)?.get(originalMethodName);
22732
23970
  if (methodInfo?.hasSelf) {
22733
23971
  const fields = ctx.structDefs.get(sv.typeName) ?? [];
22734
23972
  const selfArgs = fields.map((f) => {
22735
23973
  const temp = sv.fields.get(f);
22736
23974
  return temp ? { kind: "temp", name: temp } : { kind: "const", value: 0 };
22737
23975
  });
22738
- const explicitArgs = expr.args.slice(1).map((a) => lowerExpr(a, ctx, scope));
23976
+ const explicitArgs = [];
23977
+ for (const argExpr of expr.args.slice(1)) {
23978
+ if (argExpr.kind === "ident") {
23979
+ const argSv = ctx.structVars.get(argExpr.name);
23980
+ if (argSv) {
23981
+ const argFields = ctx.structDefs.get(argSv.typeName) ?? [];
23982
+ for (const fieldName of argFields) {
23983
+ const ft = argSv.fields.get(fieldName);
23984
+ explicitArgs.push(ft ? { kind: "temp", name: ft } : { kind: "const", value: 0 });
23985
+ }
23986
+ continue;
23987
+ }
23988
+ }
23989
+ explicitArgs.push(lowerExpr(argExpr, ctx, scope));
23990
+ }
22739
23991
  const allArgs = [...selfArgs, ...explicitArgs];
22740
23992
  const t2 = ctx.freshTemp();
22741
- ctx.emit({ kind: "call", dst: t2, fn: `${sv.typeName}::${expr.fn}`, args: allArgs });
23993
+ ctx.emit({ kind: "call", dst: t2, fn: `${sv.typeName}::${originalMethodName}`, args: allArgs });
22742
23994
  return { kind: "temp", name: t2 };
22743
23995
  }
22744
23996
  }
@@ -22784,7 +24036,7 @@ var require_lower2 = __commonJS({
22784
24036
  const specializedName = `${expr.fn}__arr_${bindingKey}`;
22785
24037
  if (!ctx.specializedFnsRegistry.has(specializedName)) {
22786
24038
  ctx.specializedFnsRegistry.set(specializedName, []);
22787
- const { fn: specFn, helpers: specHelpers } = lowerFunction(targetHirFn, ctx.getNamespace(), ctx.structDefs, ctx.implMethods, ctx.macroInfo, ctx.fnParamInfo, ctx.enumDefs, ctx.sourceFile, ctx.timerCounter, arrayArgBindings, ctx.hirFunctions, ctx.specializedFnsRegistry, specializedName);
24039
+ const { fn: specFn, helpers: specHelpers } = lowerFunction(targetHirFn, ctx.getNamespace(), ctx.structDefs, ctx.implMethods, ctx.macroInfo, ctx.fnParamInfo, ctx.enumDefs, ctx.sourceFile, ctx.timerCounter, arrayArgBindings, ctx.hirFunctions, ctx.specializedFnsRegistry, specializedName, ctx.enumPayloads);
22788
24040
  ctx.specializedFnsRegistry.set(specializedName, [specFn, ...specHelpers]);
22789
24041
  }
22790
24042
  const nonArrayArgs = [];
@@ -22803,6 +24055,34 @@ var require_lower2 = __commonJS({
22803
24055
  {
22804
24056
  const targetParams = ctx.fnParamInfo.get(expr.fn);
22805
24057
  if (targetParams) {
24058
+ const hasStringParam = targetParams.some((p) => p.type.kind === "named" && (p.type.name === "string" || p.type.name === "format_string"));
24059
+ if (hasStringParam) {
24060
+ const nonStringArgs = [];
24061
+ let stringSlot = 0;
24062
+ for (let i = 0; i < targetParams.length && i < expr.args.length; i++) {
24063
+ const p = targetParams[i];
24064
+ if (p.type.kind === "named" && (p.type.name === "string" || p.type.name === "format_string")) {
24065
+ const srcPath = lowerStringExprToPath(expr.args[i], ctx, scope, `arg${stringSlot}`);
24066
+ if (srcPath) {
24067
+ ctx.emit({
24068
+ kind: "call",
24069
+ dst: null,
24070
+ fn: `__raw:data modify storage rs:strings __sp${stringSlot} set from storage rs:strings ${srcPath}`,
24071
+ args: []
24072
+ });
24073
+ }
24074
+ stringSlot++;
24075
+ } else {
24076
+ nonStringArgs.push(lowerExpr(expr.args[i], ctx, scope));
24077
+ }
24078
+ }
24079
+ for (let i = targetParams.length; i < expr.args.length; i++) {
24080
+ nonStringArgs.push(lowerExpr(expr.args[i], ctx, scope));
24081
+ }
24082
+ const t2 = ctx.freshTemp();
24083
+ ctx.emit({ kind: "call", dst: t2, fn: expr.fn, args: nonStringArgs });
24084
+ return { kind: "temp", name: t2 };
24085
+ }
22806
24086
  const hasDoubleParam = targetParams.some((p) => p.type.kind === "named" && p.type.name === "double");
22807
24087
  if (hasDoubleParam) {
22808
24088
  const ns = ctx.getNamespace();
@@ -22841,6 +24121,23 @@ var require_lower2 = __commonJS({
22841
24121
  return { kind: "temp", name: t };
22842
24122
  }
22843
24123
  case "invoke": {
24124
+ if (expr.callee.kind === "member" && expr.callee.field === "len" && expr.callee.obj.kind === "ident") {
24125
+ const arrInfo = ctx.arrayVars.get(expr.callee.obj.name);
24126
+ if (arrInfo) {
24127
+ if (arrInfo.knownLen !== void 0) {
24128
+ const t3 = ctx.freshTemp();
24129
+ ctx.emit({ kind: "const", dst: t3, value: arrInfo.knownLen });
24130
+ return { kind: "temp", name: t3 };
24131
+ }
24132
+ const t2 = ctx.freshTemp();
24133
+ ctx.emit({ kind: "nbt_list_len", dst: t2, ns: arrInfo.ns, path: arrInfo.pathPrefix });
24134
+ return { kind: "temp", name: t2 };
24135
+ }
24136
+ const lenTemp = scope.get(expr.callee.obj.name);
24137
+ if (lenTemp !== void 0) {
24138
+ return { kind: "temp", name: lenTemp };
24139
+ }
24140
+ }
22844
24141
  if (expr.callee.kind === "member" && expr.callee.obj.kind === "ident") {
22845
24142
  const sv = ctx.structVars.get(expr.callee.obj.name);
22846
24143
  if (sv) {
@@ -22866,6 +24163,31 @@ var require_lower2 = __commonJS({
22866
24163
  }
22867
24164
  }
22868
24165
  }
24166
+ if (expr.callee.kind === "member" && expr.callee.obj.kind !== "ident") {
24167
+ const returnedStructType = inferInvokeReturnStructType(expr.callee.obj, ctx);
24168
+ if (returnedStructType) {
24169
+ lowerExpr(expr.callee.obj, ctx, scope);
24170
+ const chainFields = ctx.structDefs.get(returnedStructType) ?? [];
24171
+ const chainFieldTemps = /* @__PURE__ */ new Map();
24172
+ for (const fieldName of chainFields) {
24173
+ const ft = ctx.freshTemp();
24174
+ ctx.emit({ kind: "copy", dst: ft, src: { kind: "temp", name: `__rf_${fieldName}` } });
24175
+ chainFieldTemps.set(fieldName, ft);
24176
+ }
24177
+ const methodInfo = ctx.implMethods.get(returnedStructType)?.get(expr.callee.field);
24178
+ if (methodInfo?.hasSelf) {
24179
+ const selfArgs = chainFields.map((f) => {
24180
+ const temp = chainFieldTemps.get(f);
24181
+ return temp ? { kind: "temp", name: temp } : { kind: "const", value: 0 };
24182
+ });
24183
+ const explicitArgs = expr.args.map((a) => lowerExpr(a, ctx, scope));
24184
+ const allArgs = [...selfArgs, ...explicitArgs];
24185
+ const ct = ctx.freshTemp();
24186
+ ctx.emit({ kind: "call", dst: ct, fn: `${returnedStructType}::${expr.callee.field}`, args: allArgs });
24187
+ return { kind: "temp", name: ct };
24188
+ }
24189
+ }
24190
+ }
22869
24191
  const calleeOp = lowerExpr(expr.callee, ctx, scope);
22870
24192
  const args = expr.args.map((a) => lowerExpr(a, ctx, scope));
22871
24193
  const t = ctx.freshTemp();
@@ -22887,6 +24209,25 @@ var require_lower2 = __commonJS({
22887
24209
  ctx.emit({ kind: "const", dst: t2, value: 0 });
22888
24210
  return { kind: "temp", name: t2 };
22889
24211
  }
24212
+ if (ctx.singletonStructs.has(expr.type)) {
24213
+ if (expr.method === "get") {
24214
+ const t2 = ctx.freshTemp();
24215
+ ctx.emit({ kind: "call", dst: t2, fn: `${expr.type}::${expr.method}`, args: [] });
24216
+ return { kind: "temp", name: t2 };
24217
+ } else if (expr.method === "set" && expr.args.length === 1 && expr.args[0].kind === "ident") {
24218
+ const sv = ctx.structVars.get(expr.args[0].name);
24219
+ if (sv) {
24220
+ const fields = ctx.structDefs.get(sv.typeName) ?? [];
24221
+ const fieldArgs = fields.map((f) => {
24222
+ const temp = sv.fields.get(f);
24223
+ return temp ? { kind: "temp", name: temp } : { kind: "const", value: 0 };
24224
+ });
24225
+ const t2 = ctx.freshTemp();
24226
+ ctx.emit({ kind: "call", dst: t2, fn: `${expr.type}::${expr.method}`, args: fieldArgs });
24227
+ return { kind: "temp", name: t2 };
24228
+ }
24229
+ }
24230
+ }
22890
24231
  const args = expr.args.map((a) => lowerExpr(a, ctx, scope));
22891
24232
  const t = ctx.freshTemp();
22892
24233
  ctx.emit({ kind: "call", dst: t, fn: `${expr.type}::${expr.method}`, args });
@@ -22916,6 +24257,41 @@ var require_lower2 = __commonJS({
22916
24257
  ctx.emit({ kind: "const", dst: t, value: 0 });
22917
24258
  return { kind: "temp", name: t };
22918
24259
  }
24260
+ case "unwrap_or": {
24261
+ const resultTemp = ctx.freshTemp();
24262
+ const defaultOp = lowerExpr(expr.default_, ctx, scope);
24263
+ ctx.emit({ kind: "copy", dst: resultTemp, src: defaultOp });
24264
+ const sv = (() => {
24265
+ if (expr.opt.kind === "ident")
24266
+ return ctx.structVars.get(expr.opt.name);
24267
+ return void 0;
24268
+ })();
24269
+ let hasOp;
24270
+ let valTemp;
24271
+ if (sv && sv.typeName === "__option") {
24272
+ const hasT = sv.fields.get("has");
24273
+ const valT = sv.fields.get("val");
24274
+ hasOp = { kind: "temp", name: hasT };
24275
+ valTemp = valT;
24276
+ } else {
24277
+ lowerExpr(expr.opt, ctx, scope);
24278
+ const hasT = ctx.freshTemp();
24279
+ const valT = ctx.freshTemp();
24280
+ ctx.emit({ kind: "copy", dst: hasT, src: { kind: "temp", name: "__rf_has" } });
24281
+ ctx.emit({ kind: "copy", dst: valT, src: { kind: "temp", name: "__rf_val" } });
24282
+ hasOp = { kind: "temp", name: hasT };
24283
+ valTemp = valT;
24284
+ }
24285
+ const someBlock = ctx.newBlock("unwrap_some");
24286
+ const mergeBlock = ctx.newBlock("unwrap_merge");
24287
+ ctx.terminate({ kind: "branch", cond: hasOp, then: someBlock.id, else: mergeBlock.id });
24288
+ ctx.switchTo(someBlock);
24289
+ if (valTemp)
24290
+ ctx.emit({ kind: "copy", dst: resultTemp, src: { kind: "temp", name: valTemp } });
24291
+ ctx.terminate({ kind: "jump", target: mergeBlock.id });
24292
+ ctx.switchTo(mergeBlock);
24293
+ return { kind: "temp", name: resultTemp };
24294
+ }
22919
24295
  case "type_cast": {
22920
24296
  const ns = ctx.getNamespace();
22921
24297
  const targetName = expr.targetType.kind === "named" ? expr.targetType.name : null;
@@ -23017,6 +24393,23 @@ var require_lower2 = __commonJS({
23017
24393
  ctx.switchTo(merge);
23018
24394
  return { kind: "temp", name: result };
23019
24395
  }
24396
+ function inferInvokeReturnStructType(expr, ctx) {
24397
+ if (expr.kind === "invoke" && expr.callee.kind === "member") {
24398
+ let receiverTypeName;
24399
+ if (expr.callee.obj.kind === "ident") {
24400
+ receiverTypeName = ctx.structVars.get(expr.callee.obj.name)?.typeName;
24401
+ } else {
24402
+ receiverTypeName = inferInvokeReturnStructType(expr.callee.obj, ctx);
24403
+ }
24404
+ if (receiverTypeName) {
24405
+ const methodInfo = ctx.implMethods.get(receiverTypeName)?.get(expr.callee.field);
24406
+ if (methodInfo?.returnStructName) {
24407
+ return methodInfo.returnStructName;
24408
+ }
24409
+ }
24410
+ }
24411
+ return void 0;
24412
+ }
23020
24413
  function lowerTimerMethod(method, timerId, sv, ctx, scope, extraArgs) {
23021
24414
  const ns = ctx.getNamespace();
23022
24415
  const player = `__timer_${timerId}`;
@@ -23136,6 +24529,39 @@ var require_lower2 = __commonJS({
23136
24529
  }
23137
24530
  }
23138
24531
  }
24532
+ function lowerStringExprToPath(expr, ctx, scope, hint = "str") {
24533
+ switch (expr.kind) {
24534
+ case "str_lit": {
24535
+ const path3 = ctx.freshStringVar(hint);
24536
+ ctx.emit({
24537
+ kind: "call",
24538
+ dst: null,
24539
+ fn: `__raw:data modify storage rs:strings ${path3} set value ${JSON.stringify(expr.value)}`,
24540
+ args: []
24541
+ });
24542
+ return path3;
24543
+ }
24544
+ case "ident":
24545
+ return ctx.stringVars.get(expr.name) ?? null;
24546
+ case "assign": {
24547
+ if (!ctx.stringVars.has(expr.target))
24548
+ return null;
24549
+ const dstPath = ctx.stringVars.get(expr.target);
24550
+ const srcPath = lowerStringExprToPath(expr.value, ctx, scope, expr.target);
24551
+ if (!srcPath || srcPath === dstPath)
24552
+ return dstPath;
24553
+ ctx.emit({
24554
+ kind: "call",
24555
+ dst: null,
24556
+ fn: `__raw:data modify storage rs:strings ${dstPath} set from storage rs:strings ${srcPath}`,
24557
+ args: []
24558
+ });
24559
+ return dstPath;
24560
+ }
24561
+ default:
24562
+ return null;
24563
+ }
24564
+ }
23139
24565
  function selectorToString(sel) {
23140
24566
  if (!sel.filters || Object.keys(sel.filters).length === 0) {
23141
24567
  return sel.kind;
@@ -23158,7 +24584,82 @@ var require_lower2 = __commonJS({
23158
24584
  return `${sel.kind}[${parts.join(",")}]`;
23159
24585
  }
23160
24586
  var MACRO_SENTINEL = "";
23161
- function formatBuiltinCall(fn, args, macroParams) {
24587
+ function precomputeFStringParts(expr, ctx, scope) {
24588
+ if (expr.kind !== "f_string")
24589
+ return expr;
24590
+ const newParts = [];
24591
+ for (const part of expr.parts) {
24592
+ if (part.kind === "text") {
24593
+ newParts.push(part);
24594
+ continue;
24595
+ }
24596
+ const inner = part.expr;
24597
+ if (inner.kind === "ident" || inner.kind === "int_lit" || inner.kind === "bool_lit") {
24598
+ newParts.push({ kind: "expr", expr: inner });
24599
+ continue;
24600
+ }
24601
+ if (inner.kind === "call" && (inner.fn === "int_to_str" || inner.fn === "bool_to_str") && inner.args.length === 1) {
24602
+ const arg = inner.args[0];
24603
+ if (arg.kind === "ident") {
24604
+ newParts.push({ kind: "expr", expr: arg });
24605
+ continue;
24606
+ }
24607
+ const argOp = lowerExpr(arg, ctx, scope);
24608
+ if (argOp.kind === "temp") {
24609
+ newParts.push({ kind: "expr", expr: { kind: "ident", name: argOp.name } });
24610
+ } else if (argOp.kind === "const") {
24611
+ newParts.push({ kind: "expr", expr: { kind: "int_lit", value: argOp.value } });
24612
+ } else {
24613
+ newParts.push(part);
24614
+ }
24615
+ continue;
24616
+ }
24617
+ const tempOp = lowerExpr(inner, ctx, scope);
24618
+ if (tempOp.kind === "temp") {
24619
+ newParts.push({ kind: "expr", expr: { kind: "ident", name: tempOp.name } });
24620
+ } else if (tempOp.kind === "const") {
24621
+ newParts.push({ kind: "expr", expr: { kind: "int_lit", value: tempOp.value } });
24622
+ } else {
24623
+ newParts.push(part);
24624
+ }
24625
+ }
24626
+ return { kind: "f_string", parts: newParts };
24627
+ }
24628
+ function fStringToJsonText(expr, namespace) {
24629
+ if (expr.kind !== "f_string")
24630
+ return JSON.stringify(expr.kind === "str_lit" ? { text: expr.value } : { text: "~" });
24631
+ const objective = `__${namespace}`;
24632
+ const extra = [];
24633
+ for (const part of expr.parts) {
24634
+ if (part.kind === "text") {
24635
+ if (part.value)
24636
+ extra.push({ text: part.value });
24637
+ } else {
24638
+ const inner = part.expr;
24639
+ if (inner.kind === "ident") {
24640
+ extra.push({ score: { name: `$${inner.name}`, objective } });
24641
+ } else if (inner.kind === "int_lit") {
24642
+ extra.push({ text: String(inner.value) });
24643
+ } else if (inner.kind === "bool_lit") {
24644
+ extra.push({ text: inner.value ? "true" : "false" });
24645
+ } else {
24646
+ extra.push({ text: "?" });
24647
+ }
24648
+ }
24649
+ }
24650
+ if (extra.length === 0)
24651
+ return '{"text":""}';
24652
+ if (extra.length === 1)
24653
+ return JSON.stringify(extra[0]);
24654
+ return JSON.stringify({ text: "", extra });
24655
+ }
24656
+ function formatBuiltinCall(fn, args, macroParams, namespace = "") {
24657
+ const TEXT_BUILTINS = /* @__PURE__ */ new Set(["tell", "tellraw", "title", "subtitle", "actionbar", "announce"]);
24658
+ const resolveTextArg = (arg) => {
24659
+ if (arg.kind === "f_string")
24660
+ return fStringToJsonText(arg, namespace);
24661
+ return JSON.stringify({ text: exprToCommandArg(arg, macroParams).str });
24662
+ };
23162
24663
  const fmtArgs = args.map((a) => exprToCommandArg(a, macroParams));
23163
24664
  const strs = fmtArgs.map((a) => a.str);
23164
24665
  const hasMacro = fmtArgs.some((a) => a.isMacro);
@@ -23212,24 +24713,34 @@ var require_lower2 = __commonJS({
23212
24713
  cmd = `say ${strs[0] ?? ""}`;
23213
24714
  break;
23214
24715
  case "tell":
23215
- case "tellraw":
23216
- cmd = `tellraw ${strs[0]} {"text":"${strs[1]}"}`;
24716
+ case "tellraw": {
24717
+ const msgJson = resolveTextArg(args[1]);
24718
+ cmd = `tellraw ${strs[0]} ${msgJson}`;
23217
24719
  break;
23218
- case "title":
23219
- cmd = `title ${strs[0]} title {"text":"${strs[1]}"}`;
24720
+ }
24721
+ case "title": {
24722
+ const msgJson = resolveTextArg(args[1]);
24723
+ cmd = `title ${strs[0]} title ${msgJson}`;
23220
24724
  break;
23221
- case "actionbar":
23222
- cmd = `title ${strs[0]} actionbar {"text":"${strs[1]}"}`;
24725
+ }
24726
+ case "actionbar": {
24727
+ const msgJson = resolveTextArg(args[1]);
24728
+ cmd = `title ${strs[0]} actionbar ${msgJson}`;
23223
24729
  break;
23224
- case "subtitle":
23225
- cmd = `title ${strs[0]} subtitle {"text":"${strs[1]}"}`;
24730
+ }
24731
+ case "subtitle": {
24732
+ const msgJson = resolveTextArg(args[1]);
24733
+ cmd = `title ${strs[0]} subtitle ${msgJson}`;
23226
24734
  break;
24735
+ }
23227
24736
  case "title_times":
23228
24737
  cmd = `title ${strs[0]} times ${strs[1]} ${strs[2]} ${strs[3]}`;
23229
24738
  break;
23230
- case "announce":
23231
- cmd = `tellraw @a {"text":"${strs[0]}"}`;
24739
+ case "announce": {
24740
+ const msgJson = resolveTextArg(args[0]);
24741
+ cmd = `tellraw @a ${msgJson}`;
23232
24742
  break;
24743
+ }
23233
24744
  case "give": {
23234
24745
  const nbt = strs[3] ? strs[3] : "";
23235
24746
  cmd = `give ${strs[0]} ${strs[1]}${nbt} ${strs[2] ?? "1"}`;
@@ -23268,6 +24779,13 @@ var require_lower2 = __commonJS({
23268
24779
  case "tag_remove":
23269
24780
  cmd = `tag ${strs[0]} remove ${strs[1]}`;
23270
24781
  break;
24782
+ // entity.tag(name) / entity.untag(name) sugar — same as tag_add/tag_remove
24783
+ case "__entity_tag":
24784
+ cmd = `tag ${strs[0]} add ${strs[1]}`;
24785
+ break;
24786
+ case "__entity_untag":
24787
+ cmd = `tag ${strs[0]} remove ${strs[1]}`;
24788
+ break;
23271
24789
  case "kick":
23272
24790
  cmd = `kick ${strs[0]} ${strs[1] ?? ""}`.trim();
23273
24791
  break;
@@ -24266,6 +25784,10 @@ var require_interprocedural = __commonJS({
24266
25784
  return { ...instr, a: substituteOp(instr.a, sub), b: substituteOp(instr.b, sub) };
24267
25785
  case "nbt_write":
24268
25786
  return { ...instr, src: substituteOp(instr.src, sub) };
25787
+ case "nbt_read_dynamic":
25788
+ return { ...instr, indexSrc: substituteOp(instr.indexSrc, sub) };
25789
+ case "nbt_write_dynamic":
25790
+ return { ...instr, indexSrc: substituteOp(instr.indexSrc, sub), valueSrc: substituteOp(instr.valueSrc, sub) };
24269
25791
  case "call":
24270
25792
  return { ...instr, args: instr.args.map((a) => substituteOp(a, sub)) };
24271
25793
  case "call_macro":
@@ -24315,6 +25837,219 @@ var require_interprocedural = __commonJS({
24315
25837
  }
24316
25838
  });
24317
25839
 
25840
+ // ../../dist/src/optimizer/inline.js
25841
+ var require_inline = __commonJS({
25842
+ "../../dist/src/optimizer/inline.js"(exports2) {
25843
+ "use strict";
25844
+ Object.defineProperty(exports2, "__esModule", { value: true });
25845
+ exports2.inlinePass = inlinePass;
25846
+ var _inlineCounter = 0;
25847
+ function freshInlineId() {
25848
+ return `__inline_${_inlineCounter++}`;
25849
+ }
25850
+ function inlinePass(mod) {
25851
+ const inlineSet = mod.inlineFunctions;
25852
+ if (!inlineSet || inlineSet.size === 0)
25853
+ return mod;
25854
+ const fnMap = new Map(mod.functions.map((f) => [f.name, f]));
25855
+ const updatedFunctions = mod.functions.map((fn) => inlineCallsInFunction(fn, fnMap, inlineSet));
25856
+ return { ...mod, functions: updatedFunctions };
25857
+ }
25858
+ function inlineCallsInFunction(fn, fnMap, inlineSet) {
25859
+ let blocks = fn.blocks.map((b) => ({ ...b, instrs: [...b.instrs] }));
25860
+ let changed = true;
25861
+ while (changed) {
25862
+ changed = false;
25863
+ const nextBlocks = [];
25864
+ for (const block of blocks) {
25865
+ const callIdx = block.instrs.findIndex((instr) => {
25866
+ if (instr.kind !== "call")
25867
+ return false;
25868
+ if (!inlineSet.has(instr.fn))
25869
+ return false;
25870
+ const callee2 = fnMap.get(instr.fn);
25871
+ if (!callee2)
25872
+ return false;
25873
+ if (callee2.isMacro)
25874
+ return false;
25875
+ if (callee2.name === fn.name)
25876
+ return false;
25877
+ if (isSelfRecursive(callee2))
25878
+ return false;
25879
+ if (callee2.params.length !== instr.args.length)
25880
+ return false;
25881
+ return true;
25882
+ });
25883
+ if (callIdx === -1) {
25884
+ nextBlocks.push(block);
25885
+ continue;
25886
+ }
25887
+ changed = true;
25888
+ const callInstr = block.instrs[callIdx];
25889
+ const callee = fnMap.get(callInstr.fn);
25890
+ const inlineId = freshInlineId();
25891
+ const priorInstrs = block.instrs.slice(0, callIdx);
25892
+ const afterInstrs = block.instrs.slice(callIdx + 1);
25893
+ const contBlockId = `${block.id}${inlineId}_cont`;
25894
+ const clonedBlocks = cloneCallee(callee, inlineId, callInstr.args, callInstr.dst, contBlockId);
25895
+ const clonedEntryId = `${callee.entry}${inlineId}`;
25896
+ const patchedCurrentBlock = {
25897
+ ...block,
25898
+ instrs: priorInstrs,
25899
+ term: { kind: "jump", target: clonedEntryId }
25900
+ };
25901
+ const contBlock = {
25902
+ id: contBlockId,
25903
+ instrs: afterInstrs,
25904
+ term: block.term,
25905
+ preds: []
25906
+ };
25907
+ nextBlocks.push(patchedCurrentBlock, ...clonedBlocks, contBlock);
25908
+ }
25909
+ blocks = nextBlocks;
25910
+ }
25911
+ return { ...fn, blocks };
25912
+ }
25913
+ function cloneCallee(callee, inlineId, args, dst, contBlockId) {
25914
+ const sub = /* @__PURE__ */ new Map();
25915
+ for (let i = 0; i < callee.params.length; i++) {
25916
+ sub.set(callee.params[i].name, args[i]);
25917
+ }
25918
+ const calleeTemps = /* @__PURE__ */ new Set();
25919
+ for (const block of callee.blocks) {
25920
+ collectDefinedTemps(block, calleeTemps);
25921
+ }
25922
+ const tempRename = /* @__PURE__ */ new Map();
25923
+ for (const tmp of calleeTemps) {
25924
+ if (!sub.has(tmp)) {
25925
+ tempRename.set(tmp, `${tmp}${inlineId}`);
25926
+ }
25927
+ }
25928
+ const fullSub = new Map([...sub]);
25929
+ for (const [old, renamed] of tempRename) {
25930
+ fullSub.set(old, { kind: "temp", name: renamed });
25931
+ }
25932
+ const blockRename = (id) => `${id}${inlineId}`;
25933
+ return callee.blocks.map((block) => cloneBlock(block, inlineId, fullSub, blockRename, dst, contBlockId));
25934
+ }
25935
+ function collectDefinedTemps(block, out) {
25936
+ const collect = (instr) => {
25937
+ if ("dst" in instr && instr.dst !== null && instr.dst !== void 0) {
25938
+ out.add(instr.dst);
25939
+ }
25940
+ };
25941
+ block.instrs.forEach(collect);
25942
+ collect(block.term);
25943
+ }
25944
+ function cloneBlock(block, inlineId, sub, blockRename, callDst, contBlockId) {
25945
+ const newId = blockRename(block.id);
25946
+ const newInstrs = block.instrs.map((instr) => subAndRenameInstr(instr, sub, blockRename));
25947
+ let newTerm;
25948
+ const term = block.term;
25949
+ if (term.kind === "return") {
25950
+ const retInstrs = [];
25951
+ if (term.value !== null && callDst !== null) {
25952
+ const subbed = substituteOp(term.value, sub);
25953
+ retInstrs.push({ kind: "copy", dst: callDst, src: subbed });
25954
+ }
25955
+ return {
25956
+ id: newId,
25957
+ instrs: [...newInstrs, ...retInstrs],
25958
+ term: { kind: "jump", target: contBlockId },
25959
+ preds: block.preds.map(blockRename)
25960
+ };
25961
+ } else {
25962
+ newTerm = subAndRenameInstr(term, sub, blockRename);
25963
+ }
25964
+ return {
25965
+ id: newId,
25966
+ instrs: newInstrs,
25967
+ term: newTerm,
25968
+ preds: block.preds.map(blockRename)
25969
+ };
25970
+ }
25971
+ function substituteOp(op, sub) {
25972
+ if (op.kind === "temp") {
25973
+ const replacement = sub.get(op.name);
25974
+ if (replacement !== void 0)
25975
+ return replacement;
25976
+ }
25977
+ return op;
25978
+ }
25979
+ function renameBlockId(id, blockRename) {
25980
+ return blockRename(id);
25981
+ }
25982
+ function subAndRenameInstr(instr, sub, blockRename) {
25983
+ const renameDst = (dst) => {
25984
+ if (dst === null)
25985
+ return null;
25986
+ const r = sub.get(dst);
25987
+ if (r && r.kind === "temp")
25988
+ return r.name;
25989
+ return dst;
25990
+ };
25991
+ switch (instr.kind) {
25992
+ case "const":
25993
+ return { ...instr, dst: renameDst(instr.dst) };
25994
+ case "copy":
25995
+ return { ...instr, dst: renameDst(instr.dst), src: substituteOp(instr.src, sub) };
25996
+ case "neg":
25997
+ case "not":
25998
+ return { ...instr, dst: renameDst(instr.dst), src: substituteOp(instr.src, sub) };
25999
+ case "add":
26000
+ case "sub":
26001
+ case "mul":
26002
+ case "div":
26003
+ case "mod":
26004
+ case "and":
26005
+ case "or":
26006
+ return { ...instr, dst: renameDst(instr.dst), a: substituteOp(instr.a, sub), b: substituteOp(instr.b, sub) };
26007
+ case "cmp":
26008
+ return { ...instr, dst: renameDst(instr.dst), a: substituteOp(instr.a, sub), b: substituteOp(instr.b, sub) };
26009
+ case "nbt_read":
26010
+ return { ...instr, dst: renameDst(instr.dst) };
26011
+ case "nbt_read_dynamic":
26012
+ return { ...instr, dst: renameDst(instr.dst), indexSrc: substituteOp(instr.indexSrc, sub) };
26013
+ case "nbt_write":
26014
+ return { ...instr, src: substituteOp(instr.src, sub) };
26015
+ case "nbt_write_dynamic":
26016
+ return { ...instr, indexSrc: substituteOp(instr.indexSrc, sub), valueSrc: substituteOp(instr.valueSrc, sub) };
26017
+ case "nbt_list_len":
26018
+ return { ...instr, dst: renameDst(instr.dst) };
26019
+ case "score_read":
26020
+ return { ...instr, dst: renameDst(instr.dst) };
26021
+ case "score_write":
26022
+ return { ...instr, src: substituteOp(instr.src, sub) };
26023
+ case "call":
26024
+ return { ...instr, dst: renameDst(instr.dst), args: instr.args.map((a) => substituteOp(a, sub)) };
26025
+ case "call_macro":
26026
+ return { ...instr, dst: renameDst(instr.dst), args: instr.args.map((a) => ({ ...a, value: substituteOp(a.value, sub) })) };
26027
+ case "call_context":
26028
+ return instr;
26029
+ case "jump":
26030
+ return { ...instr, target: renameBlockId(instr.target, blockRename) };
26031
+ case "branch":
26032
+ return { ...instr, cond: substituteOp(instr.cond, sub), then: renameBlockId(instr.then, blockRename), else: renameBlockId(instr.else, blockRename) };
26033
+ case "return":
26034
+ return { ...instr, value: instr.value ? substituteOp(instr.value, sub) : null };
26035
+ default:
26036
+ return instr;
26037
+ }
26038
+ }
26039
+ function isSelfRecursive(fn) {
26040
+ for (const block of fn.blocks) {
26041
+ for (const instr of block.instrs) {
26042
+ if (instr.kind === "call" && instr.fn === fn.name)
26043
+ return true;
26044
+ if (instr.kind === "call_macro" && instr.fn === fn.name)
26045
+ return true;
26046
+ }
26047
+ }
26048
+ return false;
26049
+ }
26050
+ }
26051
+ });
26052
+
24318
26053
  // ../../dist/src/optimizer/selector-cache.js
24319
26054
  var require_selector_cache = __commonJS({
24320
26055
  "../../dist/src/optimizer/selector-cache.js"(exports2) {
@@ -24405,6 +26140,7 @@ var require_pipeline = __commonJS({
24405
26140
  var unroll_1 = require_unroll();
24406
26141
  var nbt_batch_1 = require_nbt_batch();
24407
26142
  var interprocedural_1 = require_interprocedural();
26143
+ var inline_1 = require_inline();
24408
26144
  var selector_cache_1 = require_selector_cache();
24409
26145
  Object.defineProperty(exports2, "selectorCache", { enumerable: true, get: function() {
24410
26146
  return selector_cache_1.selectorCache;
@@ -24432,9 +26168,10 @@ var require_pipeline = __commonJS({
24432
26168
  return current;
24433
26169
  }
24434
26170
  function optimizeModule(mod, passes) {
26171
+ const inlined = (0, inline_1.inlinePass)(mod);
24435
26172
  const perFnOptimized = {
24436
- ...mod,
24437
- functions: mod.functions.map((fn) => optimizeFunction(fn, passes))
26173
+ ...inlined,
26174
+ functions: inlined.functions.map((fn) => optimizeFunction(fn, passes))
24438
26175
  };
24439
26176
  return (0, interprocedural_1.interproceduralConstProp)(perFnOptimized);
24440
26177
  }
@@ -24691,6 +26428,17 @@ var require_lower3 = __commonJS({
24691
26428
  });
24692
26429
  break;
24693
26430
  }
26431
+ case "string_match": {
26432
+ const dst = ctx.slot(instr.dst);
26433
+ const dstStr = `${dst.player} ${dst.obj}`;
26434
+ const literal = JSON.stringify(instr.value);
26435
+ instrs.push({ kind: "score_set", dst, value: 0 });
26436
+ instrs.push({
26437
+ kind: "raw",
26438
+ cmd: `execute if data storage ${instr.ns} ${instr.path} matches ${literal} run scoreboard players set ${dstStr} 1`
26439
+ });
26440
+ break;
26441
+ }
24694
26442
  case "and": {
24695
26443
  lowerOperandToSlot(instr.dst, instr.a, ctx, instrs);
24696
26444
  lowerBinOp(instr.dst, instr.b, "score_mul", ctx, instrs);
@@ -24722,6 +26470,17 @@ var require_lower3 = __commonJS({
24722
26470
  });
24723
26471
  break;
24724
26472
  }
26473
+ case "nbt_list_len": {
26474
+ const dst = ctx.slot(instr.dst);
26475
+ instrs.push({
26476
+ kind: "store_nbt_to_score",
26477
+ dst,
26478
+ ns: instr.ns,
26479
+ path: instr.path,
26480
+ scale: 1
26481
+ });
26482
+ break;
26483
+ }
24725
26484
  case "nbt_read_dynamic": {
24726
26485
  const dst = ctx.slot(instr.dst);
24727
26486
  const idxSlot = operandToSlot(instr.indexSrc, ctx, instrs);
@@ -25391,6 +27150,9 @@ var require_emit = __commonJS({
25391
27150
  const tickFns = options.tickFunctions ?? [];
25392
27151
  const loadFns = options.loadFunctions ?? [];
25393
27152
  const scheduleFns = options.scheduleFunctions ?? [];
27153
+ const watchFns = options.watchFunctions ?? [];
27154
+ const profiledFns = options.profiledFunctions ?? [];
27155
+ const enableProfiling = options.enableProfiling ?? false;
25394
27156
  const objective = module3.objective;
25395
27157
  const genSourceMap = options.generateSourceMap ?? false;
25396
27158
  const mcVersion = options.mcVersion ?? mc_version_1.DEFAULT_MC_VERSION;
@@ -25401,7 +27163,16 @@ var require_emit = __commonJS({
25401
27163
  pack: { pack_format: 26, description: `RedScript datapack: ${namespace}` }
25402
27164
  }, null, 2) + "\n"
25403
27165
  });
25404
- const loadCmds = [`scoreboard objectives add ${objective} dummy`];
27166
+ const singletonObjectives = options.singletonObjectives ?? [];
27167
+ const loadCmds = [
27168
+ `scoreboard objectives add ${objective} dummy`,
27169
+ ...watchFns.map((watch) => `scoreboard objectives add ${watchPrevObjective(watch.name)} dummy`),
27170
+ ...singletonObjectives.map((obj) => `scoreboard objectives add ${obj} dummy`),
27171
+ ...enableProfiling && profiledFns.length > 0 ? [
27172
+ "scoreboard objectives add __time dummy",
27173
+ "scoreboard objectives add __profile dummy"
27174
+ ] : []
27175
+ ];
25405
27176
  files.push({
25406
27177
  path: `data/${namespace}/function/load.mcfunction`,
25407
27178
  content: loadCmds.join("\n") + "\n"
@@ -25410,17 +27181,27 @@ var require_emit = __commonJS({
25410
27181
  const fnPath = fnNameToPath(fn.name, namespace);
25411
27182
  if (genSourceMap) {
25412
27183
  const builder = new sourcemap_1.SourceMapBuilder(fnPath);
25413
- const lines = emitFunctionWithSourceMap(fn, namespace, objective, builder, mcVersion);
27184
+ const lines = emitFunctionWithSourceMap(fn, namespace, objective, builder, mcVersion, enableProfiling && profiledFns.includes(fn.name));
25414
27185
  files.push({ path: fnPath, content: lines.join("\n") + "\n" });
25415
27186
  const map = builder.build();
25416
27187
  if (map) {
25417
27188
  files.push({ path: (0, sourcemap_1.sourceMapPath)(fnPath), content: (0, sourcemap_1.serializeSourceMap)(map) });
25418
27189
  }
25419
27190
  } else {
25420
- const lines = emitFunction(fn, namespace, objective, mcVersion);
27191
+ const lines = emitFunction(fn, namespace, objective, mcVersion, enableProfiling && profiledFns.includes(fn.name));
25421
27192
  files.push({ path: fnPath, content: lines.join("\n") + "\n" });
25422
27193
  }
25423
27194
  }
27195
+ if (enableProfiling && profiledFns.length > 0) {
27196
+ files.push({
27197
+ path: `data/${namespace}/function/__profiler_reset.mcfunction`,
27198
+ content: emitProfilerReset(profiledFns).join("\n") + "\n"
27199
+ });
27200
+ files.push({
27201
+ path: `data/${namespace}/function/__profiler_report.mcfunction`,
27202
+ content: emitProfilerReport(profiledFns).join("\n") + "\n"
27203
+ });
27204
+ }
25424
27205
  for (const { name, ticks } of scheduleFns) {
25425
27206
  files.push({
25426
27207
  path: `data/${namespace}/function/_schedule_${name}.mcfunction`,
@@ -25428,6 +27209,19 @@ var require_emit = __commonJS({
25428
27209
  `
25429
27210
  });
25430
27211
  }
27212
+ for (const watch of watchFns) {
27213
+ const dispatcher = watchDispatcherName(watch.name);
27214
+ const prevObjective = watchPrevObjective(watch.name);
27215
+ const changedCondition = `unless score @s ${watch.objective} = @s ${prevObjective}`;
27216
+ files.push({
27217
+ path: fnNameToPath(dispatcher, namespace),
27218
+ content: [
27219
+ `execute as @a unless score @s ${prevObjective} = @s ${prevObjective} run scoreboard players operation @s ${prevObjective} = @s ${watch.objective}`,
27220
+ `execute as @a ${changedCondition} run function ${namespace}:${watch.name}`,
27221
+ `execute as @a ${changedCondition} run scoreboard players operation @s ${prevObjective} = @s ${watch.objective}`
27222
+ ].join("\n") + "\n"
27223
+ });
27224
+ }
25431
27225
  if (loadFns.length > 0 || true) {
25432
27226
  const loadValues = [`${namespace}:load`, ...loadFns.map((fn) => `${namespace}:${fn}`)];
25433
27227
  files.push({
@@ -25435,34 +27229,115 @@ var require_emit = __commonJS({
25435
27229
  content: JSON.stringify({ values: loadValues }, null, 2) + "\n"
25436
27230
  });
25437
27231
  }
25438
- if (tickFns.length > 0) {
25439
- const tickValues = tickFns.map((fn) => `${namespace}:${fn}`);
27232
+ const allTickFns = [...tickFns, ...watchFns.map((watch) => watchDispatcherName(watch.name))];
27233
+ if (allTickFns.length > 0) {
27234
+ const tickValues = allTickFns.map((fn) => `${namespace}:${fn}`);
25440
27235
  files.push({
25441
27236
  path: "data/minecraft/tags/function/tick.json",
25442
27237
  content: JSON.stringify({ values: tickValues }, null, 2) + "\n"
25443
27238
  });
25444
27239
  }
27240
+ const EVENT_TAG_NAMES = {
27241
+ PlayerJoin: "on_player_join",
27242
+ PlayerDeath: "on_player_death",
27243
+ EntityKill: "on_entity_kill",
27244
+ ItemUse: "on_item_use",
27245
+ BlockBreak: "on_block_break"
27246
+ };
27247
+ if (options.eventHandlers) {
27248
+ for (const [evType, handlers] of options.eventHandlers) {
27249
+ const tagName = EVENT_TAG_NAMES[evType];
27250
+ if (tagName && handlers.length > 0) {
27251
+ files.push({
27252
+ path: `data/rs/tags/function/${tagName}.json`,
27253
+ content: JSON.stringify({ values: handlers }, null, 2) + "\n"
27254
+ });
27255
+ }
27256
+ }
27257
+ }
25445
27258
  return files;
25446
27259
  }
25447
- function emitFunction(fn, namespace, objective, mcVersion) {
25448
- const lines = [];
27260
+ function emitFunction(fn, namespace, objective, mcVersion, isProfiled = false) {
27261
+ const lines = isProfiled ? profilerStartLines(fn.name) : [];
25449
27262
  for (const instr of fn.instructions) {
25450
27263
  lines.push(emitInstr(instr, namespace, objective, mcVersion));
25451
27264
  }
27265
+ if (isProfiled) {
27266
+ lines.push(...profilerEndLines(fn.name));
27267
+ }
25452
27268
  return lines;
25453
27269
  }
25454
- function emitFunctionWithSourceMap(fn, namespace, objective, builder, mcVersion) {
27270
+ function emitFunctionWithSourceMap(fn, namespace, objective, builder, mcVersion, isProfiled = false) {
25455
27271
  const lines = [];
27272
+ if (isProfiled) {
27273
+ for (const line of profilerStartLines(fn.name)) {
27274
+ lines.push(line);
27275
+ builder.addLine(void 0);
27276
+ }
27277
+ }
25456
27278
  for (const instr of fn.instructions) {
25457
27279
  lines.push(emitInstr(instr, namespace, objective, mcVersion));
25458
27280
  builder.addLine(instr.sourceLoc);
25459
27281
  }
27282
+ if (isProfiled) {
27283
+ for (const line of profilerEndLines(fn.name)) {
27284
+ lines.push(line);
27285
+ builder.addLine(void 0);
27286
+ }
27287
+ }
25460
27288
  return lines;
25461
27289
  }
25462
27290
  function fnNameToPath(name, namespace) {
25463
27291
  const mcName = name.replace(/::/g, "/").toLowerCase();
25464
27292
  return `data/${namespace}/function/${mcName}.mcfunction`;
25465
27293
  }
27294
+ function watchDispatcherName(name) {
27295
+ return `__watch_${name}`;
27296
+ }
27297
+ function watchPrevObjective(name) {
27298
+ return `__watch_${name}_prev`;
27299
+ }
27300
+ function profilerSafeName(name) {
27301
+ return name.replace(/[^A-Za-z0-9_]/g, "_");
27302
+ }
27303
+ function profilerStartPlayer(name) {
27304
+ return `#prof_start_${profilerSafeName(name)}`;
27305
+ }
27306
+ function profilerDeltaPlayer(name) {
27307
+ return `#prof_delta_${profilerSafeName(name)}`;
27308
+ }
27309
+ function profilerTotalPlayer(name) {
27310
+ return `#prof_total_${profilerSafeName(name)}`;
27311
+ }
27312
+ function profilerCountPlayer(name) {
27313
+ return `#prof_count_${profilerSafeName(name)}`;
27314
+ }
27315
+ function profilerStartLines(name) {
27316
+ return [
27317
+ `# __profiler_start_${name}`,
27318
+ `scoreboard players set ${profilerStartPlayer(name)} __time 0`,
27319
+ `execute store result score ${profilerStartPlayer(name)} __time run time query gametime`
27320
+ ];
27321
+ }
27322
+ function profilerEndLines(name) {
27323
+ return [
27324
+ `# __profiler_end_${name}`,
27325
+ `scoreboard players set ${profilerDeltaPlayer(name)} __time 0`,
27326
+ `execute store result score ${profilerDeltaPlayer(name)} __time run time query gametime`,
27327
+ `scoreboard players operation ${profilerDeltaPlayer(name)} __time -= ${profilerStartPlayer(name)} __time`,
27328
+ `scoreboard players operation ${profilerTotalPlayer(name)} __profile += ${profilerDeltaPlayer(name)} __time`,
27329
+ `scoreboard players add ${profilerCountPlayer(name)} __profile 1`
27330
+ ];
27331
+ }
27332
+ function emitProfilerReset(profiledFns) {
27333
+ return profiledFns.flatMap((name) => [
27334
+ `scoreboard players set ${profilerTotalPlayer(name)} __profile 0`,
27335
+ `scoreboard players set ${profilerCountPlayer(name)} __profile 0`
27336
+ ]);
27337
+ }
27338
+ function emitProfilerReport(profiledFns) {
27339
+ return profiledFns.map((name) => `tellraw @a [{"text":"[profile] ${name}: total="},{"score":{"name":"${profilerTotalPlayer(name)}","objective":"__profile"}},{"text":" ticks count="},{"score":{"name":"${profilerCountPlayer(name)}","objective":"__profile"}}]`);
27340
+ }
25466
27341
  function emitInstr(instr, ns, obj, mcVersion) {
25467
27342
  switch (instr.kind) {
25468
27343
  case "score_set":
@@ -25649,15 +27524,17 @@ var require_coroutine = __commonJS({
25649
27524
  }
25650
27525
  const loopHeaders = new Set(backEdges.map((e) => e.target));
25651
27526
  const continuations = partitionIntoContinuations(fn, loopHeaders, backEdges);
27527
+ const dispatcherName = `${prefix}_tick`;
27528
+ const pcPlayer = `$${dispatcherName}_${pcTemp}`;
25652
27529
  const contFunctions = [];
25653
27530
  for (let i = 0; i < continuations.length; i++) {
25654
27531
  const contId = i + 1;
25655
27532
  const cont = continuations[i];
25656
- const contFn = buildContinuationFunction(`${prefix}_cont_${contId}`, cont, info.batch, contId, continuations.length, promoted, pcTemp, batchCountTemp, objective, info.onDone, fn.name);
27533
+ const contFn = buildContinuationFunction(`${prefix}_cont_${contId}`, cont, info.batch, contId, continuations.length, promoted, pcTemp, batchCountTemp, objective, info.onDone, fn.name, pcPlayer);
25657
27534
  contFunctions.push(contFn);
25658
27535
  }
25659
- const initFn = buildInitFunction(fn, promoted, pcTemp, prefix, objective);
25660
- const dispatcher = buildDispatcher(`${prefix}_tick`, contFunctions, pcTemp, objective, fn.name);
27536
+ const initFn = buildInitFunction(fn, promoted, pcTemp, prefix, objective, pcPlayer);
27537
+ const dispatcher = buildDispatcher(dispatcherName, contFunctions, pcTemp, objective, fn.name);
25661
27538
  return { initFn, continuations: contFunctions, dispatcher };
25662
27539
  }
25663
27540
  function computeDominators(blocks, entry) {
@@ -25869,14 +27746,14 @@ var require_coroutine = __commonJS({
25869
27746
  }
25870
27747
  return conts;
25871
27748
  }
25872
- function buildContinuationFunction(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone, originalFnName) {
27749
+ function buildContinuationFunction(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone, originalFnName, pcPlayer) {
25873
27750
  if (cont.isLoopBody) {
25874
- return buildLoopContinuation(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone);
27751
+ return buildLoopContinuation(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone, pcPlayer);
25875
27752
  } else {
25876
- return buildPostLoopContinuation(name, cont, contId, promoted, pcTemp, objective, onDone);
27753
+ return buildPostLoopContinuation(name, cont, contId, promoted, pcTemp, objective, onDone, pcPlayer);
25877
27754
  }
25878
27755
  }
25879
- function buildLoopContinuation(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone) {
27756
+ function buildLoopContinuation(name, cont, batch, contId, totalConts, promoted, pcTemp, batchCountTemp, objective, onDone, pcPlayer) {
25880
27757
  const blocks = [];
25881
27758
  const batchCmpTemp = `${batchCountTemp}_cmp`;
25882
27759
  const entryBlock = {
@@ -25929,7 +27806,9 @@ var require_coroutine = __commonJS({
25929
27806
  const exitBlockId = `${block.id}_exit`;
25930
27807
  const exitBlock = {
25931
27808
  id: exitBlockId,
25932
- instrs: [],
27809
+ instrs: [
27810
+ { kind: "score_write", player: pcPlayer, obj: objective, src: { kind: "const", value: contId + 1 } }
27811
+ ],
25933
27812
  term: { kind: "return", value: null },
25934
27813
  preds: [block.id]
25935
27814
  };
@@ -25975,23 +27854,23 @@ var require_coroutine = __commonJS({
25975
27854
  isMacro: false
25976
27855
  };
25977
27856
  }
25978
- function buildPostLoopContinuation(name, cont, contId, promoted, pcTemp, objective, onDone) {
27857
+ function buildPostLoopContinuation(name, cont, contId, promoted, pcTemp, objective, onDone, pcPlayer) {
25979
27858
  const blocks = [];
25980
27859
  for (const block of cont.blocks) {
25981
27860
  blocks.push(rewriteBlock(block, promoted));
25982
27861
  }
25983
27862
  const entry = cont.blocks[0]?.id ?? "entry";
25984
- if (onDone) {
25985
- for (let i = 0; i < blocks.length; i++) {
25986
- if (blocks[i].term.kind === "return") {
25987
- blocks[i] = {
25988
- ...blocks[i],
25989
- instrs: [
25990
- ...blocks[i].instrs,
25991
- { kind: "call", dst: null, fn: onDone, args: [] }
25992
- ]
25993
- };
25994
- }
27863
+ for (let i = 0; i < blocks.length; i++) {
27864
+ if (blocks[i].term.kind === "return") {
27865
+ const extraInstrs = [];
27866
+ if (onDone) {
27867
+ extraInstrs.push({ kind: "call", dst: null, fn: onDone, args: [] });
27868
+ }
27869
+ extraInstrs.push({ kind: "score_write", player: pcPlayer, obj: objective, src: { kind: "const", value: 0 } });
27870
+ blocks[i] = {
27871
+ ...blocks[i],
27872
+ instrs: [...blocks[i].instrs, ...extraInstrs]
27873
+ };
25995
27874
  }
25996
27875
  }
25997
27876
  return {
@@ -26002,15 +27881,31 @@ var require_coroutine = __commonJS({
26002
27881
  isMacro: false
26003
27882
  };
26004
27883
  }
26005
- function buildInitFunction(originalFn, promoted, pcTemp, prefix, objective) {
27884
+ function buildInitFunction(originalFn, promoted, pcTemp, prefix, objective, pcPlayer) {
26006
27885
  const instrs = [];
26007
- instrs.push({ kind: "const", dst: pcTemp, value: 1 });
27886
+ instrs.push({ kind: "score_write", player: pcPlayer, obj: objective, src: { kind: "const", value: 1 } });
27887
+ const dispatcherName = `${prefix}_cont_1`;
26008
27888
  const entryBlock = originalFn.blocks.find((b) => b.id === originalFn.entry);
26009
27889
  if (entryBlock) {
26010
27890
  for (const instr of entryBlock.instrs) {
26011
27891
  const dst = getDst(instr);
26012
27892
  if (dst && promoted.has(dst)) {
26013
- instrs.push(rewriteInstr(instr, promoted));
27893
+ const promotedTemp = promoted.get(dst);
27894
+ const player = `$${dispatcherName}_${promotedTemp}`;
27895
+ if (instr.kind === "const") {
27896
+ instrs.push({ kind: "score_write", player, obj: objective, src: { kind: "const", value: instr.value } });
27897
+ } else if (instr.kind === "copy") {
27898
+ let src;
27899
+ if (instr.src.kind === "temp") {
27900
+ const srcTemp = promoted.get(instr.src.name) ?? instr.src.name;
27901
+ src = { kind: "temp", name: srcTemp };
27902
+ } else {
27903
+ src = instr.src;
27904
+ }
27905
+ instrs.push({ kind: "score_write", player, obj: objective, src });
27906
+ } else {
27907
+ instrs.push(rewriteInstr(instr, promoted));
27908
+ }
26014
27909
  }
26015
27910
  }
26016
27911
  }
@@ -26078,12 +27973,15 @@ var require_coroutine = __commonJS({
26078
27973
  }
26079
27974
  function buildSingleContinuation(fn, info, prefix, pcTemp, objective) {
26080
27975
  const contName = `${prefix}_cont_1`;
27976
+ const dispatcherName = `${prefix}_tick`;
27977
+ const pcPlayer = `$${dispatcherName}_${pcTemp}`;
26081
27978
  const contBlocks = fn.blocks.map((block) => {
26082
27979
  if (block.term.kind === "return") {
26083
27980
  const instrs = [...block.instrs];
26084
27981
  if (info.onDone) {
26085
27982
  instrs.push({ kind: "call", dst: null, fn: info.onDone, args: [] });
26086
27983
  }
27984
+ instrs.push({ kind: "score_write", player: pcPlayer, obj: objective, src: { kind: "const", value: 0 } });
26087
27985
  return { ...block, instrs };
26088
27986
  }
26089
27987
  return block;
@@ -26098,7 +27996,7 @@ var require_coroutine = __commonJS({
26098
27996
  const initBlock = {
26099
27997
  id: "entry",
26100
27998
  instrs: [
26101
- { kind: "const", dst: pcTemp, value: 1 }
27999
+ { kind: "score_write", player: pcPlayer, obj: objective, src: { kind: "const", value: 1 } }
26102
28000
  ],
26103
28001
  term: { kind: "return", value: null },
26104
28002
  preds: []
@@ -26110,7 +28008,7 @@ var require_coroutine = __commonJS({
26110
28008
  entry: "entry",
26111
28009
  isMacro: fn.isMacro
26112
28010
  };
26113
- const dispatcher = buildDispatcher(`${prefix}_tick`, [contFn], pcTemp, objective, fn.name);
28011
+ const dispatcher = buildDispatcher(dispatcherName, [contFn], pcTemp, objective, fn.name);
26114
28012
  return { initFn, continuations: [contFn], dispatcher };
26115
28013
  }
26116
28014
  function rewriteBlock(block, promoted) {
@@ -26151,6 +28049,10 @@ var require_coroutine = __commonJS({
26151
28049
  return { ...instr, src: rOp(instr.src) };
26152
28050
  case "nbt_write_dynamic":
26153
28051
  return { ...instr, indexSrc: rOp(instr.indexSrc), valueSrc: rOp(instr.valueSrc) };
28052
+ case "score_read":
28053
+ return { ...instr, dst: rTemp(instr.dst) };
28054
+ case "score_write":
28055
+ return { ...instr, src: rOp(instr.src) };
26154
28056
  case "call":
26155
28057
  return { ...instr, dst: instr.dst ? rTemp(instr.dst) : null, args: instr.args.map(rOp) };
26156
28058
  case "call_macro":
@@ -26234,6 +28136,9 @@ var require_coroutine = __commonJS({
26234
28136
  case "nbt_read_dynamic":
26235
28137
  addOp(instr.indexSrc);
26236
28138
  break;
28139
+ case "score_write":
28140
+ addOp(instr.src);
28141
+ break;
26237
28142
  case "call":
26238
28143
  instr.args.forEach(addOp);
26239
28144
  break;
@@ -26484,8 +28389,11 @@ var require_types = __commonJS({
26484
28389
  },
26485
28390
  BlockBreak: {
26486
28391
  tag: "rs.just_broke_block",
26487
- params: ["player: Player", "block: string"],
28392
+ params: ["player: Player"],
26488
28393
  detection: "advancement"
28394
+ // Note: block type is NOT available as a runtime parameter — MC has no mechanism
28395
+ // to pass event data to function tags. Use minecraft.mined:<block> scoreboard
28396
+ // stats for per-block detection, or check the block at player's position in handler.
26489
28397
  },
26490
28398
  EntityKill: {
26491
28399
  tag: "rs.just_killed",
@@ -26616,7 +28524,6 @@ var require_typechecker = __commonJS({
26616
28524
  var VOID_TYPE = { kind: "named", name: "void" };
26617
28525
  var INT_TYPE = { kind: "named", name: "int" };
26618
28526
  var STRING_TYPE = { kind: "named", name: "string" };
26619
- var FORMAT_STRING_TYPE = { kind: "named", name: "format_string" };
26620
28527
  var BUILTIN_SIGNATURES = {
26621
28528
  setTimeout: {
26622
28529
  params: [INT_TYPE, { kind: "function_type", params: [], return: VOID_TYPE }],
@@ -26629,15 +28536,24 @@ var require_typechecker = __commonJS({
26629
28536
  clearInterval: {
26630
28537
  params: [INT_TYPE],
26631
28538
  return: VOID_TYPE
28539
+ },
28540
+ int_to_str: {
28541
+ params: [INT_TYPE],
28542
+ return: STRING_TYPE
28543
+ },
28544
+ bool_to_str: {
28545
+ params: [{ kind: "named", name: "bool" }],
28546
+ return: STRING_TYPE
26632
28547
  }
26633
28548
  };
26634
- var TypeChecker = class {
28549
+ var TypeChecker = class _TypeChecker {
26635
28550
  constructor(source, filePath) {
26636
28551
  this.lintWarnings = [];
26637
28552
  this.functions = /* @__PURE__ */ new Map();
26638
28553
  this.implMethods = /* @__PURE__ */ new Map();
26639
28554
  this.structs = /* @__PURE__ */ new Map();
26640
28555
  this.enums = /* @__PURE__ */ new Map();
28556
+ this.enumPayloads = /* @__PURE__ */ new Map();
26641
28557
  this.consts = /* @__PURE__ */ new Map();
26642
28558
  this.globals = /* @__PURE__ */ new Map();
26643
28559
  this.currentFn = null;
@@ -26646,6 +28562,7 @@ var require_typechecker = __commonJS({
26646
28562
  this.selfTypeStack = ["entity"];
26647
28563
  this.loopDepth = 0;
26648
28564
  this.condDepth = 0;
28565
+ this.interfaces = /* @__PURE__ */ new Map();
26649
28566
  this.richTextBuiltins = /* @__PURE__ */ new Map([
26650
28567
  ["say", { messageIndex: 0 }],
26651
28568
  ["announce", { messageIndex: 0 }],
@@ -26685,6 +28602,9 @@ var require_typechecker = __commonJS({
26685
28602
  for (const fn of program.declarations) {
26686
28603
  this.functions.set(fn.name, fn);
26687
28604
  }
28605
+ for (const iface of program.interfaces ?? []) {
28606
+ this.interfaces.set(iface.name, iface);
28607
+ }
26688
28608
  for (const global of program.globals ?? []) {
26689
28609
  this.globals.set(global.name, this.normalizeType(global.type));
26690
28610
  }
@@ -26714,13 +28634,47 @@ var require_typechecker = __commonJS({
26714
28634
  fields.set(field.name, field.type);
26715
28635
  }
26716
28636
  this.structs.set(struct.name, fields);
28637
+ if (struct.isSingleton) {
28638
+ const structType = { kind: "struct", name: struct.name };
28639
+ let singletonMethods = this.implMethods.get(struct.name);
28640
+ if (!singletonMethods) {
28641
+ singletonMethods = /* @__PURE__ */ new Map();
28642
+ this.implMethods.set(struct.name, singletonMethods);
28643
+ }
28644
+ const voidType = { kind: "named", name: "void" };
28645
+ singletonMethods.set("get", {
28646
+ name: "get",
28647
+ params: [],
28648
+ returnType: structType,
28649
+ decorators: [],
28650
+ body: [],
28651
+ typeParams: void 0,
28652
+ isLibraryFn: true
28653
+ });
28654
+ singletonMethods.set("set", {
28655
+ name: "set",
28656
+ params: [{ name: "gs", type: structType }],
28657
+ returnType: voidType,
28658
+ decorators: [],
28659
+ body: [],
28660
+ typeParams: void 0,
28661
+ isLibraryFn: true
28662
+ });
28663
+ }
26717
28664
  }
26718
28665
  for (const enumDecl of program.enums ?? []) {
26719
28666
  const variants = /* @__PURE__ */ new Map();
28667
+ const payloads = /* @__PURE__ */ new Map();
26720
28668
  for (const variant of enumDecl.variants) {
26721
28669
  variants.set(variant.name, variant.value ?? 0);
28670
+ if (variant.fields && variant.fields.length > 0) {
28671
+ payloads.set(variant.name, variant.fields);
28672
+ }
26722
28673
  }
26723
28674
  this.enums.set(enumDecl.name, variants);
28675
+ if (payloads.size > 0) {
28676
+ this.enumPayloads.set(enumDecl.name, payloads);
28677
+ }
26724
28678
  }
26725
28679
  for (const constDecl of program.consts ?? []) {
26726
28680
  const constType = this.normalizeType(constDecl.type);
@@ -26730,6 +28684,20 @@ var require_typechecker = __commonJS({
26730
28684
  }
26731
28685
  this.consts.set(constDecl.name, constType);
26732
28686
  }
28687
+ for (const implBlock of program.implBlocks ?? []) {
28688
+ if (!implBlock.traitName)
28689
+ continue;
28690
+ const iface = this.interfaces.get(implBlock.traitName);
28691
+ if (!iface)
28692
+ continue;
28693
+ const implementedMethods = new Set(implBlock.methods.map((m) => m.name));
28694
+ for (const required of iface.methods) {
28695
+ if (!implementedMethods.has(required.name)) {
28696
+ const span = implBlock.span ?? required.span;
28697
+ this.report(`Struct '${implBlock.typeName}' does not implement required method '${required.name}' from interface '${implBlock.traitName}'`, span ?? { line: 1, col: 1 });
28698
+ }
28699
+ }
28700
+ }
26733
28701
  for (const fn of program.declarations) {
26734
28702
  this.checkFunction(fn);
26735
28703
  }
@@ -26773,6 +28741,30 @@ var require_typechecker = __commonJS({
26773
28741
  this.currentReturnType = null;
26774
28742
  }
26775
28743
  checkFunctionDecorators(fn) {
28744
+ const watchDecorators = fn.decorators.filter((decorator) => decorator.name === "watch");
28745
+ if (watchDecorators.length > 1) {
28746
+ this.report(`Function '${fn.name}' cannot have multiple @watch decorators`, fn);
28747
+ return;
28748
+ }
28749
+ if (watchDecorators.length === 1) {
28750
+ const objective = watchDecorators[0].args?.objective;
28751
+ if (!objective) {
28752
+ this.report(`Function '${fn.name}' is missing a scoreboard objective in @watch("...")`, fn);
28753
+ return;
28754
+ }
28755
+ if (fn.params.length > 0) {
28756
+ this.report(`@watch handler '${fn.name}' cannot declare parameters`, fn);
28757
+ }
28758
+ }
28759
+ const profileDecorators = fn.decorators.filter((decorator) => decorator.name === "profile");
28760
+ if (profileDecorators.length > 1) {
28761
+ this.report(`Function '${fn.name}' cannot have multiple @profile decorators`, fn);
28762
+ return;
28763
+ }
28764
+ if (profileDecorators.length === 1 && (profileDecorators[0].rawArgs?.length || profileDecorators[0].args && Object.keys(profileDecorators[0].args).length > 0)) {
28765
+ this.report(`@profile decorator on '${fn.name}' does not accept arguments`, fn);
28766
+ return;
28767
+ }
26776
28768
  const eventDecorators = fn.decorators.filter((decorator) => decorator.name === "on");
26777
28769
  if (eventDecorators.length === 0) {
26778
28770
  return;
@@ -26869,16 +28861,29 @@ var require_typechecker = __commonJS({
26869
28861
  case "match":
26870
28862
  this.checkExpr(stmt.expr);
26871
28863
  for (const arm of stmt.arms) {
26872
- if (arm.pattern) {
26873
- this.checkExpr(arm.pattern);
28864
+ if (arm.pattern.kind === "PatExpr") {
28865
+ this.checkExpr(arm.pattern.expr);
26874
28866
  const subjectType = this.inferType(stmt.expr);
26875
- const patternType = this.inferType(arm.pattern);
28867
+ const patternType = this.inferType(arm.pattern.expr);
26876
28868
  const isUnknown = (t) => t.kind === "named" && t.name === "void";
26877
28869
  if (!isUnknown(subjectType) && !isUnknown(patternType) && !this.typesMatch(subjectType, patternType)) {
26878
- this.report("Match arm pattern type must match subject type", arm.pattern);
28870
+ this.report("Match arm pattern type must match subject type", arm.pattern.expr);
26879
28871
  }
28872
+ this.checkBlock(arm.body);
28873
+ } else if (arm.pattern.kind === "PatEnum") {
28874
+ const pat = arm.pattern;
28875
+ const variantPayloads = this.enumPayloads.get(pat.enumName)?.get(pat.variant) ?? [];
28876
+ const savedScope = new Map(this.scope);
28877
+ for (let i = 0; i < pat.bindings.length; i++) {
28878
+ const fieldDef = variantPayloads[i];
28879
+ const bindingType = fieldDef ? fieldDef.type : { kind: "named", name: "int" };
28880
+ this.scope.set(pat.bindings[i], { type: bindingType, mutable: false });
28881
+ }
28882
+ this.checkBlock(arm.body);
28883
+ this.scope = savedScope;
28884
+ } else {
28885
+ this.checkBlock(arm.body);
26880
28886
  }
26881
- this.checkBlock(arm.body);
26882
28887
  }
26883
28888
  break;
26884
28889
  case "as_block": {
@@ -26917,6 +28922,9 @@ var require_typechecker = __commonJS({
26917
28922
  break;
26918
28923
  case "raw":
26919
28924
  break;
28925
+ case "const_decl":
28926
+ this.scope.set(stmt.name, { type: stmt.type, mutable: false });
28927
+ break;
26920
28928
  }
26921
28929
  }
26922
28930
  checkLetDestructStmt(stmt) {
@@ -27014,6 +29022,11 @@ var require_typechecker = __commonJS({
27014
29022
  if (arithmeticOps.includes(expr.op)) {
27015
29023
  const leftType = this.inferType(expr.left);
27016
29024
  const rightType = this.inferType(expr.right);
29025
+ const leftIsString = leftType.kind === "named" && (leftType.name === "string" || leftType.name === "format_string");
29026
+ const rightIsString = rightType.kind === "named" && (rightType.name === "string" || rightType.name === "format_string");
29027
+ if (leftIsString || rightIsString) {
29028
+ this.report(`[StringConcat] String concatenation with '+' is not supported. Use f-strings instead: f"text{variable}" \u2014 e.g. f"Score: {score}"`, expr);
29029
+ }
27017
29030
  const leftIsFloat = leftType.kind === "named" && leftType.name === "float";
27018
29031
  const rightIsFloat = rightType.kind === "named" && rightType.name === "float";
27019
29032
  if (leftIsFloat || rightIsFloat) {
@@ -27078,7 +29091,7 @@ var require_typechecker = __commonJS({
27078
29091
  this.checkExpr(part.expr);
27079
29092
  const partType = this.inferType(part.expr);
27080
29093
  const isUnknown = partType.kind === "named" && partType.name === "void";
27081
- if (!isUnknown && !(partType.kind === "named" && (partType.name === "int" || partType.name === "string" || partType.name === "format_string"))) {
29094
+ if (!isUnknown && !(partType.kind === "named" && ["int", "string", "format_string", "fixed", "double", "bool", "byte", "short", "long"].includes(partType.name))) {
27082
29095
  this.report(`f-string placeholder must be int or string, got ${this.typeToString(partType)}`, part.expr);
27083
29096
  }
27084
29097
  }
@@ -27109,6 +29122,31 @@ var require_typechecker = __commonJS({
27109
29122
  }
27110
29123
  }
27111
29124
  break;
29125
+ case "enum_construct": {
29126
+ if (!this.enums.has(expr.enumName)) {
29127
+ this.report(`Unknown enum '${expr.enumName}'`, expr);
29128
+ break;
29129
+ }
29130
+ const variants = this.enums.get(expr.enumName);
29131
+ if (!variants.has(expr.variant)) {
29132
+ this.report(`Enum '${expr.enumName}' has no variant '${expr.variant}'`, expr);
29133
+ break;
29134
+ }
29135
+ const variantPayloads = this.enumPayloads.get(expr.enumName)?.get(expr.variant) ?? [];
29136
+ if (variantPayloads.length === 0 && expr.args.length > 0) {
29137
+ this.report(`Enum variant '${expr.enumName}::${expr.variant}' has no payload fields`, expr);
29138
+ break;
29139
+ }
29140
+ for (const arg of expr.args) {
29141
+ const fieldDef = variantPayloads.find((f) => f.name === arg.name);
29142
+ if (!fieldDef) {
29143
+ this.report(`Unknown field '${arg.name}' for enum variant '${expr.enumName}::${expr.variant}'`, expr);
29144
+ } else {
29145
+ this.checkExpr(arg.value, fieldDef.type);
29146
+ }
29147
+ }
29148
+ break;
29149
+ }
27112
29150
  case "blockpos":
27113
29151
  break;
27114
29152
  // Literals don't need checking
@@ -27201,7 +29239,7 @@ var require_typechecker = __commonJS({
27201
29239
  return;
27202
29240
  }
27203
29241
  const messageType = this.inferType(message);
27204
- if (messageType.kind !== "named" || messageType.name !== "string" && messageType.name !== "format_string") {
29242
+ if (messageType.kind !== "named" || messageType.name !== "string") {
27205
29243
  this.report(`Argument ${messageIndex + 1} of '${expr.fn}' expects string or format_string, got ${this.typeToString(messageType)}`, message);
27206
29244
  }
27207
29245
  }
@@ -27397,7 +29435,7 @@ var require_typechecker = __commonJS({
27397
29435
  this.checkExpr(part.expr);
27398
29436
  }
27399
29437
  }
27400
- return FORMAT_STRING_TYPE;
29438
+ return STRING_TYPE;
27401
29439
  case "blockpos":
27402
29440
  return { kind: "named", name: "BlockPos" };
27403
29441
  case "ident":
@@ -27458,6 +29496,11 @@ var require_typechecker = __commonJS({
27458
29496
  return { kind: "enum", name: expr.enumName };
27459
29497
  }
27460
29498
  return { kind: "named", name: "void" };
29499
+ case "enum_construct":
29500
+ if (this.enums.has(expr.enumName)) {
29501
+ return { kind: "enum", name: expr.enumName };
29502
+ }
29503
+ return { kind: "named", name: "void" };
27461
29504
  case "member":
27462
29505
  if (expr.obj.kind === "ident" && this.enums.has(expr.obj.name)) {
27463
29506
  return { kind: "enum", name: expr.obj.name };
@@ -27569,7 +29612,8 @@ var require_typechecker = __commonJS({
27569
29612
  if (receiverType.kind !== "struct") {
27570
29613
  return null;
27571
29614
  }
27572
- const method = this.implMethods.get(receiverType.name)?.get(expr.fn);
29615
+ const methodName = _TypeChecker.PARSER_METHOD_REMAP[expr.fn] ?? expr.fn;
29616
+ const method = this.implMethods.get(receiverType.name)?.get(expr.fn) ?? this.implMethods.get(receiverType.name)?.get(methodName);
27573
29617
  if (!method || method.params[0]?.name !== "self") {
27574
29618
  return null;
27575
29619
  }
@@ -27740,6 +29784,17 @@ var require_typechecker = __commonJS({
27740
29784
  }
27741
29785
  };
27742
29786
  exports2.TypeChecker = TypeChecker;
29787
+ TypeChecker.PARSER_METHOD_REMAP = {
29788
+ "set_add": "add",
29789
+ "set_contains": "contains",
29790
+ "set_remove": "remove",
29791
+ "set_clear": "clear",
29792
+ "__array_push": "push",
29793
+ "__array_pop": "pop",
29794
+ "__entity_tag": "tag",
29795
+ "__entity_untag": "untag",
29796
+ "__entity_has_tag": "has_tag"
29797
+ };
27743
29798
  }
27744
29799
  });
27745
29800
 
@@ -27747,14 +29802,54 @@ var require_typechecker = __commonJS({
27747
29802
  var require_compile2 = __commonJS({
27748
29803
  "../../dist/src/emit/compile.js"(exports2) {
27749
29804
  "use strict";
29805
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
29806
+ if (k2 === void 0) k2 = k;
29807
+ var desc = Object.getOwnPropertyDescriptor(m, k);
29808
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
29809
+ desc = { enumerable: true, get: function() {
29810
+ return m[k];
29811
+ } };
29812
+ }
29813
+ Object.defineProperty(o, k2, desc);
29814
+ }) : (function(o, m, k, k2) {
29815
+ if (k2 === void 0) k2 = k;
29816
+ o[k2] = m[k];
29817
+ }));
29818
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
29819
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29820
+ }) : function(o, v) {
29821
+ o["default"] = v;
29822
+ });
29823
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
29824
+ var ownKeys = function(o) {
29825
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
29826
+ var ar = [];
29827
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
29828
+ return ar;
29829
+ };
29830
+ return ownKeys(o);
29831
+ };
29832
+ return function(mod) {
29833
+ if (mod && mod.__esModule) return mod;
29834
+ var result = {};
29835
+ if (mod != null) {
29836
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
29837
+ }
29838
+ __setModuleDefault(result, mod);
29839
+ return result;
29840
+ };
29841
+ })();
27750
29842
  Object.defineProperty(exports2, "__esModule", { value: true });
27751
29843
  exports2.compile = compile;
29844
+ var fs2 = __importStar(require("fs"));
29845
+ var path3 = __importStar(require("path"));
27752
29846
  var lexer_1 = require_lexer();
27753
29847
  var parser_1 = require_parser();
27754
29848
  var compile_1 = require_compile();
27755
29849
  var diagnostics_1 = require_diagnostics();
27756
29850
  var lower_1 = require_lower();
27757
29851
  var monomorphize_1 = require_monomorphize();
29852
+ var deprecated_1 = require_deprecated();
27758
29853
  var lower_2 = require_lower2();
27759
29854
  var pipeline_1 = require_pipeline();
27760
29855
  var lower_3 = require_lower3();
@@ -27764,35 +29859,137 @@ var require_compile2 = __commonJS({
27764
29859
  var budget_1 = require_budget();
27765
29860
  var mc_version_1 = require_mc_version();
27766
29861
  var typechecker_1 = require_typechecker();
29862
+ var types_1 = require_types();
29863
+ function pruneLibraryFunctionFiles(files, libraryPaths) {
29864
+ if (libraryPaths.size === 0)
29865
+ return files;
29866
+ const fnPathToFilePath = /* @__PURE__ */ new Map();
29867
+ for (const file of files) {
29868
+ const match = file.path.match(/^data\/([^/]+)\/function\/(.+)\.mcfunction$/);
29869
+ if (match) {
29870
+ fnPathToFilePath.set(`${match[1]}:${match[2]}`, file.path);
29871
+ }
29872
+ }
29873
+ const callGraph = /* @__PURE__ */ new Map();
29874
+ const callPattern = /\bfunction\s+([\w\-]+:[\w\-./]+)/g;
29875
+ for (const file of files) {
29876
+ if (!file.path.endsWith(".mcfunction"))
29877
+ continue;
29878
+ const called = /* @__PURE__ */ new Set();
29879
+ let match;
29880
+ callPattern.lastIndex = 0;
29881
+ while ((match = callPattern.exec(file.content)) !== null) {
29882
+ called.add(match[1]);
29883
+ }
29884
+ callGraph.set(file.path, called);
29885
+ }
29886
+ const reachableFiles = /* @__PURE__ */ new Set();
29887
+ const queue = [];
29888
+ for (const file of files) {
29889
+ if (!file.path.endsWith(".mcfunction"))
29890
+ continue;
29891
+ if (libraryPaths.has(file.path))
29892
+ continue;
29893
+ queue.push(file.path);
29894
+ reachableFiles.add(file.path);
29895
+ }
29896
+ while (queue.length > 0) {
29897
+ const current = queue.shift();
29898
+ const called = callGraph.get(current) ?? /* @__PURE__ */ new Set();
29899
+ for (const fnPath of called) {
29900
+ const filePath = fnPathToFilePath.get(fnPath);
29901
+ if (filePath && !reachableFiles.has(filePath)) {
29902
+ reachableFiles.add(filePath);
29903
+ queue.push(filePath);
29904
+ }
29905
+ }
29906
+ }
29907
+ return files.filter((file) => !libraryPaths.has(file.path) || reachableFiles.has(file.path));
29908
+ }
27767
29909
  function compile(source, options = {}) {
27768
- const { namespace = "redscript", filePath, generateSourceMap = false, mcVersion = mc_version_1.DEFAULT_MC_VERSION, lenient = false, includeDirs } = options;
29910
+ const { namespace = "redscript", filePath, generateSourceMap = false, mcVersion = mc_version_1.DEFAULT_MC_VERSION, lenient = false, includeDirs, stopAfterCheck = false, debug = false } = options;
27769
29911
  const warnings = [];
27770
29912
  const preprocessed = (0, compile_1.preprocessSourceWithMetadata)(source, { filePath, includeDirs });
27771
29913
  const processedSource = preprocessed.source;
27772
- const lexer = new lexer_1.Lexer(processedSource);
27773
- const tokens = lexer.tokenize();
27774
- const parser = new parser_1.Parser(tokens, processedSource, filePath);
27775
- const ast = parser.parse(namespace);
27776
- warnings.push(...parser.warnings);
27777
- for (const li of preprocessed.libraryImports ?? []) {
27778
- const libPreprocessed = (0, compile_1.preprocessSourceWithMetadata)(li.source, { filePath: li.filePath });
27779
- const libTokens = new lexer_1.Lexer(libPreprocessed.source, li.filePath).tokenize();
27780
- const libParser = new parser_1.Parser(libTokens, libPreprocessed.source, li.filePath);
27781
- const libAst = libParser.parse(namespace);
27782
- warnings.push(...libParser.warnings);
27783
- for (const fn of libAst.declarations)
27784
- fn.isLibraryFn = true;
27785
- ast.declarations.push(...libAst.declarations);
27786
- ast.structs.push(...libAst.structs);
27787
- ast.implBlocks.push(...libAst.implBlocks);
27788
- ast.enums.push(...libAst.enums);
27789
- ast.consts.push(...libAst.consts);
27790
- ast.globals.push(...libAst.globals);
27791
- }
27792
- if (options.librarySources) {
27793
- for (const libSrc of options.librarySources) {
27794
- const libTokens = new lexer_1.Lexer(libSrc).tokenize();
27795
- const libAst = new parser_1.Parser(libTokens, libSrc).parse(namespace);
29914
+ try {
29915
+ let resolveModuleFilePath = function(modName, fromFile) {
29916
+ const candidates = [`${modName}.mcrs`, modName];
29917
+ const stdlibDir = path3.resolve(__dirname, "..", "src", "stdlib");
29918
+ for (const candidate of candidates) {
29919
+ if (fromFile) {
29920
+ const rel = path3.resolve(path3.dirname(fromFile), candidate);
29921
+ if (fs2.existsSync(rel))
29922
+ return rel;
29923
+ }
29924
+ const stdlib = path3.resolve(stdlibDir, candidate);
29925
+ if (fs2.existsSync(stdlib))
29926
+ return stdlib;
29927
+ for (const dir of includeDirs ?? []) {
29928
+ const extra = path3.resolve(dir, candidate);
29929
+ if (fs2.existsSync(extra))
29930
+ return extra;
29931
+ }
29932
+ }
29933
+ return null;
29934
+ }, mergeWholeModuleImport = function(modFilePath) {
29935
+ if (seenModuleImports.has(modFilePath))
29936
+ return;
29937
+ seenModuleImports.add(modFilePath);
29938
+ const modSource = fs2.readFileSync(modFilePath, "utf-8");
29939
+ const modPreprocessed = (0, compile_1.preprocessSourceWithMetadata)(modSource, { filePath: modFilePath, includeDirs });
29940
+ const modTokens = new lexer_1.Lexer(modPreprocessed.source, modFilePath).tokenize();
29941
+ const modParser = new parser_1.Parser(modTokens, modPreprocessed.source, modFilePath);
29942
+ const modAst = modParser.parse(namespace);
29943
+ warnings.push(...modParser.warnings);
29944
+ if (modParser.parseErrors.length > 0) {
29945
+ throw stopAfterCheck ? new diagnostics_1.DiagnosticBundleError(modParser.parseErrors) : modParser.parseErrors[0];
29946
+ }
29947
+ for (const fn of modAst.declarations)
29948
+ fn.isLibraryFn = true;
29949
+ for (const imp of modAst.imports) {
29950
+ if (imp.symbol !== void 0)
29951
+ continue;
29952
+ const nestedPath = resolveModuleFilePath(imp.moduleName, modFilePath);
29953
+ if (!nestedPath) {
29954
+ warnings.push(`[ImportWarning] Module '${imp.moduleName}' not found (imported in ${modFilePath})`);
29955
+ continue;
29956
+ }
29957
+ mergeWholeModuleImport(nestedPath);
29958
+ }
29959
+ ast.declarations.push(...modAst.declarations);
29960
+ ast.structs.push(...modAst.structs);
29961
+ ast.implBlocks.push(...modAst.implBlocks);
29962
+ ast.enums.push(...modAst.enums);
29963
+ ast.consts.push(...modAst.consts);
29964
+ ast.globals.push(...modAst.globals);
29965
+ };
29966
+ const lexer = new lexer_1.Lexer(processedSource);
29967
+ const tokens = lexer.tokenize();
29968
+ const parser = new parser_1.Parser(tokens, processedSource, filePath);
29969
+ const ast = parser.parse(namespace);
29970
+ warnings.push(...parser.warnings);
29971
+ if (parser.parseErrors.length > 0) {
29972
+ throw stopAfterCheck ? new diagnostics_1.DiagnosticBundleError(parser.parseErrors) : parser.parseErrors[0];
29973
+ }
29974
+ const seenModuleImports = /* @__PURE__ */ new Set();
29975
+ for (const imp of ast.imports) {
29976
+ if (imp.symbol !== void 0)
29977
+ continue;
29978
+ const resolved = resolveModuleFilePath(imp.moduleName, filePath);
29979
+ if (!resolved) {
29980
+ throw new diagnostics_1.DiagnosticError("ParseError", `Module '${imp.moduleName}' not found. Make sure '${imp.moduleName}.mcrs' exists relative to this file or in the stdlib.`, imp.span ?? { line: 1, col: 1 });
29981
+ }
29982
+ mergeWholeModuleImport(resolved);
29983
+ }
29984
+ for (const li of preprocessed.libraryImports ?? []) {
29985
+ const libPreprocessed = (0, compile_1.preprocessSourceWithMetadata)(li.source, { filePath: li.filePath });
29986
+ const libTokens = new lexer_1.Lexer(libPreprocessed.source, li.filePath).tokenize();
29987
+ const libParser = new parser_1.Parser(libTokens, libPreprocessed.source, li.filePath);
29988
+ const libAst = libParser.parse(namespace);
29989
+ warnings.push(...libParser.warnings);
29990
+ if (libParser.parseErrors.length > 0) {
29991
+ throw stopAfterCheck ? new diagnostics_1.DiagnosticBundleError(libParser.parseErrors) : libParser.parseErrors[0];
29992
+ }
27796
29993
  for (const fn of libAst.declarations)
27797
29994
  fn.isLibraryFn = true;
27798
29995
  ast.declarations.push(...libAst.declarations);
@@ -27802,34 +29999,90 @@ var require_compile2 = __commonJS({
27802
29999
  ast.consts.push(...libAst.consts);
27803
30000
  ast.globals.push(...libAst.globals);
27804
30001
  }
27805
- }
27806
- {
27807
- const checker = new typechecker_1.TypeChecker(processedSource, filePath);
27808
- const typeErrors = checker.check(ast);
27809
- warnings.push(...checker.getWarnings());
27810
- if (typeErrors.length > 0) {
27811
- if (lenient) {
27812
- for (const e of typeErrors) {
27813
- warnings.push(`[TypeError] line ${e.location.line}, col ${e.location.col}: ${e.message}`);
30002
+ if (options.librarySources) {
30003
+ for (const libSrc of options.librarySources) {
30004
+ const libTokens = new lexer_1.Lexer(libSrc).tokenize();
30005
+ const libParser = new parser_1.Parser(libTokens, libSrc);
30006
+ const libAst = libParser.parse(namespace);
30007
+ warnings.push(...libParser.warnings);
30008
+ if (libParser.parseErrors.length > 0) {
30009
+ throw stopAfterCheck ? new diagnostics_1.DiagnosticBundleError(libParser.parseErrors) : libParser.parseErrors[0];
30010
+ }
30011
+ for (const fn of libAst.declarations)
30012
+ fn.isLibraryFn = true;
30013
+ ast.declarations.push(...libAst.declarations);
30014
+ ast.structs.push(...libAst.structs);
30015
+ ast.implBlocks.push(...libAst.implBlocks);
30016
+ ast.enums.push(...libAst.enums);
30017
+ ast.consts.push(...libAst.consts);
30018
+ ast.globals.push(...libAst.globals);
30019
+ }
30020
+ }
30021
+ {
30022
+ const configValues = options.config ?? {};
30023
+ const configGlobalNames = /* @__PURE__ */ new Set();
30024
+ for (const g of ast.globals) {
30025
+ if (g.configKey !== void 0) {
30026
+ const resolvedValue = Object.prototype.hasOwnProperty.call(configValues, g.configKey) ? configValues[g.configKey] : g.configDefault ?? 0;
30027
+ const intValue = Math.round(resolvedValue);
30028
+ ast.consts.push({
30029
+ name: g.name,
30030
+ type: { kind: "named", name: "int" },
30031
+ value: { kind: "int_lit", value: intValue },
30032
+ span: g.span
30033
+ });
30034
+ configGlobalNames.add(g.name);
30035
+ }
30036
+ }
30037
+ if (configGlobalNames.size > 0) {
30038
+ ast.globals = ast.globals.filter((g) => !configGlobalNames.has(g.name));
30039
+ }
30040
+ }
30041
+ {
30042
+ const checker = new typechecker_1.TypeChecker(processedSource, filePath);
30043
+ const typeErrors = checker.check(ast);
30044
+ warnings.push(...checker.getWarnings());
30045
+ if (typeErrors.length > 0) {
30046
+ if (lenient) {
30047
+ for (const e of typeErrors) {
30048
+ warnings.push(`[TypeError] line ${e.location.line}, col ${e.location.col}: ${e.message}`);
30049
+ }
30050
+ } else {
30051
+ throw stopAfterCheck ? new diagnostics_1.DiagnosticBundleError(typeErrors) : typeErrors[0];
27814
30052
  }
27815
- } else {
27816
- throw typeErrors[0];
27817
30053
  }
27818
30054
  }
27819
- }
27820
- try {
27821
30055
  const hirRaw = (0, lower_1.lowerToHIR)(ast);
27822
30056
  const hir = (0, monomorphize_1.monomorphize)(hirRaw);
30057
+ const libraryFilePaths = new Set(hir.functions.filter((fn) => fn.isLibraryFn && fn.decorators.length === 0).map((fn) => `data/${namespace}/function/${fn.name}.mcfunction`));
30058
+ warnings.push(...(0, deprecated_1.checkDeprecatedCalls)(hir));
30059
+ if (stopAfterCheck) {
30060
+ return { files: [], warnings, success: true };
30061
+ }
27823
30062
  const tickFunctions = [];
27824
30063
  const loadFunctions = [];
30064
+ const watchFunctions = [];
30065
+ const inlineFunctions = /* @__PURE__ */ new Set();
27825
30066
  const coroutineInfos = [];
27826
30067
  const scheduleFunctions = [];
30068
+ const profiledFunctions = [];
30069
+ const eventHandlers = /* @__PURE__ */ new Map();
27827
30070
  for (const fn of hir.functions) {
30071
+ if (fn.watchObjective) {
30072
+ watchFunctions.push({ name: fn.name, objective: fn.watchObjective });
30073
+ } else {
30074
+ const watchDec = fn.decorators?.find((d) => d.name === "watch" && d.args?.objective);
30075
+ if (watchDec?.args?.objective) {
30076
+ watchFunctions.push({ name: fn.name, objective: watchDec.args.objective });
30077
+ }
30078
+ }
27828
30079
  for (const dec of fn.decorators) {
27829
30080
  if (dec.name === "tick")
27830
30081
  tickFunctions.push(fn.name);
27831
30082
  if (dec.name === "load")
27832
30083
  loadFunctions.push(fn.name);
30084
+ if (dec.name === "inline")
30085
+ inlineFunctions.add(fn.name);
27833
30086
  if (dec.name === "coroutine") {
27834
30087
  coroutineInfos.push({
27835
30088
  fnName: fn.name,
@@ -27840,9 +30093,23 @@ var require_compile2 = __commonJS({
27840
30093
  if (dec.name === "schedule") {
27841
30094
  scheduleFunctions.push({ name: fn.name, ticks: dec.args?.ticks ?? 1 });
27842
30095
  }
30096
+ if (dec.name === "profile") {
30097
+ profiledFunctions.push(fn.name);
30098
+ }
30099
+ if (dec.name === "on" && dec.args?.eventType) {
30100
+ const evType = dec.args.eventType;
30101
+ if ((0, types_1.isEventTypeName)(evType)) {
30102
+ if (!eventHandlers.has(evType))
30103
+ eventHandlers.set(evType, []);
30104
+ eventHandlers.get(evType).push(`${namespace}:${fn.name}`);
30105
+ }
30106
+ }
27843
30107
  }
27844
30108
  }
27845
30109
  const mir = (0, lower_2.lowerToMIR)(hir, filePath);
30110
+ if (inlineFunctions.size > 0) {
30111
+ mir.inlineFunctions = inlineFunctions;
30112
+ }
27846
30113
  const mirOpt = (0, pipeline_1.optimizeModule)(mir);
27847
30114
  const coroResult = (0, coroutine_1.coroutineTransform)(mirOpt, coroutineInfos);
27848
30115
  const mirFinal = coroResult.module;
@@ -27867,15 +30134,90 @@ var require_compile2 = __commonJS({
27867
30134
  }
27868
30135
  }
27869
30136
  }
27870
- const files = (0, index_1.emit)(lirOpt, { namespace, tickFunctions, loadFunctions, scheduleFunctions, generateSourceMap, mcVersion });
27871
- return { files, warnings, success: true };
30137
+ const singletonObjectives = [];
30138
+ for (const s of hir.structs) {
30139
+ if (!s.isSingleton)
30140
+ continue;
30141
+ const structName = s.name;
30142
+ const objective = lirOpt.objective;
30143
+ const getInstrs = [];
30144
+ for (const field of s.fields) {
30145
+ const fieldObj = singletonObjectiveName(structName, field.name);
30146
+ if (!singletonObjectives.includes(fieldObj)) {
30147
+ singletonObjectives.push(fieldObj);
30148
+ }
30149
+ getInstrs.push({
30150
+ kind: "score_copy",
30151
+ dst: { player: `$__rf_${field.name}`, obj: objective },
30152
+ src: { player: `__sng`, obj: fieldObj }
30153
+ });
30154
+ }
30155
+ getInstrs.push({ kind: "score_set", dst: { player: "$ret", obj: objective }, value: 0 });
30156
+ lirOpt.functions.push({
30157
+ name: `${structName}::get`,
30158
+ instructions: getInstrs,
30159
+ isMacro: false,
30160
+ macroParams: []
30161
+ });
30162
+ const setInstrs = [];
30163
+ for (let i = 0; i < s.fields.length; i++) {
30164
+ const field = s.fields[i];
30165
+ const fieldObj = singletonObjectiveName(structName, field.name);
30166
+ setInstrs.push({
30167
+ kind: "score_copy",
30168
+ dst: { player: `__sng`, obj: fieldObj },
30169
+ src: { player: `$p${i}`, obj: objective }
30170
+ });
30171
+ }
30172
+ setInstrs.push({ kind: "score_set", dst: { player: "$ret", obj: objective }, value: 0 });
30173
+ lirOpt.functions.push({
30174
+ name: `${structName}::set`,
30175
+ instructions: setInstrs,
30176
+ isMacro: false,
30177
+ macroParams: []
30178
+ });
30179
+ }
30180
+ const files = (0, index_1.emit)(lirOpt, {
30181
+ namespace,
30182
+ tickFunctions,
30183
+ loadFunctions,
30184
+ watchFunctions,
30185
+ scheduleFunctions,
30186
+ generateSourceMap,
30187
+ mcVersion,
30188
+ eventHandlers,
30189
+ singletonObjectives,
30190
+ profiledFunctions,
30191
+ enableProfiling: debug
30192
+ });
30193
+ const prunedFiles = pruneLibraryFunctionFiles(files, libraryFilePaths);
30194
+ return { files: prunedFiles, warnings, success: true };
27872
30195
  } catch (err) {
30196
+ if (stopAfterCheck) {
30197
+ if (err instanceof diagnostics_1.CheckFailedError)
30198
+ throw err;
30199
+ if (err instanceof diagnostics_1.DiagnosticBundleError) {
30200
+ throw new diagnostics_1.CheckFailedError(err.diagnostics, warnings);
30201
+ }
30202
+ if (err instanceof diagnostics_1.DiagnosticError) {
30203
+ throw new diagnostics_1.CheckFailedError([err], warnings);
30204
+ }
30205
+ const sourceLines2 = processedSource.split("\n");
30206
+ throw new diagnostics_1.CheckFailedError([(0, diagnostics_1.parseErrorMessage)("LoweringError", err.message, sourceLines2, filePath)], warnings);
30207
+ }
27873
30208
  if (err instanceof diagnostics_1.DiagnosticError)
27874
30209
  throw err;
27875
30210
  const sourceLines = processedSource.split("\n");
27876
30211
  throw (0, diagnostics_1.parseErrorMessage)("LoweringError", err.message, sourceLines, filePath);
27877
30212
  }
27878
30213
  }
30214
+ function singletonObjectiveName(structName, fieldName) {
30215
+ const overhead = 5;
30216
+ if (structName.length + fieldName.length <= 12) {
30217
+ return `_s_${structName}_${fieldName}`;
30218
+ }
30219
+ return `_s_${structName.slice(0, 4)}_${fieldName.slice(0, 8)}`;
30220
+ }
27879
30221
  }
27880
30222
  });
27881
30223
 
@@ -27908,6 +30250,9 @@ var require_modules = __commonJS({
27908
30250
  const tokens = lexer.tokenize();
27909
30251
  const parser = new parser_1.Parser(tokens, mod.source, mod.filePath);
27910
30252
  const ast = parser.parse(namespace);
30253
+ if (parser.parseErrors.length > 0) {
30254
+ throw parser.parseErrors[0];
30255
+ }
27911
30256
  const declaredName = ast.moduleName;
27912
30257
  if (declaredName && declaredName !== mod.name) {
27913
30258
  throw new diagnostics_1.DiagnosticError("LoweringError", `Module declares name '${declaredName}' but was registered as '${mod.name}'`, { file: mod.filePath, line: 1, col: 1 });
@@ -27932,7 +30277,9 @@ var require_modules = __commonJS({
27932
30277
  if (!sourceExports) {
27933
30278
  throw new diagnostics_1.DiagnosticError("LoweringError", `Module '${imp.moduleName}' not found (imported in '${modName}')`, { file: ast.namespace, line: 1, col: 1 });
27934
30279
  }
27935
- if (imp.symbol === "*") {
30280
+ if (imp.symbol === void 0) {
30281
+ continue;
30282
+ } else if (imp.symbol === "*") {
27936
30283
  for (const sym of sourceExports) {
27937
30284
  resolved.set(sym, `${imp.moduleName}/${sym}`);
27938
30285
  }
@@ -27951,6 +30298,8 @@ var require_modules = __commonJS({
27951
30298
  }
27952
30299
  for (const ast of parsedModules.values()) {
27953
30300
  for (const imp of ast.imports) {
30301
+ if (imp.symbol === void 0)
30302
+ continue;
27954
30303
  const used = usedExports.get(imp.moduleName);
27955
30304
  if (!used)
27956
30305
  continue;
@@ -28072,6 +30421,7 @@ var require_modules = __commonJS({
28072
30421
  const hir = (0, monomorphize_1.monomorphize)(hirRaw);
28073
30422
  const tickFunctions = [];
28074
30423
  const loadFunctions = [];
30424
+ const watchFunctions = [];
28075
30425
  const coroutineInfos = [];
28076
30426
  const scheduleFunctions = [];
28077
30427
  for (const fn of hir.functions) {
@@ -28080,6 +30430,9 @@ var require_modules = __commonJS({
28080
30430
  tickFunctions.push(fn.name);
28081
30431
  if (dec.name === "load")
28082
30432
  loadFunctions.push(fn.name);
30433
+ if (dec.name === "watch" && dec.args?.objective) {
30434
+ watchFunctions.push({ name: fn.name, objective: dec.args.objective });
30435
+ }
28083
30436
  if (dec.name === "coroutine") {
28084
30437
  coroutineInfos.push({ fnName: fn.name, batch: dec.args?.batch ?? 10, onDone: dec.args?.onDone });
28085
30438
  }
@@ -28097,7 +30450,7 @@ var require_modules = __commonJS({
28097
30450
  const lir = (0, lower_3.lowerToLIR)(mirFinal);
28098
30451
  lir.objective = objective;
28099
30452
  const lirOpt = (0, pipeline_2.lirOptimizeModule)(lir);
28100
- const files = (0, index_1.emit)(lirOpt, { namespace, tickFunctions, loadFunctions, scheduleFunctions });
30453
+ const files = (0, index_1.emit)(lirOpt, { namespace, tickFunctions, loadFunctions, watchFunctions, scheduleFunctions });
28101
30454
  if (moduleName) {
28102
30455
  const loadPath = `data/${namespace}/function/load.mcfunction`;
28103
30456
  const newLoadPath = `data/${namespace}/function/${moduleName}/_load.mcfunction`;
@@ -28208,8 +30561,8 @@ var require_modules = __commonJS({
28208
30561
  case "match":
28209
30562
  rewriteExpr(stmt.expr, symbolMap);
28210
30563
  for (const arm of stmt.arms) {
28211
- if (arm.pattern)
28212
- rewriteExpr(arm.pattern, symbolMap);
30564
+ if (arm.pattern.kind === "PatExpr")
30565
+ rewriteExpr(arm.pattern.expr, symbolMap);
28213
30566
  rewriteBlock(arm.body, symbolMap);
28214
30567
  }
28215
30568
  break;
@@ -28733,11 +31086,17 @@ var require_cache = __commonJS({
28733
31086
  save() {
28734
31087
  fs2.mkdirSync(this.cacheDir, { recursive: true });
28735
31088
  const serialized = {
28736
- version: 1,
31089
+ version: 2,
28737
31090
  entries: {}
28738
31091
  };
28739
31092
  for (const [filePath, entry] of this.entries) {
28740
- serialized.entries[filePath] = { hash: entry.hash, mtime: entry.mtime };
31093
+ serialized.entries[filePath] = {
31094
+ hash: entry.hash,
31095
+ mtime: entry.mtime,
31096
+ compiledFunctions: entry.compiledFunctions,
31097
+ outputFiles: entry.outputFiles,
31098
+ dependencies: entry.dependencies
31099
+ };
28741
31100
  }
28742
31101
  const cachePath = path3.join(this.cacheDir, "cache.json");
28743
31102
  fs2.writeFileSync(cachePath, JSON.stringify(serialized, null, 2));
@@ -28747,10 +31106,16 @@ var require_cache = __commonJS({
28747
31106
  const cachePath = path3.join(this.cacheDir, "cache.json");
28748
31107
  try {
28749
31108
  const data = JSON.parse(fs2.readFileSync(cachePath, "utf-8"));
28750
- if (data.version !== 1)
31109
+ if (data.version !== 2)
28751
31110
  return;
28752
31111
  for (const [filePath, entry] of Object.entries(data.entries)) {
28753
- this.entries.set(filePath, { hash: entry.hash, mtime: entry.mtime });
31112
+ this.entries.set(filePath, {
31113
+ hash: entry.hash,
31114
+ mtime: entry.mtime,
31115
+ compiledFunctions: entry.compiledFunctions,
31116
+ outputFiles: entry.outputFiles,
31117
+ dependencies: entry.dependencies
31118
+ });
28754
31119
  }
28755
31120
  } catch {
28756
31121
  }
@@ -28961,101 +31326,137 @@ var require_incremental = __commonJS({
28961
31326
  Object.defineProperty(exports2, "__esModule", { value: true });
28962
31327
  exports2.compileIncremental = compileIncremental;
28963
31328
  exports2.resetCompileCache = resetCompileCache;
31329
+ var fs2 = __importStar(require("fs"));
28964
31330
  var path3 = __importStar(require("path"));
28965
31331
  var compile_1 = require_compile2();
28966
- var fs2 = __importStar(require("fs"));
28967
- var compiledCache = /* @__PURE__ */ new Map();
31332
+ var deps_1 = require_deps();
28968
31333
  function compileIncremental(files, cache, depGraph, options) {
31334
+ const start = Date.now();
31335
+ const normalizedEntries = [...new Set(files.map((file) => path3.resolve(file)))];
28969
31336
  const result = {
28970
31337
  recompiled: 0,
28971
31338
  cached: 0,
28972
31339
  errors: /* @__PURE__ */ new Map(),
28973
- results: /* @__PURE__ */ new Map()
31340
+ results: /* @__PURE__ */ new Map(),
31341
+ skippedFiles: [],
31342
+ rebuiltFiles: [],
31343
+ elapsedMs: 0
28974
31344
  };
28975
- for (const file of files) {
28976
- const absFile = path3.resolve(file);
28977
- try {
28978
- const source = fs2.readFileSync(absFile, "utf-8");
28979
- depGraph.addFile(absFile, source);
28980
- } catch {
28981
- depGraph.removeFile(absFile);
28982
- }
28983
- }
28984
- const changedSourceFiles = /* @__PURE__ */ new Set();
28985
- const allSourceFiles = /* @__PURE__ */ new Set();
28986
- for (const file of files) {
28987
- const absFile = path3.resolve(file);
28988
- const allDeps = depGraph.getTransitiveDeps(absFile);
28989
- allSourceFiles.add(absFile);
28990
- for (const dep of allDeps)
28991
- allSourceFiles.add(dep);
28992
- }
28993
- for (const sourceFile of allSourceFiles) {
28994
- if (cache.hasChanged(sourceFile)) {
28995
- changedSourceFiles.add(sourceFile);
28996
- }
31345
+ if (normalizedEntries.length === 0) {
31346
+ result.elapsedMs = Date.now() - start;
31347
+ return result;
28997
31348
  }
28998
- for (const file of files) {
28999
- const absFile = path3.resolve(file);
29000
- const allDeps = depGraph.getTransitiveDeps(absFile);
29001
- const unitFiles = [absFile, ...allDeps];
29002
- let needsRecompile = false;
29003
- const prevEntry = compiledCache.get(absFile);
29004
- if (!prevEntry) {
29005
- needsRecompile = true;
29006
- } else {
29007
- for (const unitFile of unitFiles) {
29008
- if (changedSourceFiles.has(unitFile)) {
29009
- needsRecompile = true;
29010
- break;
29011
- }
29012
- }
29013
- if (!needsRecompile && prevEntry.depHashes.size !== unitFiles.length) {
29014
- needsRecompile = true;
29015
- }
29016
- }
29017
- if (!needsRecompile) {
29018
- const cached = compiledCache.get(absFile);
29019
- writeBuildOutput(cached.result, options.output);
31349
+ depGraph.clear();
31350
+ const discoveredFiles = discoverDependencyGraph(normalizedEntries, depGraph);
31351
+ const changedFiles = /* @__PURE__ */ new Set();
31352
+ for (const file of discoveredFiles) {
31353
+ if (cache.hasChanged(file))
31354
+ changedFiles.add(file);
31355
+ }
31356
+ const dirtyFiles = depGraph.computeDirtySet(changedFiles);
31357
+ for (const entry of normalizedEntries) {
31358
+ if (!discoveredFiles.has(entry))
31359
+ dirtyFiles.add(entry);
31360
+ }
31361
+ for (const entryFile of normalizedEntries) {
31362
+ const entryDeps = depGraph.getTransitiveDeps(entryFile);
31363
+ const entryUnit = /* @__PURE__ */ new Set([entryFile, ...entryDeps]);
31364
+ const cachedEntry = cache.get(entryFile);
31365
+ const cachedDepList = new Set(cachedEntry?.dependencies ?? []);
31366
+ const hasDependencyDrift = cachedDepList.size !== entryUnit.size || [...entryUnit].some((file) => !cachedDepList.has(file));
31367
+ const canUseCache = !dirtyFiles.has(entryFile) && !hasDependencyDrift && !!cachedEntry?.outputFiles && cachedEntry.outputFiles.length > 0;
31368
+ if (canUseCache) {
31369
+ writeBuildOutput(cachedEntry.outputFiles, options.output);
29020
31370
  result.cached++;
31371
+ result.skippedFiles.push(entryFile);
29021
31372
  continue;
29022
31373
  }
29023
31374
  try {
29024
- const source = fs2.readFileSync(absFile, "utf-8");
29025
- const ns = options.namespace ?? deriveNamespace(absFile);
29026
- const compileResult = (0, compile_1.compile)(source, { namespace: ns, filePath: absFile });
29027
- const depHashes = /* @__PURE__ */ new Map();
29028
- for (const unitFile of unitFiles) {
29029
- cache.update(unitFile);
29030
- const entry = cache.get(unitFile);
29031
- if (entry)
29032
- depHashes.set(unitFile, entry.hash);
29033
- }
29034
- compiledCache.set(absFile, { result: compileResult, depHashes });
29035
- writeBuildOutput(compileResult, options.output);
31375
+ const source = fs2.readFileSync(entryFile, "utf-8");
31376
+ const ns = options.namespace ?? deriveNamespace(entryFile);
31377
+ const compileResult = (0, compile_1.compile)(source, {
31378
+ namespace: ns,
31379
+ filePath: entryFile,
31380
+ generateSourceMap: options.generateSourceMap,
31381
+ mcVersion: options.mcVersion,
31382
+ lenient: options.lenient,
31383
+ includeDirs: options.includeDirs
31384
+ });
31385
+ const outputFiles = cloneFiles(compileResult.files);
31386
+ const compiledFunctions = outputFiles.filter((file) => file.path.endsWith(".mcfunction")).map((file) => file.path);
31387
+ removeStaleOutputs(cachedEntry?.outputFiles ?? [], outputFiles, options.output);
31388
+ for (const file of entryUnit) {
31389
+ cache.update(file);
31390
+ }
31391
+ const entryRecord = cache.get(entryFile);
31392
+ if (entryRecord) {
31393
+ entryRecord.compiledFunctions = compiledFunctions;
31394
+ entryRecord.outputFiles = outputFiles;
31395
+ entryRecord.dependencies = [...entryUnit].sort();
31396
+ }
31397
+ writeBuildOutput(outputFiles, options.output);
29036
31398
  result.recompiled++;
29037
- result.results.set(absFile, compileResult);
31399
+ result.results.set(entryFile, compileResult);
31400
+ result.rebuiltFiles.push(entryFile);
29038
31401
  } catch (err) {
29039
- result.errors.set(absFile, err.message);
31402
+ result.errors.set(entryFile, err.message);
29040
31403
  }
29041
31404
  }
31405
+ cache.save();
31406
+ result.elapsedMs = Date.now() - start;
29042
31407
  return result;
29043
31408
  }
29044
- function writeBuildOutput(compileResult, output) {
31409
+ function discoverDependencyGraph(entries, depGraph) {
31410
+ const visited = /* @__PURE__ */ new Set();
31411
+ const queue = [...entries];
31412
+ while (queue.length > 0) {
31413
+ const current = path3.resolve(queue.shift());
31414
+ if (visited.has(current))
31415
+ continue;
31416
+ visited.add(current);
31417
+ try {
31418
+ const source = fs2.readFileSync(current, "utf-8");
31419
+ depGraph.addFile(current, source);
31420
+ const imports = (0, deps_1.parseImports)(current, source);
31421
+ for (const imported of imports) {
31422
+ if (!visited.has(imported))
31423
+ queue.push(imported);
31424
+ }
31425
+ } catch {
31426
+ depGraph.removeFile(current);
31427
+ }
31428
+ }
31429
+ return visited;
31430
+ }
31431
+ function cloneFiles(files) {
31432
+ return files.map((file) => ({ path: file.path, content: file.content }));
31433
+ }
31434
+ function writeBuildOutput(files, output) {
29045
31435
  fs2.mkdirSync(output, { recursive: true });
29046
- for (const dataFile of compileResult.files) {
31436
+ for (const dataFile of files) {
29047
31437
  const filePath = path3.join(output, dataFile.path);
29048
31438
  const dir = path3.dirname(filePath);
29049
31439
  fs2.mkdirSync(dir, { recursive: true });
29050
31440
  fs2.writeFileSync(filePath, dataFile.content);
29051
31441
  }
29052
31442
  }
31443
+ function removeStaleOutputs(previousFiles, nextFiles, output) {
31444
+ if (previousFiles.length === 0)
31445
+ return;
31446
+ const nextPaths = new Set(nextFiles.map((file) => file.path));
31447
+ for (const oldFile of previousFiles) {
31448
+ if (nextPaths.has(oldFile.path))
31449
+ continue;
31450
+ const targetPath = path3.join(output, oldFile.path);
31451
+ if (fs2.existsSync(targetPath))
31452
+ fs2.rmSync(targetPath, { force: true });
31453
+ }
31454
+ }
29053
31455
  function deriveNamespace(filePath) {
29054
31456
  const basename = path3.basename(filePath, path3.extname(filePath));
29055
31457
  return basename.toLowerCase().replace(/[^a-z0-9]/g, "_");
29056
31458
  }
29057
31459
  function resetCompileCache() {
29058
- compiledCache.clear();
29059
31460
  }
29060
31461
  }
29061
31462
  });
@@ -29068,8 +31469,10 @@ var require_src = __commonJS({
29068
31469
  exports2.resetCompileCache = exports2.compileIncremental = exports2.parseImports = exports2.DependencyGraph = exports2.hashFile = exports2.FileCache = exports2.MCCommandValidator = exports2.preprocessSourceWithMetadata = exports2.preprocessSource = exports2.Parser = exports2.Lexer = exports2.DEFAULT_MC_VERSION = exports2.compareMcVersion = exports2.parseMcVersion = exports2.McVersion = exports2.compileModules = exports2.compile = exports2.version = void 0;
29069
31470
  exports2.check = check;
29070
31471
  exports2.checkWithWarnings = checkWithWarnings;
31472
+ exports2.checkDetailed = checkDetailed;
29071
31473
  exports2.version = "2.0.0";
29072
31474
  var compile_1 = require_compile2();
31475
+ var diagnostics_1 = require_diagnostics();
29073
31476
  var compile_2 = require_compile2();
29074
31477
  Object.defineProperty(exports2, "compile", { enumerable: true, get: function() {
29075
31478
  return compile_2.compile;
@@ -29135,11 +31538,24 @@ var require_src = __commonJS({
29135
31538
  return checkWithWarnings(source, namespace, filePath).error;
29136
31539
  }
29137
31540
  function checkWithWarnings(source, namespace = "redscript", filePath) {
31541
+ const result = checkDetailed(source, namespace, filePath);
31542
+ return { error: result.errors[0] ?? null, warnings: result.warnings };
31543
+ }
31544
+ function checkDetailed(source, namespace = "redscript", filePath) {
29138
31545
  try {
29139
- const result = (0, compile_1.compile)(source, { namespace, filePath });
29140
- return { error: null, warnings: result.warnings };
31546
+ const result = (0, compile_1.compile)(source, { namespace, filePath, stopAfterCheck: true });
31547
+ return { errors: [], warnings: result.warnings };
29141
31548
  } catch (err) {
29142
- return { error: err, warnings: [] };
31549
+ if (err instanceof diagnostics_1.CheckFailedError) {
31550
+ return { errors: err.diagnostics, warnings: err.warnings };
31551
+ }
31552
+ if (err instanceof diagnostics_1.DiagnosticError) {
31553
+ return { errors: [err], warnings: [] };
31554
+ }
31555
+ return {
31556
+ errors: [(0, diagnostics_1.parseErrorMessage)("LoweringError", err.message, source.split("\n"), filePath)],
31557
+ warnings: []
31558
+ };
29143
31559
  }
29144
31560
  }
29145
31561
  }
@@ -30627,9 +33043,16 @@ function getCompile() {
30627
33043
  var DEBOUNCE_MS = 600;
30628
33044
  var lspClient;
30629
33045
  function resolveLspServerPath() {
33046
+ const fs2 = require("fs");
33047
+ try {
33048
+ const bundled = path2.join(__dirname, "lsp-server.js");
33049
+ fs2.accessSync(bundled);
33050
+ return bundled;
33051
+ } catch {
33052
+ }
30630
33053
  try {
30631
33054
  const candidate = path2.join(__dirname, "..", "node_modules", "redscript", "dist", "src", "lsp", "main.js");
30632
- require("fs").accessSync(candidate);
33055
+ fs2.accessSync(candidate);
30633
33056
  return candidate;
30634
33057
  } catch {
30635
33058
  return null;
@@ -30659,9 +33082,9 @@ function activate(context) {
30659
33082
  context.subscriptions.push({ dispose: () => lspClient?.stop() });
30660
33083
  } else {
30661
33084
  activateFallbackDiagnostics(context);
33085
+ registerHoverProvider(context);
33086
+ registerCompletionProvider(context);
30662
33087
  }
30663
- registerHoverProvider(context);
30664
- registerCompletionProvider(context);
30665
33088
  registerCodeActions(context);
30666
33089
  registerSymbolProviders(context);
30667
33090
  const statusBar = vscode5.window.createStatusBarItem(vscode5.StatusBarAlignment.Left, 10);