diff --git a/ps3/src/tree.c b/ps3/src/tree.c index c10e657..24ee10d 100644 --- a/ps3/src/tree.c +++ b/ps3/src/tree.c @@ -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; }