Fix parsing of parentheses by searching after the current index
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
56e1db5fcc
commit
ec4121de1c
|
@ -63,7 +63,7 @@ namespace Parser {
|
||||||
}
|
}
|
||||||
case LPAR: case LBRACE: case LBRACKET: {
|
case LPAR: case LBRACE: case LBRACKET: {
|
||||||
const auto inverseCharacter = tok::inverseLCharacter(current.toktype);
|
const auto inverseCharacter = tok::inverseLCharacter(current.toktype);
|
||||||
const auto closingCharacter = find_if(lexed.cbegin(), lexed.cend(), [&inverseCharacter](const tok& it){
|
const auto closingCharacter = find_if(lexed.cbegin() + i, lexed.cend(), [&inverseCharacter](const tok& it){
|
||||||
return it.toktype == inverseCharacter;
|
return it.toktype == inverseCharacter;
|
||||||
});
|
});
|
||||||
if (closingCharacter != lexed.cend()) {
|
if (closingCharacter != lexed.cend()) {
|
||||||
|
|
Loading…
Reference in New Issue