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:
parent
21ab59fc6d
commit
d3b05461cb
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue