From 54cef02d79e498c88ae179e63d123e3fa4cbab5e Mon Sep 17 00:00:00 2001 From: Artemy Date: Thu, 4 Aug 2022 11:21:39 +0300 Subject: [PATCH] doc: nested loops --- test.json5 | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test.json5 b/test.json5 index c7d34ba..ebdd119 100644 --- a/test.json5 +++ b/test.json5 @@ -170,7 +170,37 @@ calculated: { calc: [{ var: "calculated" }, "+", 1] }, }, }, - { print: ["\rcalculated = ", { var: "calculated" }] }, + { + loop: [ + { + if: { + condition: { comp: [{ var: "num" }, ">=", 200000] }, + body: ["break"], + }, + }, + { + assign: { + num: { calc: [{ var: "num" }, "+", 1] }, + }, + }, + { + print: [ + "\rcalculated = ", + { var: "calculated" }, + "; num = ", + { var: "num" }, + ], + }, + ], + }, + { + print: [ + "\rcalculated = ", + { var: "calculated" }, + "; num = ", + { var: "num" }, + ], + }, { if: { condition: { comp: [{ var: "calculated" }, ">=", 200000] },