aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/diceparser.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2015-08-29 00:05:11 +0200
committerRenaud G <renaud@rolisteam.org>2015-08-29 00:05:11 +0200
commit04423fcd2848c283169f5a6719bd50cf70e14138 (patch)
tree3157bf972a4b619d1819278ad4bfeff76ff7bd17 /diceparser.cpp
parent3a8b315ab8a448a443cce277f3f26a1996403e06 (diff)
parentda1db7bc2436f94ab288d8da8d98a8209d3d2caa (diff)
downloadOneRoll-04423fcd2848c283169f5a6719bd50cf70e14138.tar.gz
OneRoll-04423fcd2848c283169f5a6719bd50cf70e14138.zip
Merge branch 'master' of github.com:obiwankennedy/DiceParser
Diffstat (limited to 'diceparser.cpp')
-rw-r--r--diceparser.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 8c910a2..bfe8247 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -42,7 +42,7 @@
#define DEFAULT_FACES_NUMBER 10
DiceParser::DiceParser()
- : m_start(NULL)
+ : m_start(NULL),m_current(NULL)
{
m_parsingToolbox = new ParsingToolBox();
@@ -166,7 +166,8 @@ bool DiceParser::parseLine(QString str)
keepParsing =!str.isEmpty();
if(keepParsing)
{
- keepParsing = readOperator(str,m_current);
+ // keepParsing =
+ readOperator(str,m_current);
m_current = getLatestNode(m_current);
}
@@ -428,7 +429,6 @@ void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues)
DiceResult* diceResult = dynamic_cast<DiceResult*>(result);
if(NULL!=diceResult)
{
- bool hasResult = false;
quint64 face=0;
ListDiceResult listpair;
foreach(Die* die, diceResult->getResultList())
@@ -436,7 +436,6 @@ void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues)
if(!die->hasBeenDisplayed())
{
QList<quint64> valuesResult;
- hasResult=true;
valuesResult.append(die->getValue());
die->displayed();
face = die->getFaces();
@@ -545,10 +544,10 @@ bool DiceParser::readDice(QString& str,ExecutionNode* & node)
if(readDiceOperator(str,currentOperator))
{
- int num;
- int end;
if(currentOperator==D)
{
+ int num;
+ int end;
if(m_parsingToolbox->readNumber(str,num))
{
if(num<1)
@@ -837,7 +836,8 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice)/
if(NULL!=validator)
{
/// @todo display warning here.
- bool b = m_parsingToolbox->isValidValidator(previous,validator);
+ //bool b =
+ m_parsingToolbox->isValidValidator(previous,validator);
CountExecuteNode* countNode = new CountExecuteNode();
countNode->setValidator(validator);
@@ -859,7 +859,8 @@ bool DiceParser::readOption(QString& str,ExecutionNode* previous, bool hasDice)/
if(NULL!=validator)
{
/// @todo display warning here.
- bool b = m_parsingToolbox->isValidValidator(previous,validator);
+ //bool b =
+ m_parsingToolbox->isValidValidator(previous,validator);
RerollDiceNode* rerollNode = new RerollDiceNode();
if(m_OptionOp->value(tmp)==RerollAndAdd)
{