From 957d77141f56714e9f4551c8d49e6658ff778ce7 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 1 Aug 2018 02:04:47 +1200 Subject: Add line area/span indication to error messages --- lexer.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lexer.c') diff --git a/lexer.c b/lexer.c index 40dfd67..a8b7716 100644 --- a/lexer.c +++ b/lexer.c @@ -138,6 +138,7 @@ lex_alphanum(void) { t.value[i] = '\0'; column_number += i; + t.span = i; if (i == 0) { emit_error("Expected alphanumeric, got '%c'\n", buf[i]); @@ -163,6 +164,7 @@ lex_eol(void) { t.type = TOK_EOL; t.loc = get_current_loc(); + t.span = 1; expect('\n'); @@ -175,6 +177,7 @@ lex_colon(void) { t.type = TOK_COLON; t.loc = get_current_loc(); + t.span = 1; expect(':'); -- cgit v1.1