ps3: task 4

This commit is contained in:
2026-02-23 19:13:43 +01:00
parent cd38f358d4
commit 22582de43e

View File

@@ -269,7 +269,10 @@ static node_t* constant_fold_operator(node_t* node)
static node_t* simplify_println_statement(node_t* node)
{
assert(node->type == PRINTLN_STATEMENT);
// TODO: Task 4: Implement this function
node->type = PRINT_STATEMENT;
node_t *newline = node_create(STRING_LITERAL, 0);
newline->data.string_literal = "\"\\n\"";
append_to_list_node(node, newline);
return node;
}