mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Functions are successfully called, read more
Return keyword is not yet implemented. Functions are untested. See #163
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
fn name(param1: int, param2: float, param3: string, param4) {
|
||||
print param1;
|
||||
print param2;
|
||||
print param3;
|
||||
print param4;
|
||||
}
|
||||
|
||||
name(42, 3.14, "hello world", -1);
|
||||
|
||||
fn name(foobar: bool const) {
|
||||
print foobar;
|
||||
}
|
||||
//URGENT: return values are still needed
|
||||
|
||||
fn output(arg) {
|
||||
print arg;
|
||||
}
|
||||
|
||||
output(null);
|
||||
output(true);
|
||||
output(42);
|
||||
output(3.1415);
|
||||
output("woot!");
|
||||
output([1, 23, 3]);
|
||||
output(["key":1]);
|
||||
output(name);
|
||||
Reference in New Issue
Block a user