From 15423b23737673f098d89550ace39ec664e56ac4 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 29 Jan 2009 15:32:32 +0100 Subject: [PATCH] Let expandExpr error out on unsupported expressions. --- Translator.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Translator.hs b/Translator.hs index be2fb0a..9265bfa 100644 --- a/Translator.hs +++ b/Translator.hs @@ -41,7 +41,7 @@ main = --core <- GHC.compileToCoreSimplified "Adders.hs" core <- GHC.compileToCoreSimplified "Adders.hs" liftIO $ printBinds (cm_binds core) - let bind = findBind "wire" (cm_binds core) + let bind = findBind "inv" (cm_binds core) let NonRec var expr = bind -- Turn bind into VHDL let vhdl = State.evalState (mkVHDL bind) (VHDLSession 0 builtin_funcs) @@ -217,7 +217,10 @@ expandExpr binds (Var id) = Signal (AST.NSimple signal_id) = Maybe.fromMaybe (error $ "Argument " ++ getOccString id ++ "is unknown") (lookup id binds) - + +expandExpr binds expr = + error $ "Unsupported expression: " ++ (showSDoc $ ppr $ expr) + -- Generate a signal declaration for a signal with the given name and the -- given type and no value. Also returns the id of the signal. mkSignal :: String -> AST.TypeMark -> (AST.VHDLId, AST.SigDec) -- 2.30.2