diff --git a/test.ref b/test.ref index dac0403..32a8366 100644 --- a/test.ref +++ b/test.ref @@ -12,7 +12,18 @@ Point.new(x: 3, y: 4) => <> | y: 4 | x: 3 twice 21 is 42 -double => +double => <> + | environment: nil + | function: <> + | | body: <> + | | | 0: <> + | | | | operation: 13 + | | | | 0: <> + | | | | | name: x + | | | | 1: <> + | | | | | name: x + | | parameters: <> + | | | 0: x Point.new(x:3, y:4).magnitude() => 5.000000 <> | self: nil => @@ -50,7 +61,7 @@ ok ---- MyType.__eval__() invoked 42 - +<> ==== 42 hello @@ -130,7 +141,44 @@ f 102 ( 40 ) 41 32 { 123 32 p 112 r 114 i 105 n 110 t 116 ( 40 _ 95 _ 95 e 1 42 6 * 7 MACRO table <> - | test: + | test: <> + | | environment: nil + | | function: <> + | | | body: <> + | | | | 0: <> + | | | | | arguments: <> + | | | | | | 0: MACRO EVAL test with + | | | | | | 1: <> + | | | | | | | name: x + | | | | | | 2: and + | | | | | | 3: <> + | | | | | | | name: y + | | | | | | 4: + + | | | | | function: <> + | | | | | | name: print + | | | | 1: <> + | | | | | operation: 3 + | | | | | 0: <> + | | | | | | body: <> + | | | | | | | 0: <> + | | | | | | | | arguments: <> + | | | | | | | | | 0: REPLACEMENT + | | | | | | | | | 1: <> + | | | | | | | | | | operation: 4 + | | | | | | | | | | 0: <> + | | | | | | | | | | | name: x + | | | | | | | | | 2: + + | | | | | | | | function: <> + | | | | | | | | | name: print + | | | | | | | 1: <> + | | | | | | | | operation: 4 + | | | | | | | | 0: <> + | | | | | | | | | name: y + | | | parameters: <> + | | | | 0: x + | | | | 1: y define testfun MACRO EVAL test with 1 and 2 MACRO EVAL test with three and four @@ -142,6 +190,8 @@ REPLACEMENT three 0 1 2 3 4 5 6 7 8 9 65 66 67 68 69 1 two 3 four + +test.txt:331: *: illegal operand types Integer and String 11: n * factorial(n - 1) 10: if (n < 2) "1" else n * factorial(n - 1) 9: factorial(n - 1) diff --git a/test.txt b/test.txt index 475bb5a..5419ceb 100644 --- a/test.txt +++ b/test.txt @@ -97,7 +97,7 @@ assert(x) { } } -makeForm(assert); +assert.fixed = #t; // do not evaluate arguments (x will be an AST suitable for eval()) refute(x) { if (eval(x)) { @@ -106,7 +106,9 @@ refute(x) { } } -makeForm(refute); +refute.fixed = #t; + +refute; assert(1 == 1); refute(1 == 0);