]> git.tdb.fi Git - libs/gl.git/commitdiff
Evaluate parenthesized expression as the contained expression's value
authorMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 12:22:38 +0000 (14:22 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 25 Nov 2016 12:22:38 +0000 (14:22 +0200)
source/programcompiler.cpp
source/programcompiler.h

index fd756de0e00cbbca4c5aa18587b251afc4e94ccb..a68c8b96d7c9c40dc94a3bde6211f867652cd2db 100644 (file)
@@ -944,6 +944,11 @@ void ProgramCompiler::ExpressionEvaluator::visit(Literal &literal)
        result_valid = true;
 }
 
+void ProgramCompiler::ExpressionEvaluator::visit(ParenthesizedExpression &parexp)
+{
+       parexp.expression->visit(*this);
+}
+
 void ProgramCompiler::ExpressionEvaluator::visit(VariableReference &var)
 {
        if(!var.declaration)
index 2a31a962b989a5cec0021e82584f75a7036ccac4..8d7d1ad13b9c62b2b4dc0941c08c1a3cdb9fd6aa 100644 (file)
@@ -168,6 +168,7 @@ private:
                ExpressionEvaluator(const ValueMap &);
 
                virtual void visit(ProgramSyntax::Literal &);
+               virtual void visit(ProgramSyntax::ParenthesizedExpression &);
                virtual void visit(ProgramSyntax::VariableReference &);
                virtual void visit(ProgramSyntax::UnaryExpression &);
                virtual void visit(ProgramSyntax::BinaryExpression &);