Basic programming language i'm developing using python
- download repository
- excract it to empty folder
- add the folder to path
-
Hello World!
echo "Hello World!" /echo
-
Input and variable
"text": input "Type your input: " /input echo "Input: " + $"text" /echo
-
If statements
"i": 25 "j": 50 if $"i" == 25 ?? echo "Hello World!" /echo if $"j"/2 == $"i" ?? echo "Hello World!" /echo /if /if
Or:
"i": 1 if $"i" == 1 ?? ;; echo "Hello World!" /echo ;; /if
-
Loops
"i": 0 "text": "Hello World!" loop $"i" != $"text".len ?? echo $"text"[$"i"] /echo "i": $"i"++ /loop
Or:
"i": 0 "text": "Hello World!" loop $"i" != $"text".len ?? ;; echo $"text"[$"i"] /echo ;; "i": $"i"++ ;; /loop
-
Functions
function add ?? "add.1", "add.2" "add.result": $"add.1" + $"add.2" return $"add.result" /return /function "example_function_call": add 1, 2 /add echo $"example_function_call" /echo
Or:
function add ?? "add.1", "add.2" ;; return $"add.1" + $"add.2" /return ;; /function echo add 1, 2 /add /echo
-
Type checking for a string returns "string" for a number returns "number" for an array returns "array"
"1": 10 "2": 10.5 "3": "Hello World!" "4": "10" "5": [1, 2, 3] echo type $"1" /type /echo echo type $"2" /type /echo echo type $"3" /type /echo echo type $"4" /type /echo echo type $"5" /type /echo
-
Including an file
lib.lea
"my_var": 10
main.lea
inc "lib.lea" /inc echo $"my_var" /echo