From e9c84d1066ba8ecf539eee510855a6c33dbfea95 Mon Sep 17 00:00:00 2001 From: Artemy Date: Tue, 2 Aug 2022 21:07:10 +0300 Subject: [PATCH] doc: todo concepts --- test.json5 | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test.json5 b/test.json5 index 636668e..c70cbb0 100644 --- a/test.json5 +++ b/test.json5 @@ -1,3 +1,5 @@ +// Now the file with the extension .json5, but then it will be .onla + [ //print functions { @@ -18,4 +20,72 @@ //Exit functions "Exit", "ErrExit", + + //TODO CONCEPTS --------------------- + + //variables------------ + + //defining variables + { + let: { + var: "value", + anotherVar: true, + }, + }, + + //print variables + { print: "@var" }, + ["This is ", "@var"], + + //assign variables + { + assign: { var: "newvalue" }, + }, + + //------------------- + + //math-------------- + { + calc: ["@var", "+", 1], + }, + + //or + { + calc: ["@var", "+", { calc: [1, "*", 2] }], + }, + //------------------ + + //comparison-------- + { + comp: [1, ">=", "@var"], + }, + //or + { + comp: [ + { comp: [{ calc: [1, "+", 1] }, ">", 1] }, + "&&", + { comp: ["@var", ">=", 2] }, + ], + }, + //------------------ + + //cycles + { + loop: [ + { + let: { + var: "val", + }, + }, + "@var", + ], + }, + { + while: { + cond: { comp: [1, ">=", "@var"] }, + body: [ + //commands + ], + }, + }, ]