- 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'>
or python3 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 == b
or a === b
- Inequal:
a != b
or a !== 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)
where a
is an expression(s), and b
is a function
- obj (for unknown or flexible types)
- string
- int
- float
- null
- boolean
put(args...)
-> Standard print function
memaddr(obj)
-> Retrieves memory address for obj
input(prompt[, callable])
-> Retrieves user input with an optional callable
param to evaluate the validity of the result of user input, continues callable evaluates to true
converter.to_integer(x)
-> Attempts to convert x
to an integer
converter.to_float(x)
-> Attempts to convert x
to a float
converter.to_string(x)
-> Converts x
to a string
converter.to_boolean(x)
-> Evaluates the truthiness of x
and returns it
str.lower(x)
-> Converts x
to a string and makes it lowercase
str.upper(x)
-> Converts x
to a string and makes it uppercase
str.capitalize(x)
-> Converts x
to a string and capitalizes it
fn my_func(int param1, string param2) : return_type {
// fn body
return value;
}
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;
}