From 8902053fa7cc5cf6b3ef64a805844455971b99d6 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Wed, 6 Jun 2018 01:49:21 +0200 Subject: Fixing \n in errors, updating commands in report --- src/generator.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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, void gen_function_return(Type expect, Type actual) { if (actual != expect) { - fprintf(stderr, "Return type mismatch at line %d.", lineno); + fprintf(stderr, "Return type mismatch at line %d.\n", lineno); exit(1); } if (actual != VOID_T) @@ -487,15 +487,11 @@ int gen_value_tab(const char ident[], Scope scope) { } } int gen_num(int value, Scope scope) { - if (scope == LOCAL) - fprintf(output, "push %d\n", value); // TODO: remove if? - // stored for the semantic analysis. - + fprintf(output, "push %d\n", value); return INT; } int gen_char(int value, Scope scope) { - if (scope == LOCAL) - fprintf(output, "push %d\n", value); // TODO: remove if? + fprintf(output, "push %d\n", value); return CHAR; } -- cgit v1.2.3