Fix parsing of parentheses by searching after the current index

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-02-14 16:02:30 +01:00
parent 56e1db5fcc
commit ec4121de1c
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -63,7 +63,7 @@ namespace Parser {
}
case LPAR: case LBRACE: case LBRACKET: {
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;
});
if (closingCharacter != lexed.cend()) {