aboutsummaryrefslogtreecommitdiff
path: root/Sil/Util.icl
diff options
context:
space:
mode:
Diffstat (limited to 'Sil/Util.icl')
-rw-r--r--Sil/Util.icl14
1 files changed, 8 insertions, 6 deletions
diff --git a/Sil/Util.icl b/Sil/Util.icl
index 68d8928..ad7cfac 100644
--- a/Sil/Util.icl
+++ b/Sil/Util.icl
@@ -83,13 +83,15 @@ instance PrettyPrinter Initialisation
where
print st init = st <+ init.init_type <+ " " <+ init.init_name <+ ";"
-instance PrettyPrinter Statement
+instance PrettyPrinter Statement where print st stm = st <+ stm <+ ";"
+
+instance toString Statement
where
- print st (Declaration n a) = st <+ n <+ " " <+ TAssign <+ " " <+ a <+ ";"
- print st (Application app) = st <+ app <+ ";"
- print st (Return Nothing) = st <+ "return;"
- print st (Return (Just a)) = st <+ "return " <+ a <+ ";"
- print st _ = st <+ "<<unimplemented Statement>>"
+ toString (Declaration n a) = n <+ " " <+ TAssign <+ " " <+ a
+ toString (Application app) = toString app
+ toString (Return Nothing) = "return"
+ toString (Return (Just a)) = "return " <+ a <+ ""
+ toString _ = "<<unimplemented Statement>>"
instance toString Type
where