- Python 3.8+
- Installation of requirements.txt
pip install -r requirements.txt
- Windows:
python deity.py file_path <'debug'> - Linux:
./deity.py file_path <'debug'>orpython3 deity.py file_path <'debug'> - Run all tests: Replace file_path with
runall
- Less Than:
a < b - Greater Than:
a > b - Less than or equal to:
a <= b - Greater than or equal to:
a >= b - Equal:
a == bora === b - Inequal:
a != bora !== b - And:
a && b - Or:
a || b - Logical not:
!a - Addition:
a + b - Subtraction:
a - b - Multiplication:
a * b - Division:
a / b - Modulo:
a % b - Accessor:
a.b - Pipe:
(a) | (b)whereais an expression(s), andbis a function
- obj (for unknown or flexible types)
- string
- int
- float
- null
- boolean
- true
- false
- null
put(args...)-> Standard print functionmemaddr(obj)-> Retrieves memory address for objinput(prompt[, callable])-> Retrieves user input with an optionalcallableparam to evaluate the validity of the result of user input, continues callable evaluates to trueconverter.to_integer(x)-> Attempts to convertxto an integerconverter.to_float(x)-> Attempts to convertxto a floatconverter.to_string(x)-> Convertsxto a stringconverter.to_boolean(x)-> Evaluates the truthiness ofxand returns itstr.lower(x)-> Convertsxto a string and makes it lowercasestr.upper(x)-> Convertsxto a string and makes it uppercasestr.capitalize(x)-> Convertsxto a string and capitalizes it
fn my_func(int param1, string param2) : return_type {
// fn body
return value;
}my_func(123, "abc");string my_string = "abc";
int my_int = 123;
boolean x = true;
boolean y = false;my_string = "def";
my_int = 456;string a = "abc";
if (a == "abc") { // parentheses optional
put("a is abc");
} else if (a == "def") {
put("a is def");
}for int i : (1, 10) { // (1, 10, 1) (start, stop[, step=1])
put(i);
}int i = 0;
while (i < 30) {
put(i);
i = i + 1;
}