From 56e18402300f730828204f5aa05eac9df7adfca3 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 25 Apr 2020 01:07:14 -0400 Subject: fixed problem where local structs were named in c --- tests/arr3.toc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/arr3.toc b/tests/arr3.toc index cfbbc5a..4310d64 100644 --- a/tests/arr3.toc +++ b/tests/arr3.toc @@ -1,11 +1,6 @@ #include "io.toc"; #include "mem.toc"; -Arr ::= struct (t :: Type) { - data: []t; - len, cap: int; -}; - arr_add ::= fn(t ::=, a : &Arr(t), x : t) { if a.len >= a.cap { @@ -33,14 +28,14 @@ square ::= fn(t ::=, x : t) t { }; -// ArrInt ::= Arr(int); +ArrInt ::= Arr(int); inc ::= fn(t ::=, x : t) t { x + 1 }; main ::= fn() { - arr : Arr(int); + arr : ArrInt; farr : Arr(float); for i := 1..100 { arr_add(&arr, inc(square(i))); @@ -53,3 +48,8 @@ main ::= fn() { puti(farr.data[i] as int); } }; + +Arr ::= struct (t :: Type) { + data: []t; + len, cap: int; +}; -- cgit v1.2.3