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 ++++++++++++-------- node/variablenode.h | 6 +++--- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'node') 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; } diff --git a/node/variablenode.h b/node/variablenode.h index 9173ae3..6e9cc78 100644 --- a/node/variablenode.h +++ b/node/variablenode.h @@ -22,12 +22,12 @@ public: qint64 getIndex() const; void setIndex(qint64 index); - std::vector getData() const; - void setData(const std::vector &data); + std::vector* getData() const; + void setData(std::vector* data); private: qint64 m_index; - std::vector m_data; + std::vector* m_data; }; #endif // VARIABLENODE_H -- cgit v1.2.3-70-g09d2