Include column number in parser and compiler error messages (#3257)

Resolves #1027, resolves #2334, and resolves #3256.
This commit is contained in:
liviubobocu authored and GitHub committed 2025-03-10 22:17:49 +09:00
1 parent 668871bdfa
commit 4b84a6e2f6
2 files changed
+17 -16

No files matched your search

+3 -2
View File
@@ -82,8 +82,9 @@ void locfile_locate(struct locfile* l, location loc, const char* fmt, ...) {
jv_free(m1);
return;
}
jv m2 = jv_string_fmt("%s at %s, line %d:\n%.*s%*s", jv_string_value(m1),
jv_string_value(l->fname), startline + 1,
jv m2 = jv_string_fmt("%s at %s, line %d, column %d:\n%.*s%*s",
jv_string_value(m1), jv_string_value(l->fname),
startline + 1, loc.start - offset + 1,
locfile_line_length(l, startline), l->data + offset,
loc.start - offset, "");
jv_free(m1);