From 8ee9c4372efce878e817c49b375a8fd904ea5a43 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 21 Aug 2020 22:56:05 +0200 Subject: draft to fix repeater node. --- parsingtoolbox.cpp | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'parsingtoolbox.cpp') 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) -- cgit v1.2.3-70-g09d2