Expression statements and assignemnts are working

This commit is contained in:
2022-08-14 19:57:15 +01:00
parent e9ab6f3f96
commit 4aa6f75ea7
7 changed files with 112 additions and 50 deletions

View File

@@ -52,18 +52,20 @@ print [:];
//test nested compounds
print [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
//not ready yet
//var declarations
var x = 31;
var y : int = 42;
var arr : [int] = [1, 2, 3, 42];
var dict : [string, int] = ["hello": 1, "world":2];
//print x;
//print x + y;
//print arr;
//print dict;
//printing expressions
print x;
print x + y;
print arr;
print dict;
//test asserts at the end of the file
assert x, "This won't be seen";
assert true, "This won't be seen";
assert false, "This is a failed assert, and will end execution";