From c3a3e3b1f2edab60a80871b167f24a7b9eace433 Mon Sep 17 00:00:00 2001 From: frungl Date: Sat, 1 Apr 2023 14:26:06 +0300 Subject: [PATCH 1/8] the keyword downto was added for the for block --- README.md | 8 +++++--- README.ru.md | 7 ++++--- examples/for_downto.pr | 16 ++++++++++++++++ source/display.d | 6 +++++- source/language.d | 4 +++- source/parser.d | 9 +++++++-- source/runner.d | 11 ++++++++--- syntax.txt | 1 + 8 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 examples/for_downto.pr diff --git a/README.md b/README.md index c4233a0..e3b68ae 100644 --- a/README.md +++ b/README.md @@ -208,12 +208,14 @@ It is followed by one or more statements using the same deeper indentation. As long as the expression `` evaluates to non-zero, the statements are executed from top to bottom, and `` is evaluated again. -* `for := until :` is a for block. +* `for := until/downto :` is a for block. It is followed by one or more statements using the same deeper indentation. It first assigns the value of expression `` to variable ``. -Then, as long as `` is strictly less than the value of expression ``, +Then, if the `until` keyword is used, as long as `` is strictly less than the value of expression ``, the statements are executed from top to bottom, the variable is increased by one, -and the condition is evaluated again. +and the condition is evaluated again. If the keyword `downto` has been used, as long as `` is not strictly greater than the value of the expression ``, +the statements are executed from top to bottom, the value of the variable is decremented by one, +after which the condition is checked again. ### Expressions diff --git a/README.ru.md b/README.ru.md index e7a7f61..afe20e7 100644 --- a/README.ru.md +++ b/README.ru.md @@ -234,14 +234,15 @@ function (, , ...): эти команды выполняются сверху вниз, после чего значение `` вычисляется снова. -* `for := until :` — начало for-блока. +* `for := until/downto :` — начало for-блока. За этой строкой следуют одна или несколько команд с одинаковым более глубоким отступом. Сначала эта команда присваивает значение выражения `` переменной с именем ``. -Затем, пока `` строго меньше значения выражения ``, +Затем, если использовано ключевое слово `until`, то пока `` строго меньше значения выражения ``, команды выполняются сверху вниз, значение переменной увеличивается на единицу, -после чего условие проверяется снова. +после чего условие проверяется снова. Если же было использовано ключевое слово `downto`, то пока `` нестрого больше значения выражения ``, +команды выполняются сверху вниз, значение переменной уменьшается на единицу,после чего условие проверяется снова. ### Выражения diff --git a/examples/for_downto.pr b/examples/for_downto.pr new file mode 100644 index 0000000..262f95b --- /dev/null +++ b/examples/for_downto.pr @@ -0,0 +1,16 @@ +function sum (id, pr, n, a): + lo := id * n / pr + hi := (id + 1) * n / pr + + s := 0 + for i := hi - 1 downto lo: + s += a[i] + send (0, s) + + if id == 0: + r := 0 + for k := pr - 1 downto 0: + r += receive (k) + print (r) + + b := array (hi - lo) diff --git a/source/display.d b/source/display.d index c60e11b..4ce9ace 100644 --- a/source/display.d +++ b/source/display.d @@ -117,7 +117,11 @@ void display (Statement s, int indent) { write ("for ", cur.name, " := "); display (cur.start); - write (" until "); + if (cur.isUntil) { + write (" until "); + } else { + write (" downto "); + } display (cur.finish); writeln (":"); foreach (r; cur.statementList) diff --git a/source/language.d b/source/language.d index 94e9caf..d15ea53 100644 --- a/source/language.d +++ b/source/language.d @@ -70,13 +70,15 @@ final class WhileBlock : Statement final class ForBlock : Statement { string name; + bool isUntil; Expression start; Expression finish; Statement [] statementList; - this (int lineId_, string name_, Expression start_, Expression finish_) + this (int lineId_, string name_, bool isUntil_, Expression start_, Expression finish_) { lineId = lineId_; + isUntil = isUntil_; name = name_; start = start_; finish = finish_; diff --git a/source/parser.d b/source/parser.d index c01e321..ab41925 100644 --- a/source/parser.d +++ b/source/parser.d @@ -411,13 +411,18 @@ final class StatementParser (line, "bad name: " ~ line.tokens.front); line.tokens.consume (":=", line); auto start = parseExpression (line); - line.tokens.consume ("until", line); + auto isUntil = (line.tokens.front == "until"); + if (isUntil) { + line.tokens.consume ("until", line); + } else { + line.tokens.consume ("downto", line); + } auto finish = parseExpression (line); line.tokens.consume (":", line); check (line.tokens.empty, line, "extra token at end of line: " ~ line.tokens.front); - ForBlock res = new ForBlock (line.lineId, name, start, finish); + ForBlock res = new ForBlock (line.lineId, name, isUntil, start, finish); res.statementList = parseBlock (prevIndent); return res; } diff --git a/source/runner.d b/source/runner.d index c45c9bf..8b51995 100644 --- a/source/runner.d +++ b/source/runner.d @@ -544,7 +544,7 @@ class Runner vars[name] = Var (startValue); delay = complexity; delay += 3; - if (vars[name].value < finishValue) + if ((isUntil && vars[name].value < finishValue) || (!isUntil && vars[name].value >= finishValue)) { pos += 1; } @@ -557,9 +557,14 @@ class Runner { auto finishValue = evalExpression (finish); - vars[name].value += 1; + if (isUntil) { + vars[name].value += 1; + } + else { + vars[name].value -= 1; + } delay += 7; - if (vars[name].value < finishValue) + if ((isUntil && vars[name].value < finishValue) || (!isUntil && vars[name].value >= finishValue)) { pos = 0; } diff --git a/syntax.txt b/syntax.txt index c4c4f5e..e68015d 100644 --- a/syntax.txt +++ b/syntax.txt @@ -109,6 +109,7 @@ while : \n is for := until : \n +for := downto : \n is if : \n From 9ec605a7fae2a0f83e46cde9537e0f2f9d0a8291 Mon Sep 17 00:00:00 2001 From: frungl Date: Sat, 1 Apr 2023 14:28:26 +0300 Subject: [PATCH 2/8] the keyword downto was added to the highlite file --- extra/Notepad++-syntax-highlighting/pr.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/Notepad++-syntax-highlighting/pr.xml b/extra/Notepad++-syntax-highlighting/pr.xml index 14f0588..ec3476a 100644 --- a/extra/Notepad++-syntax-highlighting/pr.xml +++ b/extra/Notepad++-syntax-highlighting/pr.xml @@ -25,7 +25,7 @@ function array - for until while if elif else + for until downto while if elif else send receive print id pr From 2a1d09705afa72a16bc41170b5e9b2f3a0083513 Mon Sep 17 00:00:00 2001 From: frungl Date: Sat, 1 Apr 2023 18:53:18 +0300 Subject: [PATCH 3/8] the keyword rangeto was added for the for block --- README.md | 12 ++++--- README.ru.md | 11 +++--- examples/for.pr | 10 ++++++ examples/for_downto.pr | 16 --------- extra/Notepad++-syntax-highlighting/pr.xml | 2 +- source/display.d | 14 +++++--- source/language.d | 13 +++++-- source/parser.d | 21 +++++++---- source/runner.d | 41 ++++++++++++++++++---- syntax.txt | 1 + 10 files changed, 95 insertions(+), 46 deletions(-) create mode 100644 examples/for.pr delete mode 100644 examples/for_downto.pr diff --git a/README.md b/README.md index e3b68ae..c96bdc8 100644 --- a/README.md +++ b/README.md @@ -208,14 +208,16 @@ It is followed by one or more statements using the same deeper indentation. As long as the expression `` evaluates to non-zero, the statements are executed from top to bottom, and `` is evaluated again. -* `for := until/downto :` is a for block. +* `for := until :` is a for block. It is followed by one or more statements using the same deeper indentation. It first assigns the value of expression `` to variable ``. -Then, if the `until` keyword is used, as long as `` is strictly less than the value of expression ``, +Then, as long as `` is strictly less than the value of expression ``, the statements are executed from top to bottom, the variable is increased by one, -and the condition is evaluated again. If the keyword `downto` has been used, as long as `` is not strictly greater than the value of the expression ``, -the statements are executed from top to bottom, the value of the variable is decremented by one, -after which the condition is checked again. +and the condition is evaluated again. +You can also write `rangeto`/`downto`` instead of `until`. +Then, as long as `` is not strictly less/more respectively, the value of the expression ``, +the statements are executed from top to bottom, the variable is increased/decreased, respectively, by one, +and the condition is evaluated again. ### Expressions diff --git a/README.ru.md b/README.ru.md index afe20e7..21ec2e3 100644 --- a/README.ru.md +++ b/README.ru.md @@ -234,15 +234,18 @@ function (, , ...): эти команды выполняются сверху вниз, после чего значение `` вычисляется снова. -* `for := until/downto :` — начало for-блока. +* `for := until :` — начало for-блока. За этой строкой следуют одна или несколько команд с одинаковым более глубоким отступом. Сначала эта команда присваивает значение выражения `` переменной с именем ``. -Затем, если использовано ключевое слово `until`, то пока `` строго меньше значения выражения ``, +Затем, пока `` строго меньше значения выражения ``, команды выполняются сверху вниз, значение переменной увеличивается на единицу, -после чего условие проверяется снова. Если же было использовано ключевое слово `downto`, то пока `` нестрого больше значения выражения ``, -команды выполняются сверху вниз, значение переменной уменьшается на единицу,после чего условие проверяется снова. +после чего условие проверяется снова. +Также вы можете написать `rangeto`/`downto` вместо `until`. +Затем, пока `` нестрого меньше/больше соответственно, значения выражения ``, +команды выполняются сверху вниз, значение переменной увеличивается/уменьшается соответственно, на единицу, +после чего условие проверяется снова. ### Выражения diff --git a/examples/for.pr b/examples/for.pr new file mode 100644 index 0000000..9c1c2db --- /dev/null +++ b/examples/for.pr @@ -0,0 +1,10 @@ +function for(id, pr, n, a): + if id == 0: + left := 1 + right := 3 + for i := left until right: + print(i) + for i := left rangeto right: + print(i) + for i := right downto left: + print(i) diff --git a/examples/for_downto.pr b/examples/for_downto.pr deleted file mode 100644 index 262f95b..0000000 --- a/examples/for_downto.pr +++ /dev/null @@ -1,16 +0,0 @@ -function sum (id, pr, n, a): - lo := id * n / pr - hi := (id + 1) * n / pr - - s := 0 - for i := hi - 1 downto lo: - s += a[i] - send (0, s) - - if id == 0: - r := 0 - for k := pr - 1 downto 0: - r += receive (k) - print (r) - - b := array (hi - lo) diff --git a/extra/Notepad++-syntax-highlighting/pr.xml b/extra/Notepad++-syntax-highlighting/pr.xml index ec3476a..0b71a8d 100644 --- a/extra/Notepad++-syntax-highlighting/pr.xml +++ b/extra/Notepad++-syntax-highlighting/pr.xml @@ -25,7 +25,7 @@ function array - for until downto while if elif else + for until rangeto downto while if elif else send receive print id pr diff --git a/source/display.d b/source/display.d index 4ce9ace..5c5f031 100644 --- a/source/display.d +++ b/source/display.d @@ -117,10 +117,16 @@ void display (Statement s, int indent) { write ("for ", cur.name, " := "); display (cur.start); - if (cur.isUntil) { - write (" until "); - } else { - write (" downto "); + final switch(cur.style) { + case ForStyle.until: + write (" until "); + break; + case ForStyle.rangeto: + write (" rangeto "); + break; + case ForStyle.downto: + write (" downto "); + break; } display (cur.finish); writeln (":"); diff --git a/source/language.d b/source/language.d index d15ea53..6099d93 100644 --- a/source/language.d +++ b/source/language.d @@ -67,19 +67,26 @@ final class WhileBlock : Statement } } +final enum ForStyle +{ + until, + rangeto, + downto +} + final class ForBlock : Statement { string name; - bool isUntil; + ForStyle style; Expression start; Expression finish; Statement [] statementList; - this (int lineId_, string name_, bool isUntil_, Expression start_, Expression finish_) + this (int lineId_, string name_, ForStyle style_, Expression start_, Expression finish_) { lineId = lineId_; - isUntil = isUntil_; name = name_; + style = style_; start = start_; finish = finish_; complexity = 1 + 1 + start.complexity + finish.complexity; diff --git a/source/parser.d b/source/parser.d index ab41925..944bc46 100644 --- a/source/parser.d +++ b/source/parser.d @@ -411,18 +411,27 @@ final class StatementParser (line, "bad name: " ~ line.tokens.front); line.tokens.consume (":=", line); auto start = parseExpression (line); - auto isUntil = (line.tokens.front == "until"); - if (isUntil) { - line.tokens.consume ("until", line); - } else { - line.tokens.consume ("downto", line); + ForStyle style; + final switch(line.tokens.front) { + case "until": + style = ForStyle.until; + line.tokens.consume ("until", line); + break; + case "downto": + style = ForStyle.downto; + line.tokens.consume ("downto", line); + break; + case "rangeto": + style = ForStyle.rangeto; + line.tokens.consume ("rangeto", line); + break; } auto finish = parseExpression (line); line.tokens.consume (":", line); check (line.tokens.empty, line, "extra token at end of line: " ~ line.tokens.front); - ForBlock res = new ForBlock (line.lineId, name, isUntil, start, finish); + ForBlock res = new ForBlock (line.lineId, name, style, start, finish); res.statementList = parseBlock (prevIndent); return res; } diff --git a/source/runner.d b/source/runner.d index 8b51995..8e3b321 100644 --- a/source/runner.d +++ b/source/runner.d @@ -544,7 +544,19 @@ class Runner vars[name] = Var (startValue); delay = complexity; delay += 3; - if ((isUntil && vars[name].value < finishValue) || (!isUntil && vars[name].value >= finishValue)) + bool hasNext; + final switch(style) { + case ForStyle.until: + hasNext = vars[name].value < finishValue; + break; + case ForStyle.rangeto: + hasNext = vars[name].value <= finishValue; + break; + case ForStyle.downto: + hasNext = vars[name].value >= finishValue; + break; + } + if (hasNext) { pos += 1; } @@ -557,14 +569,29 @@ class Runner { auto finishValue = evalExpression (finish); - if (isUntil) { - vars[name].value += 1; - } - else { - vars[name].value -= 1; + final switch(style) { + case ForStyle.rangeto: + case ForStyle.until: + vars[name].value += 1; + break; + case ForStyle.downto: + vars[name].value -= 1; + break; } delay += 7; - if ((isUntil && vars[name].value < finishValue) || (!isUntil && vars[name].value >= finishValue)) + bool hasNext; + final switch(style) { + case ForStyle.until: + hasNext = vars[name].value < finishValue; + break; + case ForStyle.rangeto: + hasNext = vars[name].value <= finishValue; + break; + case ForStyle.downto: + hasNext = vars[name].value >= finishValue; + break; + } + if (hasNext) { pos = 0; } diff --git a/syntax.txt b/syntax.txt index e68015d..ff283cb 100644 --- a/syntax.txt +++ b/syntax.txt @@ -109,6 +109,7 @@ while : \n is for := until : \n +for := rangeto : \n for := downto : \n is From 032475e64b94605478e81fade98a517050ac49a0 Mon Sep 17 00:00:00 2001 From: frungl Date: Sat, 1 Apr 2023 23:09:07 +0300 Subject: [PATCH 4/8] spaces after the switch + error message if the style is not valid + fix in the en readme --- README.md | 2 +- source/display.d | 2 +- source/parser.d | 4 +++- source/runner.d | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c96bdc8..0a89880 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ It first assigns the value of expression `` to variable ``. Then, as long as `` is strictly less than the value of expression ``, the statements are executed from top to bottom, the variable is increased by one, and the condition is evaluated again. -You can also write `rangeto`/`downto`` instead of `until`. +You can also write `rangeto`/`downto` instead of `until`. Then, as long as `` is not strictly less/more respectively, the value of the expression ``, the statements are executed from top to bottom, the variable is increased/decreased, respectively, by one, and the condition is evaluated again. diff --git a/source/display.d b/source/display.d index 5c5f031..0cd7a98 100644 --- a/source/display.d +++ b/source/display.d @@ -117,7 +117,7 @@ void display (Statement s, int indent) { write ("for ", cur.name, " := "); display (cur.start); - final switch(cur.style) { + final switch (cur.style) { case ForStyle.until: write (" until "); break; diff --git a/source/parser.d b/source/parser.d index 944bc46..01382ee 100644 --- a/source/parser.d +++ b/source/parser.d @@ -412,7 +412,7 @@ final class StatementParser line.tokens.consume (":=", line); auto start = parseExpression (line); ForStyle style; - final switch(line.tokens.front) { + switch (line.tokens.front) { case "until": style = ForStyle.until; line.tokens.consume ("until", line); @@ -425,6 +425,8 @@ final class StatementParser style = ForStyle.rangeto; line.tokens.consume ("rangeto", line); break; + default: + check (false, line, '\'' ~ line.tokens.front ~ "\' is not the of the for block"); } auto finish = parseExpression (line); line.tokens.consume (":", line); diff --git a/source/runner.d b/source/runner.d index 8e3b321..a797afb 100644 --- a/source/runner.d +++ b/source/runner.d @@ -545,7 +545,7 @@ class Runner delay = complexity; delay += 3; bool hasNext; - final switch(style) { + final switch (style) { case ForStyle.until: hasNext = vars[name].value < finishValue; break; @@ -569,7 +569,7 @@ class Runner { auto finishValue = evalExpression (finish); - final switch(style) { + final switch (style) { case ForStyle.rangeto: case ForStyle.until: vars[name].value += 1; @@ -580,7 +580,7 @@ class Runner } delay += 7; bool hasNext; - final switch(style) { + final switch (style) { case ForStyle.until: hasNext = vars[name].value < finishValue; break; From 430c9fa9de75efe9d8fcea7b67af11c0f916a1d7 Mon Sep 17 00:00:00 2001 From: frungl Date: Sat, 1 Apr 2023 23:12:26 +0300 Subject: [PATCH 5/8] fix error message if the style is not valid --- source/parser.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/parser.d b/source/parser.d index 01382ee..7262f73 100644 --- a/source/parser.d +++ b/source/parser.d @@ -426,7 +426,7 @@ final class StatementParser line.tokens.consume ("rangeto", line); break; default: - check (false, line, '\'' ~ line.tokens.front ~ "\' is not the of the for block"); + check (false, line, '\'' ~ line.tokens.front ~ "\' is not the keyword of the for block"); } auto finish = parseExpression (line); line.tokens.consume (":", line); From 022f7ab8a5ffef89ad21e11ee317f4fa58bf866d Mon Sep 17 00:00:00 2001 From: frungl Date: Sun, 2 Apr 2023 00:17:57 +0300 Subject: [PATCH 6/8] replaced string constants with an understandable implementation --- source/display.d | 12 +----------- source/language.d | 2 ++ source/parser.d | 25 ++++++++++--------------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/source/display.d b/source/display.d index 0cd7a98..2ddc8ca 100644 --- a/source/display.d +++ b/source/display.d @@ -117,17 +117,7 @@ void display (Statement s, int indent) { write ("for ", cur.name, " := "); display (cur.start); - final switch (cur.style) { - case ForStyle.until: - write (" until "); - break; - case ForStyle.rangeto: - write (" rangeto "); - break; - case ForStyle.downto: - write (" downto "); - break; - } + writef (" %s ", forStyleNames[cur.style]); display (cur.finish); writeln (":"); foreach (r; cur.statementList) diff --git a/source/language.d b/source/language.d index 6099d93..d0bfe0e 100644 --- a/source/language.d +++ b/source/language.d @@ -74,6 +74,8 @@ final enum ForStyle downto } +immutable string[] forStyleNames = ["until", "rangeto", "downto"]; + final class ForBlock : Statement { string name; diff --git a/source/parser.d b/source/parser.d index 7262f73..6dc4345 100644 --- a/source/parser.d +++ b/source/parser.d @@ -412,22 +412,17 @@ final class StatementParser line.tokens.consume (":=", line); auto start = parseExpression (line); ForStyle style; - switch (line.tokens.front) { - case "until": - style = ForStyle.until; - line.tokens.consume ("until", line); - break; - case "downto": - style = ForStyle.downto; - line.tokens.consume ("downto", line); - break; - case "rangeto": - style = ForStyle.rangeto; - line.tokens.consume ("rangeto", line); - break; - default: - check (false, line, '\'' ~ line.tokens.front ~ "\' is not the keyword of the for block"); + auto count = forStyleNames.countUntil (line.tokens.front); + if (count < 0) + { + check (false, line, '\'' ~ line.tokens.front ~ "\' is not the keyword of the for block"); + } + else + { + style = cast (ForStyle) count; + line.tokens.consume (forStyleNames[count], line); } + auto finish = parseExpression (line); line.tokens.consume (":", line); check (line.tokens.empty, line, From 50e21d2e0eeb6f2dcb42bc7274a3ea39df9c9fb3 Mon Sep 17 00:00:00 2001 From: frungl Date: Sun, 2 Apr 2023 01:06:37 +0300 Subject: [PATCH 7/8] switch is placed in a separate function --- source/runner.d | 61 +++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/source/runner.d b/source/runner.d index a797afb..1ef2625 100644 --- a/source/runner.d +++ b/source/runner.d @@ -531,6 +531,29 @@ class Runner return true; } + bool hasNext(long value, long finishValue, ForStyle style) { + final switch (style) { + case ForStyle.until: + return value < finishValue; + case ForStyle.rangeto: + return value <= finishValue; + case ForStyle.downto: + return value >= finishValue; + } + } + + void setValueNext(ref long value, ForStyle style) { + final switch (style) { + case ForStyle.rangeto: + case ForStyle.until: + value += 1; + break; + case ForStyle.downto: + value -= 1; + break; + } + } + auto cur3 = cast (ForBlock) (parent); if (cur3 !is null) with (cur3) { @@ -544,19 +567,7 @@ class Runner vars[name] = Var (startValue); delay = complexity; delay += 3; - bool hasNext; - final switch (style) { - case ForStyle.until: - hasNext = vars[name].value < finishValue; - break; - case ForStyle.rangeto: - hasNext = vars[name].value <= finishValue; - break; - case ForStyle.downto: - hasNext = vars[name].value >= finishValue; - break; - } - if (hasNext) + if (hasNext(vars[name].value, finishValue, style)) { pos += 1; } @@ -569,29 +580,9 @@ class Runner { auto finishValue = evalExpression (finish); - final switch (style) { - case ForStyle.rangeto: - case ForStyle.until: - vars[name].value += 1; - break; - case ForStyle.downto: - vars[name].value -= 1; - break; - } + setValueNext(vars[name].value, style); delay += 7; - bool hasNext; - final switch (style) { - case ForStyle.until: - hasNext = vars[name].value < finishValue; - break; - case ForStyle.rangeto: - hasNext = vars[name].value <= finishValue; - break; - case ForStyle.downto: - hasNext = vars[name].value >= finishValue; - break; - } - if (hasNext) + if (hasNext(vars[name].value, finishValue, style)) { pos = 0; } From c93dd9c4cf68e2fb149d9ceced5ce0a2cbfbf367 Mon Sep 17 00:00:00 2001 From: frungl Date: Sun, 2 Apr 2023 01:14:12 +0300 Subject: [PATCH 8/8] added spaces after new function names --- source/runner.d | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/runner.d b/source/runner.d index 1ef2625..c62c120 100644 --- a/source/runner.d +++ b/source/runner.d @@ -531,7 +531,7 @@ class Runner return true; } - bool hasNext(long value, long finishValue, ForStyle style) { + bool hasNext (long value, long finishValue, ForStyle style) { final switch (style) { case ForStyle.until: return value < finishValue; @@ -542,7 +542,7 @@ class Runner } } - void setValueNext(ref long value, ForStyle style) { + void setValueNext (ref long value, ForStyle style) { final switch (style) { case ForStyle.rangeto: case ForStyle.until: @@ -567,7 +567,7 @@ class Runner vars[name] = Var (startValue); delay = complexity; delay += 3; - if (hasNext(vars[name].value, finishValue, style)) + if (hasNext (vars[name].value, finishValue, style)) { pos += 1; } @@ -580,9 +580,9 @@ class Runner { auto finishValue = evalExpression (finish); - setValueNext(vars[name].value, style); + setValueNext (vars[name].value, style); delay += 7; - if (hasNext(vars[name].value, finishValue, style)) + if (hasNext (vars[name].value, finishValue, style)) { pos = 0; }