embeddable code language
Go to file
2025-01-11 19:48:15 +03:00
src IDK updates 2025-01-11 19:48:15 +03:00
.gitignore gitignore 2025-01-07 03:36:39 +03:00
Cargo.toml IDK updates 2025-01-11 19:48:15 +03:00
LICENSE IDK updates 2025-01-11 19:48:15 +03:00
README.md IDK updates 2025-01-11 19:48:15 +03:00
test.emc IDK updates 2025-01-11 19:48:15 +03:00

Emcode

Embeddable code compiler

// comment

// var value types:
//   null     - null
//   string   - "123"
//   int      - 123
//   float    - 12.3
//   map      - {"key": "value"}
//   list     - {"item", "item"}
//   function - [arg1, arg2] { /* some code */ }

// 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)

var a = "1" // initial var value (can use operations)
a = 2       // set var value (can use operations)
del a       // delete var

let list = {"a", "b"}
list.2 = "c" // set value by key/index (maps works definitely the same)

var func = [a] { // create function
    print [a] // using print function
    return 1 // return data, null by default
}

1 // just var value

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 {

} else {
    
}