diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/generator.c | 10 |
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 | ||
122 | void gen_function_return(Type expect, Type actual) { | 122 | void 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 | } |
489 | int gen_num(int value, Scope scope) { | 489 | int 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 | ||
497 | int gen_char(int value, Scope scope) { | 494 | int 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 | } |