aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/parsingtoolbox.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2020-08-21 22:56:05 +0200
committerRenaud G <renaud@rolisteam.org>2020-08-21 22:58:21 +0200
commit8ee9c4372efce878e817c49b375a8fd904ea5a43 (patch)
tree3c853d74becfefd444bb842805086a7ce68b7fb2 /parsingtoolbox.cpp
parentb48e29ad3cc1be1b0ee66b54bf19537a0bfdc782 (diff)
downloadOneRoll-8ee9c4372efce878e817c49b375a8fd904ea5a43.tar.gz
OneRoll-8ee9c4372efce878e817c49b375a8fd904ea5a43.zip
draft to fix repeater node.
Diffstat (limited to 'parsingtoolbox.cpp')
-rw-r--r--parsingtoolbox.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/parsingtoolbox.cpp b/parsingtoolbox.cpp
index af89aaf..8261d8a 100644
--- a/parsingtoolbox.cpp
+++ b/parsingtoolbox.cpp
@@ -1323,29 +1323,30 @@ void ParsingToolBox::readSubtitutionParameters(SubtituteInfo& info, QString& res
bool ParsingToolBox::readReaperArguments(RepeaterNode* node, QString& source)
{
- if(readOpenParentheses(source))
+ if(!readOpenParentheses(source))
+ return false;
+
+ auto instructions= readInstructionList(source, false);
+ if(instructions.empty())
+ return false;
+
+ readComma(source);
+ ExecutionNode* tmp;
+ if(readOperand(source, tmp))
{
- auto instructions= readInstructionList(source, false);
- if(!instructions.empty())
+ if(source.startsWith("+"))
{
- readComma(source);
- ExecutionNode* tmp;
- if(readOperand(source, tmp))
- {
- if(source.startsWith("+"))
- {
- node->setSumAll(true);
- source= source.remove(0, 1);
- }
- if(readCloseParentheses(source))
- {
- node->setCommand(instructions);
- node->setTimeNode(tmp);
- return true;
- }
- }
+ node->setSumAll(true);
+ source= source.remove(0, 1);
+ }
+ if(readCloseParentheses(source))
+ {
+ node->setCommand(instructions);
+ node->setTimeNode(tmp);
+ return true;
}
}
+
return false;
}
bool ParsingToolBox::readExpression(QString& str, ExecutionNode*& node)