doc: todo concepts

This commit is contained in:
Artemy 2022-08-02 21:07:10 +03:00
parent 4cd76f6f82
commit e9c84d1066

View file

@ -1,3 +1,5 @@
// Now the file with the extension .json5, but then it will be .onla
[ [
//print functions //print functions
{ {
@ -18,4 +20,72 @@
//Exit functions //Exit functions
"Exit", "Exit",
"ErrExit", "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
],
},
},
] ]