println and flatten are correct
This commit is contained in:
2
ps3/src/.gdb_history
Normal file
2
ps3/src/.gdb_history
Normal file
@@ -0,0 +1,2 @@
|
||||
l
|
||||
exit
|
||||
@@ -224,11 +224,12 @@ static node_t* constant_fold_operator(node_t* node)
|
||||
static node_t* simplify_println_statement(node_t* node)
|
||||
{
|
||||
assert(node->type == PRINTLN_STATEMENT);
|
||||
node->type = PRINT_STATEMENT;
|
||||
node_t *result = node_create(PRINT_STATEMENT, 1, node->children[0]);
|
||||
node_t *newline = node_create(STRING_LITERAL, 0);
|
||||
newline->data.string_literal = "\"\\n\"";
|
||||
append_to_list_node(node, newline);
|
||||
return node;
|
||||
newline->data.string_literal = strdup("\"\\n\"");
|
||||
append_to_list_node(node->children[0], newline);
|
||||
node_finalize(node);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Flatten all LOCAL_VARIABLE_DELCARATION nodes in the block, by converting them
|
||||
|
||||
Reference in New Issue
Block a user