From 5598b131e2b68e33fe16b3fb215fbc4b7f8caf43 Mon Sep 17 00:00:00 2001 From: mtardy Date: Thu, 13 Aug 2020 12:30:38 +0200 Subject: [PATCH] Update tests --- test-object.txt | 34 +++++++++++++++++++++++++++++++++- test3.txt | 17 +++++++---------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/test-object.txt b/test-object.txt index 5ebae4b..dcb59e2 100644 --- a/test-object.txt +++ b/test-object.txt @@ -61,4 +61,36 @@ Object.print = fun () { this; } -p.println() \ No newline at end of file +p.println() + +fun println() { + apply(print, __arguments__) + print("\n") +} + +fun makeAst() { + print("Making an AST!") + return t +} + +var t = `(3+4) +println(t) + +var a = 333 +syntax double(a) { + return `(@a+@a) +} + +double(21) + +syntax until(c, b) { + return `(while (!@c) @b) +} + +var x = 0 +/* +until(x==10) { + println(x++) +} +*/ +(`x).println() \ No newline at end of file diff --git a/test3.txt b/test3.txt index f2bd8e1..9e7488d 100644 --- a/test3.txt +++ b/test3.txt @@ -1,12 +1,9 @@ -var o = {} -o.a = 12 -o.b = "salut" -var c = clone(o, "12"); +var num = `4; // THESE ARE THE +var ast = `(3+@num); // IMPORTANT 2 LINES -c.a = 24 -c.b = "au revoir" -c.chips = "on va manger, des chips!!!" +fun f() { + var c = `4+3 + return 5 + @c +} - -o -c \ No newline at end of file +f() \ No newline at end of file