diff --git a/lib/source/pl/core/parser.cpp b/lib/source/pl/core/parser.cpp index 51065b0a..7e35d764 100644 --- a/lib/source/pl/core/parser.cpp +++ b/lib/source/pl/core/parser.cpp @@ -151,7 +151,7 @@ namespace pl::core { if (MATCHES(sequence(tkn::Separator::LeftBracket) && !peek(tkn::Separator::LeftBracket))) { path.emplace_back(parseMathematicalExpression()); - if (sequence(tkn::Separator::RightBracket)) + if (!sequence(tkn::Separator::RightBracket)) err::P0002.throwError(fmt::format("Expected ']' at end of array indexing, got {}.", getFormattedToken(0)), {}, 1); } @@ -1600,7 +1600,7 @@ namespace pl::core { while (true) { this->m_currNamespace.back().push_back(getValue(-1).get()); - if (sequence(tkn::Operator::ScopeResolution, tkn::Literal::Identifier)) + if (!sequence(tkn::Operator::ScopeResolution, tkn::Literal::Identifier)) break; }