From c930587ff1fd23cf14c9c428d1756a02e10728d0 Mon Sep 17 00:00:00 2001 From: obiwankennedy Date: Thu, 30 Nov 2017 13:24:17 +0100 Subject: -Fix Variable node --- node/variablenode.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'node/variablenode.cpp') diff --git a/node/variablenode.cpp b/node/variablenode.cpp index aa42492..f202246 100644 --- a/node/variablenode.cpp +++ b/node/variablenode.cpp @@ -1,5 +1,5 @@ #include "variablenode.h" - +#include "parsingtoolbox.h" VariableNode::VariableNode() { @@ -15,13 +15,17 @@ void VariableNode::run(ExecutionNode *previous) return; } - if(m_data.size()>m_index) + if(m_data->size()>m_index) { - auto value= m_data[m_index]; - m_result = value->getResult(); - if(nullptr!=m_nextNode) + auto value= (*m_data)[m_index]; + value = ParsingToolBox::getLatestNode(value); + if(nullptr != value) { - m_nextNode->run(this); + m_result = value->getResult(); + if(nullptr!=m_nextNode) + { + m_nextNode->run(this); + } } } else @@ -73,12 +77,12 @@ void VariableNode::setIndex(qint64 index) m_index = index; } -std::vector VariableNode::getData() const +std::vector* VariableNode::getData() const { return m_data; } -void VariableNode::setData(const std::vector &data) +void VariableNode::setData(std::vector* data) { m_data = data; } -- cgit v1.2.3-70-g09d2