diff options
author | David Phillips <david@sighup.nz> | 2018-08-01 02:04:47 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-08-01 02:04:47 +1200 |
commit | 957d77141f56714e9f4551c8d49e6658ff778ce7 (patch) | |
tree | b4d0207a06f12de12c1172312b6ee5de54c79a6f /lexer.c | |
parent | a2e204aea97e7f844a5303f956c893579a89623e (diff) | |
download | hence-957d77141f56714e9f4551c8d49e6658ff778ce7.tar.xz |
Add line area/span indication to error messages
Diffstat (limited to 'lexer.c')
-rw-r--r-- | lexer.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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(':'); |