aboutsummaryrefslogtreecommitdiff
path: root/ABC/Assembler.icl
diff options
context:
space:
mode:
Diffstat (limited to 'ABC/Assembler.icl')
-rw-r--r--ABC/Assembler.icl13
1 files changed, 11 insertions, 2 deletions
diff --git a/ABC/Assembler.icl b/ABC/Assembler.icl
index d8e616a..29e2d5b 100644
--- a/ABC/Assembler.icl
+++ b/ABC/Assembler.icl
@@ -9,9 +9,18 @@ import ABC.Misc
instance toString Assembler
where
toString [] = ""
- toString [stm=:(Label l):r] = stm <+ "\n" <+ r
+ toString [stm=:(Label l):r] = stm <+ "\r\n" <+ r
toString [stm=:(Descriptor _ _ _ _):r] = toString r
- toString [stm :r] = "\t" <+ stm <+ "\n" <+ r
+ toString [stm :r] = "\t" <+ stm <+ "\r\n" <+ r
+
+instance <<< Assembler
+where
+ <<< f [] = f
+ <<< f [stm=:(Label l):r] = f <<< stm <<< "\r\n" <<< r
+ <<< f [stm=:(Descriptor _ _ _ _):r] = f <<< r
+ <<< f [stm :r] = f <<< "\t" <<< stm <<< "\r\n" <<< r
+
+instance <<< Statement where <<< f st = f <<< toString st
generic gPrint a :: !a -> [Char]
gPrint{|Int|} x = fromString (toString x)