202608260028

This commit is contained in:
starcells committed 2026-08-26 00:28:08 +08:00
1 parent 53cbf0ccc3
commit c450ab3f45
1 file changed
+6 -5
+6 -5
View File
@@ -72,10 +72,10 @@ r8asm::general_data r8asm::ast::read_parameter(std::string index_str) {
return scopes.back().at('%' + index_str);
}
// TODO: FILL THE BLANK
#define ADD_ROT8_PR(INS) std::string("rot8_") + INS
#define ROT8_NODE(INS) \
{ \
r8asm::ast_node_t::ROT8, std::string("rot8_") + INS, {} \
r8asm::ast_node_t::ROT8, ADD_ROT8_PR(INS), {} \
}
std::vector<r8asm::ast_node>
r8asm::ast::expand_node_to_ins(const ast_node &node) {
@@ -83,9 +83,9 @@ r8asm::ast::expand_node_to_ins(const ast_node &node) {
switch (node.type) {
case ast_node_t::ROT8: {
to_return = {node};
if (node.value == "stp")
if (node.value == ADD_ROT8_PR("stp"))
dataptr++;
if (node.value == "btp")
if (node.value == ADD_ROT8_PR("btp"))
dataptr--;
} break;
case ast_node_t::REPEAT: {
@@ -207,4 +207,5 @@ r8asm::ast::expand_node_to_ins(const ast_node &node) {
}
return to_return;
}
#undef ROT8_NODE
#undef ROT8_NODE
#undef ADD_ROT8_PR