Skip to content

Commit 358aa97

Browse files
committed
Fixed parser bug
1 parent 285aff0 commit 358aa97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/qasp/parser/Parser.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,13 @@ static std::string parsePredicates(const std::vector<Token>& tokens, std::vector
152152

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

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

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

159159
}
160160

161+
it++;
161162

162163

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

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

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

204205
else {
205206

206-
LOG(__FILE__, ERROR) << "Expected a DOT or COMMA after predicate" << std::endl;
207+
LOG(__FILE__, ERROR) << "Expected a DOT or COMMA after predicate, found " << VALUE(it) << std::endl;
207208
break;
208209

209210
}

0 commit comments

Comments
 (0)