diff options
| author | 2015-04-02 08:05:28 +0200 | |
|---|---|---|
| committer | 2015-04-02 08:05:28 +0200 | |
| commit | 4b094cda0553c6b153c86829e6df26d941366abc (patch) | |
| tree | 3efcd1ad50b16a8aae3718062d77b606a0ae87c4 | |
| parent | 27eeb8e42c579fbacf6c82e06bac1cc84a08e7b2 (diff) | |
| download | OneRoll-4b094cda0553c6b153c86829e6df26d941366abc.tar.gz OneRoll-4b094cda0553c6b153c86829e6df26d941366abc.zip | |
-add error on several syntay points.
| -rw-r--r-- | diceparser.cpp | 16 | ||||
| -rw-r--r-- | diceparser.h | 4 |
2 files changed, 19 insertions, 1 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index 91e4af0..2c533dc 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -504,6 +504,10 @@ bool DiceParser::readDice(QString& str,ExecutionNode* & node) node = lsrNode; return true; } + else + { + m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("List is missing after the L operator. Please, add it (e.g : 1L[sword,spear,gun,arrow]")); + } } } @@ -762,6 +766,10 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice) node = countNode; isFine = true; } + else + { + m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("Validator is missing after the c operator. Please, change it")); + } } break; case Reroll: @@ -784,6 +792,10 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice) } + else + { + m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("Validator is missing after the %1 operator. Please, change it").arg(m_OptionOp->value(tmp)==Reroll?"r":"a")); + } } break; @@ -803,6 +815,10 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice) isFine = true; } + else + { + m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,QObject::tr("Validator is missing after the e operator. Please, change it")); + } } diff --git a/diceparser.h b/diceparser.h index e4ea0e3..683be88 100644 --- a/diceparser.h +++ b/diceparser.h @@ -73,7 +73,9 @@ public: * @brief The OptionOperator enum gathering all options availables for result. */ enum OptionOperator {KeepAndExplose,Keep,Reroll,Explosing,Sort,Count,RerollAndAdd}; - + /** + * @brief The CommandOperator enum + */ enum CommandOperator {}; /** |