diff --git a/source/lang/parser.cpp b/source/lang/parser.cpp index 53e9ec2d8..da0a61300 100644 --- a/source/lang/parser.cpp +++ b/source/lang/parser.cpp @@ -240,15 +240,15 @@ namespace hex::lang { // (parseBooleanOr) ? (parseBooleanOr) : (parseBooleanOr) ASTNode* Parser::parseTernaryConditional() { - auto node = this->parseBooleanXor(); + auto node = this->parseBooleanOr(); while (MATCHES(sequence(OPERATOR_TERNARYCONDITIONAL))) { - auto second = this->parseBooleanXor(); + auto second = this->parseBooleanOr(); if (!MATCHES(sequence(OPERATOR_INHERIT))) throwParseError("expected ':' in ternary expression"); - auto third = this->parseBooleanXor(); + auto third = this->parseBooleanOr(); node = new ASTNodeTernaryExpression(node, second, third, Token::Operator::TernaryConditional); }