diff --git a/scripts/example.toy b/scripts/example.toy index e81025a..29c8ea9 100644 --- a/scripts/example.toy +++ b/scripts/example.toy @@ -4,6 +4,7 @@ multi line comment */ +//test primitive literals print "hello world"; print null; print true; @@ -23,7 +24,7 @@ print 2 + (3 * 3); } print "Back to the outer scope."; - +//test compounds print [1, 2, 3]; print [4, 5]; print ["key":"value"]; @@ -31,16 +32,23 @@ print [1, 2, 3]; print [4, 5]; print ["key":"value"]; -//empties +//test empties print []; print [:]; -//recursive +//test nested compounds print [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; +//not ready yet +//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; //test asserts at the end of the file assert true, "This won't be seen"; diff --git a/source/parser.c b/source/parser.c index a0ec6be..86860e1 100644 --- a/source/parser.c +++ b/source/parser.c @@ -574,7 +574,7 @@ static bool calcStaticBinaryArithmetic(Node** nodeHandle) { return true; } - //optimize by converting this node into a literal + //optimize by converting this node into a literal node freeNode((*nodeHandle)->binary.left); freeNode((*nodeHandle)->binary.right);