aboutsummaryrefslogtreecommitdiff
path: root/src/generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator.c')
-rw-r--r--src/generator.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/generator.c b/src/generator.c
index 5c51d3b..1dfe8f3 100644
--- a/src/generator.c
+++ b/src/generator.c
@@ -121,7 +121,7 @@ void gen_function_end_declaration(const char name[], int return_type,
121 121
122void gen_function_return(Type expect, Type actual) { 122void gen_function_return(Type expect, Type actual) {
123 if (actual != expect) { 123 if (actual != expect) {
124 fprintf(stderr, "Return type mismatch at line %d.", lineno); 124 fprintf(stderr, "Return type mismatch at line %d.\n", lineno);
125 exit(1); 125 exit(1);
126 } 126 }
127 if (actual != VOID_T) 127 if (actual != VOID_T)
@@ -487,15 +487,11 @@ int gen_value_tab(const char ident[], Scope scope) {
487 } 487 }
488} 488}
489int gen_num(int value, Scope scope) { 489int gen_num(int value, Scope scope) {
490 if (scope == LOCAL) 490 fprintf(output, "push %d\n", value);
491 fprintf(output, "push %d\n", value); // TODO: remove if?
492 // stored for the semantic analysis.
493
494 return INT; 491 return INT;
495} 492}
496 493
497int gen_char(int value, Scope scope) { 494int gen_char(int value, Scope scope) {
498 if (scope == LOCAL) 495 fprintf(output, "push %d\n", value);
499 fprintf(output, "push %d\n", value); // TODO: remove if?
500 return CHAR; 496 return CHAR;
501} 497}