diff --git a/test.ref b/test.ref index 4610e14..f472230 100644 --- a/test.ref +++ b/test.ref @@ -9,8 +9,8 @@ o = Object.new(foo:42, bar: 666) => <> o.foo => 42 Point.new() => <> Point.new(x: 3, y: 4) => <> - | y: 4 | x: 3 + | y: 4 twice 21 is 42 double => <> | environment: nil @@ -27,28 +27,39 @@ double => <> Point.new(x:3, y:4).magnitude() => 5.000000 <> | self: nil => - | self: nil | n: 39 + | self: nil | 0: 40 40 <> | self: nil => - | self: nil | n: 40 + | self: nil | 0: 40 41 <> | self: nil => - | self: nil | n: 41 + | self: nil | 0: 40 42 <> | self: nil => - | self: nil | n: 42 + | self: nil | 0: 40 43 + + | __codeon__: + | __eval__: + | __name__: Object + | allKeys: + | keys: + | length: + | new: + | pop: + | push: + | sorted: nil no 1 yes hello yes @@ -70,8 +81,8 @@ nil nil [KEY: __delegate__ -KEY: y KEY: x +KEY: y ] Symbol @@ -147,14 +158,13 @@ MACRO table <> | | | body: <> | | | | 0: <> | | | | | arguments: <> - | | | | | | 0: MACRO EVAL test with + | | | | | | 0: "MACRO EVAL test with " | | | | | | 1: <> | | | | | | | name: x - | | | | | | 2: and + | | | | | | 2: " and " | | | | | | 3: <> | | | | | | | name: y - | | | | | | 4: - + | | | | | | 4: "\n" | | | | | function: <> | | | | | | name: print | | | | 1: <> @@ -163,13 +173,12 @@ MACRO table <> | | | | | | body: <> | | | | | | | 0: <> | | | | | | | | arguments: <> - | | | | | | | | | 0: REPLACEMENT + | | | | | | | | | 0: "REPLACEMENT " | | | | | | | | | 1: <> | | | | | | | | | | operation: 4 | | | | | | | | | | 0: <> | | | | | | | | | | | name: x - | | | | | | | | | 2: - + | | | | | | | | | 2: "\n" | | | | | | | | function: <> | | | | | | | | | name: print | | | | | | | 1: <> @@ -193,7 +202,7 @@ AST eval => 42 65 66 67 68 69 1 two 3 four -test.txt:346: *: illegal operand types Integer and String +test.txt:381: *: 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 94b7778..f63ea51 100644 --- a/test.txt +++ b/test.txt @@ -79,6 +79,8 @@ print(counter(), "\n"); print(counter(), "\n"); print(counter(), "\n"); +print(Object, full:1, "\n"); + test(x) { print(x, " "); if (x) print("yes\n") else print("no\n") } test(nil); @@ -225,7 +227,7 @@ nil.__delegate__.__delegate__.__delegate__.println(); Object.dump() { print("["); - keys = self.keys(); + keys = self.allKeys().sorted(); for (key in keys) print("KEY: ", key, "\n"); print("]\n"); } @@ -254,7 +256,7 @@ print("P.mag ", p.magnitude(), "\n"); o = [bar:666, 1, [2, 3, 6*7], foo:42]; -print(o, "\n", full:1); +print(o, "\n", full: 1); o.dump();