diff --git a/lib/src/Parser/Pratt.cpp b/lib/src/Parser/Pratt.cpp index 2c43b02..b71bcf7 100644 --- a/lib/src/Parser/Pratt.cpp +++ b/lib/src/Parser/Pratt.cpp @@ -40,7 +40,7 @@ namespace arti::lang::pratt { BindingPower infixBindingPower(ast::InfixOperator op) { switch (op) { // Member Access (Highest) - case ast::InfixOperator::ModuleAccess: + case ast::InfixOperator::ModuleAccess: return { 23, 24 }; case ast::InfixOperator::MemberAccess: case ast::InfixOperator::PointerMemberAccess: return { 21, 22 }; diff --git a/lib/src/Parser/Statements.cpp b/lib/src/Parser/Statements.cpp index eab6553..b1405e2 100644 --- a/lib/src/Parser/Statements.cpp +++ b/lib/src/Parser/Statements.cpp @@ -21,6 +21,7 @@ //============================================================================// #include +#include #include @@ -884,6 +885,9 @@ namespace arti::lang { return Unexpected<>{ std::move(lSquirly).error() }; } + uint16_t limit = + pratt::infixBindingPower(ast::InfixOperator::PointerMemberAccess).right; + bool keepParsing = true; while (keepParsing) { @@ -912,7 +916,7 @@ namespace arti::lang { else { auto curCase = ast::MakeNode(); - if (auto expr = parseExpression(); ! expr) { + if (auto expr = parseExpression(limit); ! expr) { return Unexpected<>{ std::move(expr).error() }; } else {