diff --git a/src/parser.cpp b/src/parser.cpp index 1ac1f01..f4f0958 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -22,6 +22,7 @@ */ #include "Parsodus/parser.h" +#include "g3log/g3log.hpp" #include namespace pds { @@ -121,7 +122,10 @@ Parser::Token Parser::lex() { } catch(ParsodusLexer::NoMoreTokens) { return Token{ parsodusParser_Symbol::T_EOF, nullptr }; - } + } catch (ParsodusLexer::NoMatch) { + LOG(WARNING) << "Unrecognized character: " << m_lex.peek() << std::endl; + throw SyntaxError("Unrecognized character"); + } } std::unique_ptr Parser::reduce_0(std::deque subparts) {