ref: b415245da5d38ce56bd3831eecc2d679db9fc231
parent: ba47ba8ffc19b3f386bbc01989dda5e0dd1d644d
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Aug 21 20:21:36 EDT 2012
Moving tree printing once the full function is parsed At the function level we can be sure the expresion will not be used again, so it is the better place (for now) for printing it.
--- a/decl.c
+++ b/decl.c
@@ -143,7 +143,9 @@
"type defaults to 'int' in declaration of '%s'",
yytext);
} else if (new->type == FTN && yytoken == '{') {
- compound();
+ struct node *np = compound();
+ prtree(np);
+ putchar('\n');
return;
}
} while (accept(','));
--- a/flow.c
+++ b/flow.c
@@ -120,7 +120,5 @@
addstmt(np, stmt());
del_ctx();
- prtree(np);
- putchar('\n');
return np;
}