diff --git a/btparser/lexer.cpp b/btparser/lexer.cpp index 55c53d4..5121c17 100644 --- a/btparser/lexer.cpp +++ b/btparser/lexer.cpp @@ -96,8 +96,6 @@ bool Lexer::Test(const std::function & lexEnum, lexEnum(toks); } while(tok != tok_eof && tok != tok_error); - if(tok != tok_error && tok != tok_eof) - tok = reportError("lexer did not finish at the end of the file"); for(const auto & warning : mWarnings) if(output) lexEnum("\nwarning: " + warning); diff --git a/btparser/lexer.h b/btparser/lexer.h index c5046c6..975622c 100644 --- a/btparser/lexer.h +++ b/btparser/lexer.h @@ -37,7 +37,7 @@ public: struct TokenState { - Token Token; + Token Token = tok_eof; std::string IdentifierStr; //tok_identifier uint64_t NumberVal = 0; //tok_number std::string StringLit; //tok_stringlit