Files
Toy/scripts/example.toy
Kayne Ruse 6d5549fc8e Added scopes using '{}' symbols, read more
I've also added a new literal type called 'identifier'. This will be
used for variable names, and has a type mask embedded in it.
2022-08-08 15:02:12 +01:00

30 lines
396 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.";
//test asserts
assert true, "This won't be seen";
assert false, "This is an error";