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,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<Config> Parser::reduce_0(std::deque<Token> subparts) {
|
||||
|
|
Loading…
Reference in New Issue