aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-06-05 22:48:27 +0200
committerpacien2018-06-05 22:48:27 +0200
commit9673f668dc38acfff868f3c657eccb17a22975be (patch)
tree02f381f1ce367a629f6ba061f55e48cc08f3d602
parent0f4b1600983f8afda41a02fec07424338785d81d (diff)
downloadtpc-compiler-9673f668dc38acfff868f3c657eccb17a22975be.tar.gz
fix lineno in error
-rw-r--r--src/generator.c6
1 files 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) {
161// ----- READ AND PRINT FUNCTIONS ----- 161// ----- READ AND PRINT FUNCTIONS -----
162void gen_reade(const char name[], Scope scope) { 162void gen_reade(const char name[], Scope scope) {
163 if (is_read_only(name, scope)) { 163 if (is_read_only(name, scope)) {
164 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, scope); 164 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, lineno);
165 exit(1); 165 exit(1);
166 } 166 }
167 167
@@ -181,7 +181,7 @@ void gen_reade(const char name[], Scope scope) {
181 181
182void gen_readc(const char name[], Scope scope) { 182void gen_readc(const char name[], Scope scope) {
183 if (is_read_only(name, scope)) { 183 if (is_read_only(name, scope)) {
184 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, scope); 184 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", name, lineno);
185 exit(1); 185 exit(1);
186 } 186 }
187 187
@@ -245,7 +245,7 @@ int gen_assign(const char ident[], Scope scope) {
245 int g_addr = glo_get_addr(ident); 245 int g_addr = glo_get_addr(ident);
246 246
247 if (is_read_only(ident, scope)) { 247 if (is_read_only(ident, scope)) {
248 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", ident, scope); 248 fprintf(stderr, "Symbol \"%s\" at line %d is read only.\n", ident, lineno);
249 exit(1); 249 exit(1);
250 } 250 }
251 251