summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-11-29 14:43:01 +0000
committerhallgren <hallgren@chalmers.se>2013-11-29 14:43:01 +0000
commit0a59f95d92223bae842323d582ec5d2eb3156a8d (patch)
tree9cb305da42da037dbbdbd467a2e39cbb790e63cc /src/compiler/GF/Grammar
parent1067d5960964995e92209354aecb4c4ed82e9b86 (diff)
Move checkPredefError from GF.Compile.Compute.ConcreteLazy to GF.Grammar.Macros
Also simplified its type.
Diffstat (limited to 'src/compiler/GF/Grammar')
-rw-r--r--src/compiler/GF/Grammar/Macros.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/GF/Grammar/Macros.hs b/src/compiler/GF/Grammar/Macros.hs
index 6798b22d0..e516f0e47 100644
--- a/src/compiler/GF/Grammar/Macros.hs
+++ b/src/compiler/GF/Grammar/Macros.hs
@@ -225,6 +225,12 @@ isPredefConstant t = case t of
Q (mod,_) | mod == cPredef || mod == cPredefAbs -> True
_ -> False
+checkPredefError :: Monad m => Term -> m Term
+checkPredefError t =
+ case t of
+ Error s -> fail ("Error: "++s)
+ _ -> return t
+
cnPredef :: Ident -> Term
cnPredef f = Q (cPredef,f)