mirror of
https://github.com/artegoser/ONLang
synced 2024-11-05 20:43:57 +03:00
doc: nested loops
This commit is contained in:
parent
86e46e9695
commit
54cef02d79
1 changed files with 31 additions and 1 deletions
32
test.json5
32
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] },
|
||||
|
|
Loading…
Reference in a new issue