From a4036bd286871536e5d3ffa28c233516931f285b Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 13 May 2020 12:03:11 -0400 Subject: fixed types test --- tests/types.toc | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'tests') 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(); - } -} - -- cgit v1.2.3