From: Mike D. Lowis Date: Fri, 2 Mar 2012 15:44:23 +0000 (-0500) Subject: Fixed a bug in btparser where an exception was being created but not actually thrown... X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=efe094829e9d5b499cc1ec9d22dca2f74b796210;p=archive%2Fparse-utils.git Fixed a bug in btparser where an exception was being created but not actually thrown in the match function. This effectively killed the backtracking operation of the parser :-( --- diff --git a/source/parser/btparser/btparser.cpp b/source/parser/btparser/btparser.cpp index 9a01d43..8213468 100644 --- a/source/parser/btparser/btparser.cpp +++ b/source/parser/btparser/btparser.cpp @@ -73,9 +73,10 @@ void BTParser::match(TokenType_T type) { Token& tok = lookaheadToken(1); ostringstream oss; - oss << "Expected token type. Expected " << type << ", received " << tok.type() << "."; + oss << "Unexpected token type. Expected " << type << ", received " << tok.type() << "."; Exception ex( tok.line(), tok.column() ); ex.setMessage(oss.str()); + throw ex; } }