From 7bfdc8d9c0e1ca7a388e7f59f2e4593c303bba48 Mon Sep 17 00:00:00 2001 From: MeexReay Date: Sat, 11 Jan 2025 19:48:15 +0300 Subject: [PATCH] IDK updates --- Cargo.toml | 0 LICENSE | 0 README.md | 90 +++++++++++++++++++++++----------------------------- src/lib.rs | 0 src/main.rs | 0 src/tests.rs | 0 test.emc | 0 7 files changed, 40 insertions(+), 50 deletions(-) mode change 100644 => 100755 Cargo.toml mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 src/lib.rs mode change 100644 => 100755 src/main.rs mode change 100644 => 100755 src/tests.rs mode change 100644 => 100755 test.emc diff --git a/Cargo.toml b/Cargo.toml old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 90e05b6..e8fded5 --- a/README.md +++ b/README.md @@ -5,65 +5,55 @@ Embeddable code compiler ``` // comment -var a = 0 // create var (you can not create var without initial value) -a = 1 // int, set var -a = "123" // string, dynamic var type -a = {"11": "11"} // map (map) +// var value types: +// null - null +// string - "123" +// int - 123 +// float - 12.3 +// map - {"key": "value"} +// list - {"item", "item"} +// function - [arg1, arg2] { /* some code */ } -a."11" = "44" // set value to map item +// var operations: +// addition - a + b +// subtract - a - b +// multiply - a * b +// division - a / b +// module - a % b +// and - a && b +// or - a || b +// equals - a == b +// not eq - a != b +// not - !a +// brackets - (operation) -a = {"11", "12"} // list (map) +var a = "1" // initial var value (can use operations) +a = 2 // set var value (can use operations) +del a // delete var -a.0 = "55" // set value to list element +let list = {"a", "b"} +list.2 = "c" // set value by key/index (maps works definitely the same) -a = 0.41 // float - -var c = 10 - -c = c + a // addition (works with string+string=string) -c = c - a // subtraction -c = c * a // multiplication (works with string*int=string) -c = c / a // division -c = c % a // module - -// - -// var types: -// int, float, map[key, value], string, null, function, bool - -{ - var b = 0 - - // this is scope - - // <- here local vars for scope +var func = [a] { // create function + print [a] // using print function + return 1 // return data, null by default } -// <- here global vars for scope +1 // just var value -// global scope cant see local vars (var b in this case) +func [] // also var value, but it runs function + +loop { // infinity loop + skip // skip this loop iteration + break // break loop +} + +if 1 == 2 { // run code on condition + next // go to next "else" in chain +} else if 1 != 2 { -if a == 0.42 { - // works totally like scope } else { - // has no else if or elif + } -// logical operations: -// a == b a equals b -// a >= b a greater than or equals b -// a <= b a less than or equals b -// a > b a greater than b -// a < b a less than b -// a != b a not equals b -// a || b a or b -// a && b a and b -// !a not a - -var func = [arg, arg2] { // create function. also work like scope - return "123" -} - -func ["arg1", "arg2"] // run function - ``` \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs old mode 100644 new mode 100755 diff --git a/src/main.rs b/src/main.rs old mode 100644 new mode 100755 diff --git a/src/tests.rs b/src/tests.rs old mode 100644 new mode 100755 diff --git a/test.emc b/test.emc old mode 100644 new mode 100755