diff options
| -rw-r--r-- | diceparser.cpp | 24 | ||||
| -rw-r--r-- | node/ifnode.cpp | 1 | ||||
| -rw-r--r-- | node/ifnode.h | 1 |
3 files changed, 14 insertions, 12 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index ebd163d..8d96d5a 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -977,23 +977,25 @@ bool DiceParser::readIfInstruction(QString& str,ExecutionNode*& trueNode,Executi { str=str.remove(0,1); ExecutionNode* node; - bool hasExpresion = readExpression(str,node); - if(str.startsWith('}')) + if(readExpression(str,node)) { - trueNode = node; - str=str.remove(0,1); - if(str.startsWith('{')) + if(str.startsWith('}')) { + trueNode = node; str=str.remove(0,1); - ExecutionNode* node2; - readExpression(str,node2); - if(str.startsWith('}')) + if(str.startsWith('{')) { - falseNode=node2; - return true; + str=str.remove(0,1); + ExecutionNode* node2; + readExpression(str,node2); + if(str.startsWith('}')) + { + falseNode=node2; + return true; + } } + return true; } - return true; } } return false; diff --git a/node/ifnode.cpp b/node/ifnode.cpp index 5543a93..864faf1 100644 --- a/node/ifnode.cpp +++ b/node/ifnode.cpp @@ -21,6 +21,7 @@ #include "result/diceresult.h" IfNode::IfNode() + : m_validator(NULL),m_true(NULL),m_false(NULL) { //m_result = new DiceResult(); } diff --git a/node/ifnode.h b/node/ifnode.h index 56b23fa..6f8bbcf 100644 --- a/node/ifnode.h +++ b/node/ifnode.h @@ -44,7 +44,6 @@ protected: ExecutionNode *getLeafNode(ExecutionNode *node); protected: - DiceResult* m_diceResult; Validator* m_validator; ExecutionNode* m_true; |