diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-05-13 12:03:11 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-05-13 12:03:11 -0400 |
commit | a4036bd286871536e5d3ffa28c233516931f285b (patch) | |
tree | 6a08b30d6a68f2a259ec7c94d475c5f04131ceeb /tests | |
parent | 2804529f75b149b579eb0f724358d519935ff08a (diff) |
fixed types test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/types.toc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/tests/types.toc b/tests/types.toc index 31d6962..7e56f91 100644 --- a/tests/types.toc +++ b/tests/types.toc @@ -1,6 +1,25 @@ #include "std/io.toc", io; #include "std/mem.toc"; +z ::= nms { + Foo ::= struct(f ::= fn() int { 7 }) { + x: int; + } + + Bar ::= fn() &(struct { x, y: int; f ::= fn() int { 13 } } ) { + x : u64; + &x as &void + } + + + foo ::= fn() total : int = 0 { + f: Foo(); + total += f.f(); + total += Bar().f(); + } +} + + main ::= fn() { nums := news(int, 10); for x, i := &nums { @@ -49,22 +68,3 @@ Foo ::= struct { Bar ::= struct { f: Foo; } - -z ::= nms { - Foo ::= struct(f ::= fn() int { 7 }) { - x: int; - } - - Bar ::= fn() &(struct { x, y: int; f ::= fn() int { 13 } } ) { - x : u64; - &x as &void - } - - - foo ::= fn() total : int = 0 { - f: Foo(); - total += f.f(); - total += Bar().f(); - } -} - |