ps3: task 4
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user