From ec4121de1cac0188e5a90bbadfb236d52f4037dc Mon Sep 17 00:00:00 2001 From: Username404 Date: Mon, 14 Feb 2022 16:02:30 +0100 Subject: [PATCH] Fix parsing of parentheses by searching after the current index Signed-off-by: Username404 --- src/headers/parsing/Parser.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers/parsing/Parser.hpp b/src/headers/parsing/Parser.hpp index f3b09ee..a129bc8 100644 --- a/src/headers/parsing/Parser.hpp +++ b/src/headers/parsing/Parser.hpp @@ -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()) {