Skip to content

Commit

Permalink
Fixed parser bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kwrx committed Aug 22, 2021
1 parent 285aff0 commit 358aa97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qasp/parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ static std::string parsePredicates(const std::vector<Token>& tokens, std::vector

if(unlikely(!EXPECT(it, TK_RIGHT_PAREN))) {

LOG(__FILE__, ERROR) << "Expected a RIGHT_PAREN after extensions list" << std::endl;
LOG(__FILE__, ERROR) << "Expected a RIGHT_PAREN after extensions list, found: " << VALUE(it) << std::endl;

throw ParserException((*it).tk_source, (*it).tk_line, (*it).tk_column, VALUE(it));

}

it++;


} else {
Expand All @@ -169,7 +170,7 @@ static std::string parsePredicates(const std::vector<Token>& tokens, std::vector
continue;
}

LOG(__FILE__, WARN) << "Expected a LEFT_PAREN, DOT or COMMA after predicate name" << std::endl;
LOG(__FILE__, WARN) << "Expected a LEFT_PAREN, DOT or COMMA after predicate name, found: " << VALUE(it) << std::endl;
break;

}
Expand Down Expand Up @@ -203,7 +204,7 @@ static std::string parsePredicates(const std::vector<Token>& tokens, std::vector

else {

LOG(__FILE__, ERROR) << "Expected a DOT or COMMA after predicate" << std::endl;
LOG(__FILE__, ERROR) << "Expected a DOT or COMMA after predicate, found " << VALUE(it) << std::endl;
break;

}
Expand Down

0 comments on commit 358aa97

Please sign in to comment.