Last active
October 9, 2024 19:38
-
-
Save RedstoneWizard08/0b27c57bfe05e3e22627e77b3771acfe to your computer and use it in GitHub Desktop.
monstrosity in DPIR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the example program's IR as of October 9, 2024! | |
// Normal version: https://github.com/RedstoneWizard08/DPScript/blob/main/example/src/example.dps | |
// From looking at it right now, it looks correct :D | |
// Yes, this does include the standard library (which is still very incomplete) | |
define variable_alias __RETURN_VAL__: "dpscript:core/funcs" @ "return_value"; | |
func "example:__dpscript_gen/example/funcs/say_hi": { | |
define variable_alias __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4: "dpscript:core/vars" @ "__tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4"; | |
define variable_alias __var_text: "dpscript:core/vars" @ "__var_text"; | |
data set: __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4, '[]'; | |
data append: __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4, '{"text":"Hello, ","color":"green"}'; | |
data append: __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4, '{"color":"red","selector":"@s"}'; | |
data append: __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4, '{"text": "!"}'; | |
data copy: __tmp_var_75e2946a_6731_4d3b_b8f4_e0ec57a803f4, __var_text; | |
command: 'tellraw', '@s', '["",', '{"interpret":true,"nbt":"__var_text","storage":"dpscript:core/vars"}', ']'; | |
} | |
func "example:__dpscript_gen/example/blocks/init/0": { | |
define variable_alias __tmp_var_115a9416_2674_4f14_8892_f680afd06a9b: "dpscript:core/vars" @ "__tmp_var_115a9416_2674_4f14_8892_f680afd06a9b"; | |
define variable_alias __tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0: "dpscript:core/vars" @ "__tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0"; | |
define variable_alias __tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925: "dpscript:core/vars" @ "__tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925"; | |
define variable_alias __tmp_var_a3797da5_53dd_48df_adee_e1bbc68b1102: "dpscript:core/vars" @ "__tmp_var_a3797da5_53dd_48df_adee_e1bbc68b1102"; | |
define variable_alias __tmp_var_cd138053_fef1_42d4_9409_21f54dfe40d4: "dpscript:core/vars" @ "__tmp_var_cd138053_fef1_42d4_9409_21f54dfe40d4"; | |
define variable_alias __var_calc_msg: "dpscript:core/vars" @ "__var_calc_msg"; | |
define variable_alias __var_data: "dpscript:core/vars" @ "__var_data"; | |
define variable_alias __var_msg: "dpscript:core/vars" @ "__var_msg"; | |
argument set: 0, '100'; | |
call: "example:__dpscript_gen/std/funcs/sqrt"; | |
data copy: __RETURN_VAL__, __var_data; | |
data set: __tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0, '[]'; | |
data append: __tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0, '{"text": "The square root of 100 is: "}'; | |
data append: __tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0, __var_data; | |
data copy: __tmp_var_1df4f588_bcef_401e_a590_5f68d57d4ad0, __var_msg; | |
data set: __tmp_var_a3797da5_53dd_48df_adee_e1bbc68b1102, '[]'; | |
data append: __tmp_var_a3797da5_53dd_48df_adee_e1bbc68b1102, '{"color":"green","text":"Hello, world!"}'; | |
command: 'tellraw', '@a', '["",', '{"interpret":true,"nbt":"__tmp_var_a3797da5_53dd_48df_adee_e1bbc68b1102","storage":"dpscript:core/vars"}', ']'; | |
command: 'tellraw', '@a', '["",', '{"interpret":true,"nbt":"__var_msg","storage":"dpscript:core/vars"}', ']'; | |
data set: __tmp_var_115a9416_2674_4f14_8892_f680afd06a9b, '[]'; | |
data append: __tmp_var_115a9416_2674_4f14_8892_f680afd06a9b, '{"text": "The square root of 100 is: "}'; | |
argument set: 0, '1'; | |
argument set: 1, '2'; | |
argument get: 0, __tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925; | |
argument get: 1, __tmp_var_cd138053_fef1_42d4_9409_21f54dfe40d4; | |
command: 'execute', 'store', 'result', 'score', '__dpscript_temp', '__dpscript_score_7b5a1a69_3199_44e0_b4f8_6089006486ed', 'run', 'data', 'get', 'storage', '"dpscript:core/vars"', '__tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925'; | |
command: 'execute', 'store', 'result', 'score', '__dpscript_temp', '__dpscript_score_49129e74_0cd4_4f10_9bac_fb32e6fd3be9', 'run', 'data', 'get', 'storage', '"dpscript:core/vars"', '__tmp_var_cd138053_fef1_42d4_9409_21f54dfe40d4'; | |
command: 'scoreboard', 'players', 'operation', '__dpscript_temp', '__dpscript_score_7b5a1a69_3199_44e0_b4f8_6089006486ed', '+=', '__dpscript_temp', '__dpscript_score_49129e74_0cd4_4f10_9bac_fb32e6fd3be9'; | |
command: 'execute', 'store', 'result', 'storage', '"dpscript:core/vars"', '__tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925', 'int', '1', 'run', 'scoreboard', 'players', 'get', '__dpscript_temp', '__dpscript_score_7b5a1a69_3199_44e0_b4f8_6089006486ed'; | |
data copy: __tmp_var_931f8e30_8fcc_4837_94fd_6fdfdb31f925, __RETURN_VAL__; | |
data append: __tmp_var_115a9416_2674_4f14_8892_f680afd06a9b, __RETURN_VAL__; | |
data copy: __tmp_var_115a9416_2674_4f14_8892_f680afd06a9b, __var_calc_msg; | |
command: 'tellraw', '@a', '["",', '{"interpret":true,"nbt":"__var_calc_msg","storage":"dpscript:core/vars"}', ']'; | |
execute: "@a", $block1; | |
$block0: { | |
} | |
$block1: { | |
call: "example:__dpscript_gen/example/funcs/say_hi"; | |
goto: $block0; | |
} | |
} | |
func "example:__dpscript_gen/example/blocks/init/0": { | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_score_7b5a1a69_3199_44e0_b4f8_6089006486ed', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_score_49129e74_0cd4_4f10_9bac_fb32e6fd3be9', 'dummy'; | |
} | |
func "example:__dpscript_gen/std/blocks/init/0": { | |
define variable_alias __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30: "dpscript:core/vars" @ "__tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30"; | |
define variable_alias __tmp_var_7e3c0df3_7a93_463c_acb0_062a00c6dbd4: "dpscript:core/vars" @ "__tmp_var_7e3c0df3_7a93_463c_acb0_062a00c6dbd4"; | |
define variable_alias __tmp_var_bc97cb60_d707_4ace_9ddf_4a4dbb4df9c3: "dpscript:core/vars" @ "__tmp_var_bc97cb60_d707_4ace_9ddf_4a4dbb4df9c3"; | |
define variable_alias __tmp_var_ecdf2bb9_1557_43d7_bc8f_06f9925fe26a: "dpscript:core/vars" @ "__tmp_var_ecdf2bb9_1557_43d7_bc8f_06f9925fe26a"; | |
command: 'execute store success storage dpscript:core/funcs return_value execute unless score', 'enable_std_hello', 'config', 'matches', '0'; | |
data copy: __RETURN_VAL__, __tmp_var_ecdf2bb9_1557_43d7_bc8f_06f9925fe26a; | |
command: 'execute', 'store', 'result', 'score', '__dpscript_temp', '__dpscript_score_e0296d03_e30d_4beb_a700_d022eb6969c4', 'run', 'data', 'get', 'storage', '"dpscript:core/vars"', '__tmp_var_ecdf2bb9_1557_43d7_bc8f_06f9925fe26a'; | |
condition: '__dpscript_score_e0296d03_e30d_4beb_a700_d022eb6969c4'; | |
if: $block0; | |
else: $block1; | |
join: $block2; | |
$block0: { | |
command: 'scoreboard players set', 'enable_std_hello', 'config', '0'; | |
goto: $block2; | |
} | |
$block1: { | |
goto: $block2; | |
} | |
$block2: { | |
command: 'execute store success storage dpscript:core/funcs return_value execute unless score', 'enable_std_hello', 'config', 'matches', '1'; | |
data copy: __RETURN_VAL__, __tmp_var_bc97cb60_d707_4ace_9ddf_4a4dbb4df9c3; | |
command: 'execute', 'store', 'result', 'score', '__dpscript_temp', '__dpscript_score_1d7acb23_dcae_42f9_ab85_5f49b0ad3fc1', 'run', 'data', 'get', 'storage', '"dpscript:core/vars"', '__tmp_var_bc97cb60_d707_4ace_9ddf_4a4dbb4df9c3'; | |
condition: '__dpscript_score_1d7acb23_dcae_42f9_ab85_5f49b0ad3fc1'; | |
if: $block3; | |
else: $block4; | |
join: $block5; | |
} | |
$block3: { | |
data set: __tmp_var_7e3c0df3_7a93_463c_acb0_062a00c6dbd4, '[]'; | |
data append: __tmp_var_7e3c0df3_7a93_463c_acb0_062a00c6dbd4, '{"bold":true,"text":"Thank you for using DPScript!"}'; | |
command: 'tellraw', '@a', '["",', '{"interpret":true,"nbt":"__tmp_var_7e3c0df3_7a93_463c_acb0_062a00c6dbd4","storage":"dpscript:core/vars"}', ']'; | |
data set: __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30, '[]'; | |
data append: __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30, '{"bold":true,"color":"gold","text":"Hint: "}'; | |
data append: __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30, '{"text":"You can disable this message by running:\\n","color":"dark_aqua"}'; | |
data append: __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30, '{"color":"gray","text":"/scoreboard players set config enable_std_hello 0\\n","bold":true}'; | |
data append: __tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30, '{"text":"[Click to copy!]","color":"dark_aqua","hoverEvent":{"action":"show_text","contents":["Copy: /scoreboard players set config enable_std_hello 0"]},"clickEvent":{"action":"copy_to_clipboard","value":"/scoreboard players set config enable_std_hello 0"},"bold":true}'; | |
command: 'tellraw', '@a', '["",', '{"interpret":true,"nbt":"__tmp_var_3000b9f4_df10_4b86_b464_0a1d9749ce30","storage":"dpscript:core/vars"}', ']'; | |
goto: $block5; | |
} | |
$block4: { | |
goto: $block5; | |
} | |
$block5: { | |
} | |
} | |
func "example:__dpscript_gen/std/blocks/init/0": { | |
command: 'scoreboard', 'objectives', 'add', 'enable_std_hello', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_score_e0296d03_e30d_4beb_a700_d022eb6969c4', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_score_1d7acb23_dcae_42f9_ab85_5f49b0ad3fc1', 'dummy'; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/sqrt": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/sqrt', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/sqrt', 'temp_val', 'sqrt'; | |
command: 'data modify storage', 'dpscript:temp/ops/sqrt', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/sin": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/sin', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/sin', 'temp_val', 'sin'; | |
command: 'data modify storage', 'dpscript:temp/ops/sin', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/cos": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/cos', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/cos', 'temp_val', 'cos'; | |
command: 'data modify storage', 'dpscript:temp/ops/cos', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/tan": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/tan', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/tan', 'temp_val', 'tan'; | |
command: 'data modify storage', 'dpscript:temp/ops/tan', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/asin": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/asin', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/asin', 'temp_val', 'asin'; | |
command: 'data modify storage', 'dpscript:temp/ops/asin', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/acos": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/acos', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/acos', 'temp_val', 'acos'; | |
command: 'data modify storage', 'dpscript:temp/ops/acos', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/advops/funcs/atan": { | |
define variable_alias __var_num: "__var_num" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_num; | |
command: 'data modify storage', 'dpscript:temp/ops/atan', 'temp_val', 'set value', __var_num; | |
command: 'data advops storage', 'dpscript:temp/ops/atan', 'temp_val', 'atan'; | |
command: 'data modify storage', 'dpscript:temp/ops/atan', 'temp_val', 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __RETURN_VAL__; | |
} | |
func "example:__dpscript_gen/std/array/funcs/array_add": { | |
define variable_alias __var_add: "__var_add" @ "example:__dpscript/vars/local"; | |
define variable_alias __var_arr: "__var_arr" @ "example:__dpscript/vars/local"; | |
argument get: 0, __var_arr; | |
argument get: 1, __var_add; | |
command: 'execute store result score', '__dpscript_tmp_array_add_length', '__dpscript_temp', 'run data get storage', 'dpscript:arrays/length', path!(__var_arr); | |
command: 'data modify storage', store!(__var_arr), path!(__var_arr), 'append from storage', store!(__var_add), path!(__var_add); | |
command: 'scoreboard players add', '__dpscript_tmp_array_add_length', '__dpscript_temp', '1'; | |
command: 'execute store result storage', store!(__var_arr), path!(__var_arr), 'int 1 run scoreboard players get', '__dpscript_tmp_array_add_length', '__dpscript_temp'; | |
command: 'scoreboard players reset', '__dpscript_tmp_array_add_length', '__dpscript_temp'; | |
} | |
func "example:__dpscript_gen/std/array/funcs/array_add_all": { | |
define variable_alias __tmp_var_e0f126a2_6292_473a_873a_8c6067a99f80: "dpscript:core/vars" @ "__tmp_var_e0f126a2_6292_473a_873a_8c6067a99f80"; | |
define variable_alias __var_add: "__var_add" @ "example:__dpscript/vars/local"; | |
define variable_alias __var_addCopy: "dpscript:core/vars" @ "__var_addCopy"; | |
define variable_alias __var_arr: "__var_arr" @ "example:__dpscript/vars/local"; | |
define variable_alias __var_arrCopy: "dpscript:core/vars" @ "__var_arrCopy"; | |
argument get: 0, __var_arr; | |
argument get: 1, __var_add; | |
command: 'execute store result score', '__dpscript_tmp_array_add_length', '__dpscript_temp', 'run data get storage', 'dpscript:arrays/length', path!(__var_arr); | |
command: 'execute store result score', '__dpscript_tmp_array_output_len', '__dpscript_temp', 'run data get storage', 'dpscript:arrays/length', path!(__var_arr); | |
command: 'execute store result score', '__dpscript_tmp_array_input_len', '__dpscript_temp', 'run data get storage', 'dpscript:arrays/length', path!(__var_add); | |
command: 'scoreboard players set', '__dpscript_tmp_array_add_pos', '__dpscript_temp', '0'; | |
command: 'data modify storage', store!(__var_arr), path!(__var_arr), 'set from storage', 'dpscript:temp', 'arr_copy'; | |
command: 'data modify storage', store!(__var_add), path!(__var_add), 'set from storage', 'dpscript:temp', 'add_copy'; | |
command: 'data modify storage', 'dpscript:temp', __var_pat, 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __var_arrCopy; | |
command: 'data modify storage', 'dpscript:temp', __var_pat, 'set from storage', store!(__var___RETURN_VAL__), path!(__var___RETURN_VAL__); | |
data copy: __RETURN_VAL__, __var_addCopy; | |
goto: $__sub_appender; | |
command: 'data modify storage', store!(__var_arr), path!(__var_arr), 'set value', __var_arrCopy; | |
command: 'scoreboard players reset', '__dpscript_tmp_array_add_length', '__dpscript_temp'; | |
command: 'scoreboard players reset', '__dpscript_tmp_array_add_pos', '__dpscript_temp'; | |
command: 'scoreboard players operation', '__dpscript_tmp_array_output_len', '__dpscript_temp', '+=', '__dpscript_tmp_array_input_len', '__dpscript_temp'; | |
command: 'execute store result storage', 'dpscript:arrays/length', path!(__var_arr), 'int 1 run scoreboard players get', '__dpscript_tmp_array_output_len', '__dpscript_temp'; | |
command: 'scoreboard players reset', '__dpscript_tmp_array_output_len', '__dpscript_temp'; | |
command: 'scoreboard players reset', '__dpscript_tmp_array_input_len', '__dpscript_temp'; | |
$block2: { | |
goto: $__sub_appender; | |
goto: $block4; | |
} | |
$block3: { | |
goto: $block4; | |
} | |
$block4: { | |
} | |
$__sub_appender: { | |
command: 'data modify storage', 'dpscript:temp', 'arr_copy', 'append from storage', 'dpscript:temp', 'add_copy', '[', '0', ']'; | |
command: 'data remove storage', 'dpscript:temp', 'add_copy', '[', '0', ']'; | |
command: 'scoreboard players add', '__dpscript_tmp_array_add_pos', '__dpscript_temp', '1'; | |
command: 'execute store success storage dpscript:core/funcs return_value execute if score', '__dpscript_tmp_array_add_pos', '__dpscript_temp', '<', '__dpscript_tmp_array_add_length', '__dpscript_temp'; | |
data copy: __RETURN_VAL__, __tmp_var_e0f126a2_6292_473a_873a_8c6067a99f80; | |
command: 'execute', 'store', 'result', 'score', '__dpscript_temp', '__dpscript_score_e4ba1b11_e59f_4d74_a701_93a9c6394526', 'run', 'data', 'get', 'storage', '"dpscript:core/vars"', '__tmp_var_e0f126a2_6292_473a_873a_8c6067a99f80'; | |
condition: '__dpscript_score_e4ba1b11_e59f_4d74_a701_93a9c6394526'; | |
if: $block2; | |
else: $block3; | |
join: $block4; | |
} | |
$block1: { | |
} | |
} | |
func "example:__dpscript_gen/std/array/blocks/init/0": { | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_tmp_array_add_length', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_tmp_array_add_pos', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_tmp_array_input_len', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_tmp_array_output_len', 'dummy'; | |
command: 'scoreboard', 'objectives', 'add', '__dpscript_score_e4ba1b11_e59f_4d74_a701_93a9c6394526', 'dummy'; | |
} | |
tag "minecraft:tags/functions/load": [ | |
"example:__dpscript_gen/example/blocks/init/0"; | |
"example:__dpscript_gen/example/blocks/init/0"; | |
"example:__dpscript_gen/std/blocks/init/0"; | |
"example:__dpscript_gen/std/blocks/init/0"; | |
"example:__dpscript_gen/std/array/blocks/init/0"; | |
]; | |
tag "minecraft:tags/functions/tick": [ | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment