From: Simon Huber Date: Fri, 20 Mar 2015 13:54:48 +0000 (+0100) Subject: dont crash the resolver if expression could not be resolved X-Git-Url: https://git.ak3n.com/?a=commitdiff_plain;h=81c6f395b33824110edbf7f547705551a3446e0f;p=cubicaltt.git dont crash the resolver if expression could not be resolved --- diff --git a/Resolver.hs b/Resolver.hs index 5b5aa5d..42d13e4 100644 --- a/Resolver.hs +++ b/Resolver.hs @@ -199,6 +199,9 @@ resolveExp e = case e of CTT.mkWheres rdecls <$> local (insertIdents names) (resolveExp e) Path is e -> paths is (resolveExp e) AppFormula e phi -> CTT.AppFormula <$> resolveExp e <*> resolveFormula phi + _ -> do + modName <- asks envModule + throwError ("Could not resolve " ++ show e ++ " in module " ++ modName) resolveWhere :: ExpWhere -> Resolver Ter resolveWhere = resolveExp . unWhere @@ -216,7 +219,7 @@ resolveFace alpha = | Face i d <- alpha ] resolveDir :: Dir -> Resolver C.Dir -resolveDir Dir0 = return 0 +resolveDir Dir0 = return 0 resolveDir Dir1 = return 1 resolveFormula :: Formula -> Resolver C.Formula