Rationalize how the parser reports tokenizer errors

Remove the unnecessary SQUASH_ERROR flag and correctly report errors
generated from the tokenizer.
This commit is contained in:
ridiculousfish
2018-02-23 17:28:12 -08:00
parent 0950c35eb2
commit c4d903ff98
5 changed files with 42 additions and 49 deletions

View File

@@ -2316,7 +2316,7 @@ static wchar_t unescaped_quote(const wcstring &str, size_t pos) {
/// Returns true if the last token is a comment.
static bool text_ends_in_comment(const wcstring &text) {
tokenizer_t tok(text.c_str(), TOK_ACCEPT_UNFINISHED | TOK_SHOW_COMMENTS | TOK_SQUASH_ERRORS);
tokenizer_t tok(text.c_str(), TOK_ACCEPT_UNFINISHED | TOK_SHOW_COMMENTS);
tok_t token;
while (tok.next(&token)) {
; // pass