Increment i after finding the end iterator when parsing variables
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
01abadc1fa
commit
adbe98ec00
@ -77,12 +77,11 @@ namespace Parser {
|
|||||||
}
|
}
|
||||||
const unsigned increment = 2 + isFinalDefine;
|
const unsigned increment = 2 + isFinalDefine;
|
||||||
const auto beginning = lexed.begin() + i + increment;
|
const auto beginning = lexed.begin() + i + increment;
|
||||||
parseTree << Define(isFinalDefine, current.toktext, parse( // TODO Find another way of choosing the tokens to parse
|
const auto end = find_if(beginning, lexed.end(), [¤t](const tok& it){ // TODO Find another way of choosing the tokens to parse
|
||||||
beginning, find_if(beginning, lexed.end(), [¤t](const tok& it){
|
return it.line != current.line;
|
||||||
return it.line != current.line;
|
});
|
||||||
})
|
parseTree << Define(isFinalDefine, current.toktext, parse(beginning, end));
|
||||||
));
|
i += 1 + isFinalDefine + distance(beginning, end);
|
||||||
i += increment;
|
|
||||||
} else if (next.toktype == LPAR) {
|
} else if (next.toktype == LPAR) {
|
||||||
parseTree << Call(current.toktext);
|
parseTree << Call(current.toktext);
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user