diff options
| -rw-r--r-- | diceparser.cpp | 15 | ||||
| -rw-r--r-- | include/diceparser.h | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index da838f1..7623718 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -165,11 +165,7 @@ bool DiceParser::parseLine(QString str, bool allowAlias) { m_errorMap.clear(); m_comment= QString(""); - if(!m_startNodes.empty()) - { - qDeleteAll(m_startNodes); - m_startNodes.clear(); - } + cleanAll(); m_currentTreeHasSeparator= false; if(allowAlias) { @@ -374,6 +370,15 @@ bool DiceParser::readNode(QString& str, ExecutionNode*& node) return false; } +void DiceParser::cleanAll() +{ + if(!m_startNodes.empty()) + { + qDeleteAll(m_startNodes); + m_startNodes.clear(); + } +} + void DiceParser::start() { for(auto start : m_startNodes) diff --git a/include/diceparser.h b/include/diceparser.h index 230d571..32694a3 100644 --- a/include/diceparser.h +++ b/include/diceparser.h @@ -230,7 +230,7 @@ public: QString humanReadableWarning(); bool readValuesList(QString& str, ExecutionNode*& node); - + void cleanAll(); private: /** * @brief readIfInstruction reads the current command to build if node with proper parameters. |