diff options
| author | 2017-12-14 00:50:04 +0100 | |
|---|---|---|
| committer | 2018-01-11 18:37:00 +0100 | |
| commit | 592c8271364fee6471be333dccbcf30cad9e3655 (patch) | |
| tree | 22377e4036260964fe81aa5151826216af9098c5 | |
| parent | e9b3545b597dcadeafcc749f3e9bc06f9e92b695 (diff) | |
| download | OneRoll-592c8271364fee6471be333dccbcf30cad9e3655.tar.gz OneRoll-592c8271364fee6471be333dccbcf30cad9e3655.zip | |
-Fix comment
| -rw-r--r-- | cli/cmds.txt | 11 | ||||
| -rw-r--r-- | diceparser.cpp | 17 |
2 files changed, 20 insertions, 8 deletions
diff --git a/cli/cmds.txt b/cli/cmds.txt index dfa4b26..f5c7e1e 100644 --- a/cli/cmds.txt +++ b/cli/cmds.txt @@ -4,7 +4,6 @@ 10d10c[>6]+@c[=10] 1+1D10 3d10c[>=5] -3nwod 1+(4*3)D10 2+4/4 2D10*2D20*8 @@ -45,3 +44,13 @@ la 10d[-8--1] 4d6p[4:black]c[>=4]+1d6p[1:white]c6-@c1+1d6p[1:red]c[>=4]+@c6-@c1 10d[0-9] +10d10g10 +1d100 #Comment +1d6;1d8mk1 +1d20;1d10;$1-$2 +1d100i[<50]{"success %1"}{"fail %1"} +2d100i:[<201]{"success %2"}{"fail %2"} +3d100i*[<101]{"Success"}{"Fail"} +3d100i.[%2=0]{"%1 is even"}{"%1 is odd"} +d100+3;d20+8 + diff --git a/diceparser.cpp b/diceparser.cpp index 2db7bcd..4337c46 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -230,6 +230,7 @@ bool DiceParser::readExpression(QString& str,ExecutionNode* & node) { operandNode= ParsingToolBox::getLatestNode(operandNode); }; + return true; } else if(readCommand(str,operandNode)) { @@ -264,12 +265,7 @@ bool DiceParser::readExpression(QString& str,ExecutionNode* & node) return false; } } - if(m_parsingToolbox->readComment(str,result,comment)) - { - m_command.remove(comment); - m_comment = result; - } - return true; + return false; } bool DiceParser::readOptionFromNull(QString& str,ExecutionNode* & node) { @@ -845,6 +841,13 @@ bool DiceParser::readInstructionList(QString& str) } else { + QString result; + QString comment; + if(m_parsingToolbox->readComment(str,result,comment)) + { + m_command.remove(comment); + m_comment = result; + } readInstruction = false; } } @@ -884,7 +887,7 @@ bool DiceParser::readOperator(QString& str,ExecutionNode* previous) { parent = nodeExecOrChild; nodeExecOrChild = nodeExecOrChild->getNextNode(); - qDebug() << node->getPriority() << nodeExecOrChild->getPriority() << "###########"; + //qDebug() << node->getPriority() << nodeExecOrChild->getPriority() << "###########"; } // management of operator priority if((nullptr != nodeExecOrChild)&&(nodeExec != nodeExecOrChild)) |