mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
The arrays and dictionaries are currently being printed out correctly, afaik. This means I should be able to go back and work on the type system, assuming nothing happens.
40 lines
598 B
Plaintext
40 lines
598 B
Plaintext
//single line comment
|
|
|
|
/*
|
|
multi line comment
|
|
*/
|
|
|
|
print "hello world";
|
|
print null;
|
|
print true;
|
|
print false;
|
|
print 42;
|
|
print 3.14;
|
|
print -69;
|
|
print -4.20;
|
|
print 2 + (3 * 3);
|
|
|
|
//test scopes
|
|
{
|
|
print "This statement is within a scope.";
|
|
{
|
|
print "This is a deeper scope.";
|
|
}
|
|
}
|
|
print "Back to the outer scope.";
|
|
|
|
|
|
print [1, 2, 3];
|
|
print [4, 5];
|
|
print ["key":"value"];
|
|
|
|
|
|
//var arr : [int] = [1, 2, 3, 42];
|
|
//var dict : [string, int] = ["hello": 1, "world":2];
|
|
|
|
|
|
//test asserts at the end of the file
|
|
assert true, "This won't be seen";
|
|
assert false, "This is a failed assert, and will end execution";
|
|
|