From 1703085b25fa82459e306737ae88ee6fb0ece910 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 28 Jul 2017 11:54:40 +0200 Subject: Resolve #1: implement lists (tuples have been done earlier) --- Sil/Syntax.icl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Sil/Syntax.icl') diff --git a/Sil/Syntax.icl b/Sil/Syntax.icl index cc5c3ba..53384b3 100644 --- a/Sil/Syntax.icl +++ b/Sil/Syntax.icl @@ -32,7 +32,10 @@ where toString (BuiltinApp op e) = op <+ "(" <+ e <+ ")" toString (BuiltinApp2 e1 op e2) = "(" <+ e1 <+ ") " <+ op <+ " (" <+ e2 <+ ")" toString (Tuple _ es) = "(" <+ printersperse ", " es <+ ")" - toString (Field f e) = e <+ "." <+ f + toString (List (Just t) []) = "[" <+ t <+ "]" + toString (List (Just t) es) = "[" <+ t <+ ":" <+ printersperse ", " es <+ "]" + toString (List Nothing es) = "[" <+ printersperse ", " es <+ "]" + toString (Field f e) = "(" <+ e <+ ")." <+ f instance toString Op1 where @@ -49,6 +52,7 @@ where toString Equals = "==" toString LogOr = "||" toString LogAnd = "&&" + toString Cons = ":" instance toString Literal where -- cgit v1.2.3