From aed4c197ba1bcb0d0289a223095481650e705dba Mon Sep 17 00:00:00 2001 From: obiwankennedy Date: Wed, 15 Jan 2014 19:10:17 +0100 Subject: Update diceparser.cpp correcting range parsing --- diceparser.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/diceparser.cpp b/diceparser.cpp index 2adfd28..0165d92 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -417,6 +417,7 @@ Validator* DiceParser::readValidator(QString& str) if(str.startsWith("]")) { str=str.remove(0,1); + isOk=true; } else { @@ -435,26 +436,25 @@ Validator* DiceParser::readValidator(QString& str) } } - else if(expectSquareBrasket) + else { - if(str.startsWith("]")) + if((expectSquareBrasket)&&(str.startsWith("]"))) { str=str.remove(0,1); + isOk=true; } - else + + + + if(isOk) { - isOk=false; + BooleanCondition* condition = new BooleanCondition(); + condition->setValue(value); + condition->setOperator(myLogicOp); + returnVal = condition; } } - if(isOk) - { - BooleanCondition* condition = new BooleanCondition(); - condition->setValue(value); - condition->setOperator(myLogicOp); - returnVal = condition; - } - } -- cgit v1.2.3-70-g09d2