From faa920e1ad4e1f555de7bbb28829d15ec1784f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Tue, 6 Sep 2016 17:36:51 +0200 Subject: [PATCH] Correctly parsing quantified expressions thanks to variable stack. --- include/plasp/pddl/expressions/Quantified.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/plasp/pddl/expressions/Quantified.h b/include/plasp/pddl/expressions/Quantified.h index ff956ae..15aa954 100644 --- a/include/plasp/pddl/expressions/Quantified.h +++ b/include/plasp/pddl/expressions/Quantified.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace plasp @@ -65,9 +66,15 @@ boost::intrusive_ptr Quantified::parse(Context &context, Variable::parseTypedDeclarations(context, expressionContext, expression->m_variables); parser.expect(")"); + // Push newly parsed variables to the stack + expressionContext.variables.push(&expression->m_variables); + // Parse argument of the expression expression->Quantified::setArgument(parseExpression(context, expressionContext)); + // Clean up variable stack + expressionContext.variables.pop(); + parser.expect(")"); return expression;