From 2ada90e0941a0d4bd6149cc748347aa04487d1b5 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 24 Mar 2019 19:12:41 +0000 Subject: Improve a tokenizer error message; Add extra tokens for `in` and `notin` for fun! --- src/parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index 84c03587d..2eee82e22 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4539,6 +4539,7 @@ ParseFileError process_imported_file(Parser *p, ImportedFile imported_file) { TokenPos err_pos = {0}; ParseFileError err = init_ast_file(file, fi->fullpath, &err_pos); + err_pos.file = fi->fullpath; if (err != ParseFile_None) { if (err == ParseFile_EmptyFile) { @@ -4563,7 +4564,7 @@ ParseFileError process_imported_file(Parser *p, ImportedFile imported_file) { error(pos, "Failed to parse file: %.*s; file cannot be found ('%.*s')", LIT(fi->name), LIT(fi->fullpath)); break; case ParseFile_InvalidToken: - error(pos, "Failed to parse file: %.*s; invalid token found in file at (%td:%td)", LIT(fi->name), err_pos.line, err_pos.column); + error(err_pos, "Failed to parse file: %.*s; invalid token found in file", LIT(fi->name)); break; case ParseFile_EmptyFile: error(pos, "Failed to parse file: %.*s; file contains no tokens", LIT(fi->name)); -- cgit v1.2.3