From fa8b99969d7a6966c1cd309d41384051599070fb Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 3 Jul 2016 19:57:27 +0200 Subject: Fix RTS; working example --- ABC/Assembler.icl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ABC/Assembler.icl') diff --git a/ABC/Assembler.icl b/ABC/Assembler.icl index 9de0708..e5e3a9a 100644 --- a/ABC/Assembler.icl +++ b/ABC/Assembler.icl @@ -29,12 +29,12 @@ where collect :: Assembler Int Int -> SymTable collect [] _ _ = [] -collect [Label l :r] lc dc = [(l,lc,LabSym) :collect r lc dc] -collect [Descriptor dl rl _ _:r] lc dc = [(dl,dc,DescSym):collect r lc (dc+1)] -collect [_ :r] lc dc = collect r (lc+1) dc +collect [Label l :r] lc dc = [(l,lc,LabSym) :collect r lc dc] +collect [Descriptor dl _ _ _:r] lc dc = [(dl,dc,DescSym):collect r lc (dc+1)] +collect [_ :r] lc dc = collect r (lc+1) dc lookup :: Label SymType SymTable -> Int -lookup l t [] = abortn ("label " <+ l <+ " not defined as " <+ t) +lookup l t [] = abortn (l <+ " not defined as " <+ t) lookup l t [(name,n,type):r] | l == name && t == type = n | otherwise = lookup l t r -- cgit v1.2.3