From: Mikko Rasa Date: Fri, 25 Nov 2016 12:22:38 +0000 (+0200) Subject: Evaluate parenthesized expression as the contained expression's value X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fbc6438f24609a2553ac7e5741bfd469e14f8ff7;p=libs%2Fgl.git Evaluate parenthesized expression as the contained expression's value --- diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index fd756de0..a68c8b96 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -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) diff --git a/source/programcompiler.h b/source/programcompiler.h index 2a31a962..8d7d1ad1 100644 --- a/source/programcompiler.h +++ b/source/programcompiler.h @@ -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 &);