aboutsummaryrefslogtreecommitdiff
path: root/ABC/Assembler.icl
diff options
context:
space:
mode:
authorCamil Staps2017-07-17 21:47:44 +0000
committerCamil Staps2017-07-17 21:47:44 +0000
commitc83e5d354b9c66491e707f3d6580709fd68a11ca (patch)
treededd23cc3a20424206228cfc71060de40f3114e6 /ABC/Assembler.icl
parentAdd <<< for Assembler and Statement (diff)
Add Comments
Diffstat (limited to 'ABC/Assembler.icl')
-rw-r--r--ABC/Assembler.icl2
1 files changed, 2 insertions, 0 deletions
diff --git a/ABC/Assembler.icl b/ABC/Assembler.icl
index 29e2d5b..8167f70 100644
--- a/ABC/Assembler.icl
+++ b/ABC/Assembler.icl
@@ -36,6 +36,7 @@ gPrint{|CONS of d|} fx (CONS x) = case d.gcd_name of
"Descriptor" = []
"Dump" = ['dump\t"'] ++ quote (fx x) ++ ['"']
"Print" = ['print\t"'] ++ quote (fx x) ++ ['"']
+ "Comment" = ['| '] ++ fx x
name = tl (cons (fromString name)) ++ ['\t':fx x]
where
cons :: ![Char] -> [Char]
@@ -104,6 +105,7 @@ translate :: Assembler Int SymTable -> [Instruction]
translate [] _ _ = []
translate [Label _ :r] lc syms = translate r lc syms
translate [Descriptor _ _ _ _:r] lc syms = translate r lc syms
+translate [Comment _ :r] lc syms = translate r lc syms
translate [stm :r] lc syms
= [trans stm lc syms:translate r (lc+1) syms]
where