acc: Removed debug prints, old code. Also the scope of the declarations made inside a for statement is now properly tracked

This commit is contained in:
jpekkila
2019-10-08 00:20:57 +03:00
parent 08f155cbec
commit 44a86f5e80
3 changed files with 22 additions and 42 deletions

View File

@@ -84,7 +84,7 @@ iteration_statement: WHILE expression compound_statement
| FOR for_expression compound_statement { $$ = astnode_create(NODE_ITERATION_STATEMENT, $2, $3); $$->prefix = FOR; }
;
for_expression: '(' for_init_param for_other_params ')' { $$ = astnode_create(NODE_UNKNOWN, $2, $3); $$->prefix = '('; $$->postfix = ')'; }
for_expression: '(' for_init_param for_other_params ')' { $$ = astnode_create(NODE_FOR_EXPRESSION, $2, $3); $$->prefix = '('; $$->postfix = ')'; }
;
for_init_param: expression ';' { $$ = astnode_create(NODE_UNKNOWN, $1, NULL); $$->postfix = ';'; }