refactor(AST): improve literals

Changed literal node to templated class and literals to aliases.
This commit is contained in:
2026-06-03 14:13:28 +02:00
parent 52537e0955
commit d50bfc868f
6 changed files with 79 additions and 154 deletions
+2 -2
View File
@@ -72,12 +72,12 @@ void ir_generator::visit(const ast::compound_statement_node& node) {
}
void ir_generator::visit(const ast::string_literal_node& node) {
push<furlang::ir::assign_instruction>(ir::operand::new_string(std::string(*node.value())),
push<furlang::ir::assign_instruction>(ir::operand::new_string(node.value()),
ir::operand::new_reg(m_registerCounter++));
}
void ir_generator::visit(const ast::integer_literal_node& node) {
push<furlang::ir::assign_instruction>(ir::operand::new_integer(*node.value()),
push<furlang::ir::assign_instruction>(ir::operand::new_integer(node.value()),
ir::operand::new_reg(m_registerCounter++));
}