aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2019-07-10 11:51:44 +0200
committerRenaud G <renaud@rolisteam.org>2019-07-10 11:51:44 +0200
commit6e449f6754294e02edbed0c64d0f018be139ff50 (patch)
treeca1a05496aef0ee3120d0c248bf543488b3a7a45
parent133e95bdac75e5793851fd4054689c339794eae3 (diff)
downloadOneRoll-6e449f6754294e02edbed0c64d0f018be139ff50.tar.gz
OneRoll-6e449f6754294e02edbed0c64d0f018be139ff50.zip
clang format
-rw-r--r--diceparser.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/diceparser.cpp b/diceparser.cpp
index 78f5fff..0b1e6da 100644
--- a/diceparser.cpp
+++ b/diceparser.cpp
@@ -171,11 +171,11 @@ bool DiceParser::parseLine(QString str, bool allowAlias)
}
m_command= str;
bool hasInstruction= readInstructionList(str);
-
bool value= hasInstruction;
if(!hasInstruction)
{
- m_errorMap.insert(ExecutionNode::NOTHING_UNDERSTOOD,
+ m_errorMap.insert(
+ ExecutionNode::NOTHING_UNDERSTOOD,
QObject::tr("Nothing was understood. To roll dice: !1d6 - full documation: "
"<a "
"href=\"https://github.com/Rolisteam/DiceParser/blob/master/HelpMe.md\">https://github.com/"
@@ -184,10 +184,10 @@ bool DiceParser::parseLine(QString str, bool allowAlias)
else if(hasInstruction && !str.isEmpty())
{
auto i= m_command.size() - str.size();
- m_warningMap.insert(ExecutionNode::UNEXPECTED_CHARACTER,
+ m_warningMap.insert(
+ ExecutionNode::UNEXPECTED_CHARACTER,
QObject::tr("Unexpected character at %1 - end of command was ignored \"%2\"").arg(i).arg(str));
}
-
if(!m_errorMap.isEmpty())
value= false;
@@ -222,7 +222,7 @@ bool DiceParser::readExpression(QString& str, ExecutionNode*& node)
else
{
m_warningMap.insert(ExecutionNode::BAD_SYNTAXE,
- QObject::tr("Expected closing parenthesis - can't validate the inside."));
+ QObject::tr("Expected closing parenthesis - can't validate the inside."));
}
}
}
@@ -502,7 +502,7 @@ void DiceParser::getDiceResultFromAllInstruction(QList<ExportedDiceResult>& resu
faces= die->getFaces();
// qDebug() << "face" << faces;
HighLightDice hlDice(die->getListValue(), die->isHighlighted(), die->getColor(),
- die->hasBeenDisplayed(), die->getFaces());
+ die->hasBeenDisplayed(), die->getFaces());
list.append(hlDice);
}
nodeResult.insert(faces, list);
@@ -549,8 +549,8 @@ void DiceParser::getLastDiceResult(QList<ExportedDiceResult>& diceValuesList, bo
valuesResult.append(i);
}
}
- HighLightDice hlDice(
- valuesResult, die->isHighlighted(), die->getColor(), die->hasBeenDisplayed(), 0);
+ HighLightDice hlDice(valuesResult, die->isHighlighted(), die->getColor(),
+ die->hasBeenDisplayed(), 0);
listpair.append(hlDice);
}
}
@@ -686,7 +686,8 @@ bool DiceParser::readDice(QString& str, ExecutionNode*& node)
{
if(max < 1)
{
- m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
+ m_errorMap.insert(
+ ExecutionNode::BAD_SYNTAXE,
QObject::tr("Dice with %1 face(s) does not exist. Please, put a value higher than 0").arg(max));
return false;
}
@@ -740,7 +741,8 @@ bool DiceParser::readDice(QString& str, ExecutionNode*& node)
}
else
{
- m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
+ 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])"));
}
@@ -1069,7 +1071,7 @@ bool DiceParser::readOption(QString& str, ExecutionNode* previous) //,
else
{
m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
- QObject::tr("Validator is missing after the c operator. Please, change it"));
+ QObject::tr("Validator is missing after the c operator. Please, change it"));
}
}
break;
@@ -1083,7 +1085,8 @@ bool DiceParser::readOption(QString& str, ExecutionNode* previous) //,
{
if(!m_parsingToolbox->isValidValidator(previous, validator))
{
- m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
+ m_errorMap.insert(
+ ExecutionNode::BAD_SYNTAXE,
QObject::tr("Validator is missing after the %1 operator. Please, change it")
.arg(operatorName == Reroll ? "r" : "a"));
}
@@ -1104,11 +1107,12 @@ bool DiceParser::readOption(QString& str, ExecutionNode* previous) //,
else
{
m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
- QObject::tr("Validator is missing after the %1 operator. Please, change it")
- .arg(operatorName == Reroll ? QStringLiteral("r") :
- operatorName == RerollUntil ?
- QStringLiteral("R") :
- operatorName == RerollAndAdd ? QStringLiteral("a") : ""));
+ QObject::tr("Validator is missing after the %1 operator. Please, change it")
+ .arg(operatorName == Reroll ?
+ QStringLiteral("r") :
+ operatorName == RerollUntil ?
+ QStringLiteral("R") :
+ operatorName == RerollAndAdd ? QStringLiteral("a") : ""));
}
}
break;
@@ -1120,8 +1124,8 @@ bool DiceParser::readOption(QString& str, ExecutionNode* previous) //,
if(!m_parsingToolbox->isValidValidator(previous, validator))
{
m_errorMap.insert(ExecutionNode::ENDLESS_LOOP_ERROR,
- QObject::tr("This condition %1 introduces an endless loop. Please, change it")
- .arg(validator->toString()));
+ QObject::tr("This condition %1 introduces an endless loop. Please, change it")
+ .arg(validator->toString()));
}
ExplodeDiceNode* explodedNode= new ExplodeDiceNode();
explodedNode->setValidator(validator);
@@ -1132,7 +1136,7 @@ bool DiceParser::readOption(QString& str, ExecutionNode* previous) //,
else
{
m_errorMap.insert(ExecutionNode::BAD_SYNTAXE,
- QObject::tr("Validator is missing after the e operator. Please, change it"));
+ QObject::tr("Validator is missing after the e operator. Please, change it"));
}
}
break;