sanity checks
[cc1516.git] / AST.icl
diff --git a/AST.icl b/AST.icl
index 43c46f7..6f2e5c6 100644 (file)
--- a/AST.icl
+++ b/AST.icl
@@ -63,7 +63,7 @@ instance print Type where
        print BoolType = print "Bool"
        print CharType = print "Char"
     print VoidType = print "Void"
-    print (t1 ->> t2) = print t1 ++ [" -> ":print t2]
+    print (t1 ->> t2) = ["(":print t1 ++ [" -> ":print t2]] ++ [")"]
 
 instance print String where
        print s = [s]
@@ -75,7 +75,7 @@ instance print FieldSelector where
        print FieldFst = print "fst"
 
 instance print VarDef where
-       print (VarDef i fs) = printersperse "." [i:flatten $ map print fs]
+       print (VarDef i fs) = printersperse "." [i:printersperse "" fs]
 
 instance toString Op2 where
        toString o = case o of
@@ -110,3 +110,6 @@ printFunCall s args = [s, "(":printersperse "," args] ++ [")"]
 
 derive gEq Op2
 instance == Op2 where (==) o1 o2 = gEq{|*|} o1 o2
+
+instance zero Pos where
+       zero = {line=0, col=0}