From 0a59f95d92223bae842323d582ec5d2eb3156a8d Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 29 Nov 2013 14:43:01 +0000 Subject: Move checkPredefError from GF.Compile.Compute.ConcreteLazy to GF.Grammar.Macros Also simplified its type. --- src/compiler/GF/Grammar/Macros.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/compiler/GF/Grammar') 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) -- cgit v1.2.3