diff options
-rw-r--r-- | ABC/Assembler.dcl | 2 | ||||
-rw-r--r-- | ABC/Assembler.icl | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/ABC/Assembler.dcl b/ABC/Assembler.dcl index 63880e7..618a885 100644 --- a/ABC/Assembler.dcl +++ b/ABC/Assembler.dcl @@ -15,6 +15,7 @@ from ABC.Machine.GraphStore import ::Desc :: Annotation = DAnnot Int [BasicType] | OAnnot Int [BasicType] + | RawAnnot [String] :: BasicType = BT_Bool @@ -84,6 +85,7 @@ from ABC.Machine.GraphStore import ::Desc | LtI | MulI | SubI + // Clean compiler additions | Comment String | Annotation Annotation diff --git a/ABC/Assembler.icl b/ABC/Assembler.icl index 087945d..2e80a05 100644 --- a/ABC/Assembler.icl +++ b/ABC/Assembler.icl @@ -32,6 +32,11 @@ where printAnnot :: Annotation -> String printAnnot (DAnnot a bs) = ".d " <+ a <+ " " <+ length bs <+ " " <+ types bs printAnnot (OAnnot a bs) = ".o " <+ a <+ " " <+ length bs <+ " " <+ types bs + printAnnot (RawAnnot s) = foldl (+++) "." (intersperse " " s) + where + intersperse g [] = [] + intersperse g [x] = [x] + intersperse g [x:xs] = [x:g:intersperse g xs] types :: ([BasicType] -> [Char]) types = map toC |