Cleaner error message for lexer errors
This commit is contained in:
parent
87fbee24a3
commit
47039e67ab
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "Parsodus/parser.h"
|
||||
#include "g3log/g3log.hpp"
|
||||
#include <deque>
|
||||
|
||||
namespace pds {
|
||||
|
@ -121,6 +122,9 @@ 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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue