Improve a tokenizer error message; Add extra tokens for in and notin for fun!

This commit is contained in:
gingerBill
2019-03-24 19:12:41 +00:00
parent a137a06b00
commit 2ada90e094
2 changed files with 15 additions and 15 deletions

View File

@@ -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));