update
[cc1516.git] / gen.icl
diff --git a/gen.icl b/gen.icl
index 269ef14..819da19 100644 (file)
--- a/gen.icl
+++ b/gen.icl
@@ -45,10 +45,10 @@ FALSE :== 0
 labelStream :: [Label]
 labelStream = ["lbl_" +++ toString i\\i<-[1..]]
 
-gen :: AST -> String
+gen :: AST -> Either String String
 gen (AST fds) = case evalRWST prog "" ('Map'.newMap, labelStream) of
-            Left (Error e) = e
-            Right (_, p) = toString p
+            Left (Error e) = Left e
+            Right (_, p) = Right $ toString p
     where
         prog = tell [Instr "bra" [L "main"] ""] >>| mapM_ g fds
 //gen _ = prog