From 23eeaac32323bf70c1f84cb9a13d9e5a57bc04ee Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 17 Jul 2017 22:44:24 +0000 Subject: Fix some incorrect ABC instructions --- Sil/Util.icl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Sil/Util.icl') 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 <+ "<>" + toString (Declaration n a) = n <+ " " <+ TAssign <+ " " <+ a + toString (Application app) = toString app + toString (Return Nothing) = "return" + toString (Return (Just a)) = "return " <+ a <+ "" + toString _ = "<>" instance toString Type where -- cgit v1.2.3