From 9673f668dc38acfff868f3c657eccb17a22975be Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 5 Jun 2018 22:48:27 +0200 Subject: fix lineno in error --- src/generator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/generator.c b/src/generator.c index f32f468..333dd5b 100644 --- a/src/generator.c +++ b/src/generator.c @@ -161,7 +161,7 @@ void gen_check(const char name[], Scope scope) { // ----- READ AND PRINT FUNCTIONS ----- void gen_reade(const char name[], Scope scope) { if (is_read_only(name, scope)) { - fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, scope); + fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, lineno); exit(1); } @@ -181,7 +181,7 @@ void gen_reade(const char name[], Scope scope) { void gen_readc(const char name[], Scope scope) { if (is_read_only(name, scope)) { - fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, scope); + fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, lineno); exit(1); } @@ -245,7 +245,7 @@ int gen_assign(const char ident[], Scope scope) { int g_addr = glo_get_addr(ident); if (is_read_only(ident, scope)) { - fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", ident, scope); + fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", ident, lineno); exit(1); } -- cgit v1.2.3