Parser.hpp: Stop the loop in the filter_comma_list function when the current iterator points to a COMMA token

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-04-22 12:59:11 +02:00
parent 21ab59fc6d
commit d3b05461cb
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ namespace Parser {
void filter_comma_list(vector<tok>& tokens) {
if (tokens.size() >= 2 && tokens[1].toktype != tok::RPAR) {
for (auto iterator = tokens.begin(); iterator < tokens.end() - 1; ++iterator) {
for (auto iterator = tokens.begin(); iterator->toktype != tok::COMMA && iterator < tokens.end() - 1; ++iterator) {
const auto nextIterator = iterator + 1;
if (nextIterator->toktype == tok::COMMA) {
tokens.erase(nextIterator);