From 6cbb8086c8bcaca638b993a75017b7738cd923c9 Mon Sep 17 00:00:00 2001 From: aarne Date: Sat, 15 Mar 2008 21:02:59 +0000 Subject: putting pattern macros in place (not properly tested yet) --- src/GF/Devel/CheckGrammar.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/GF/Devel/CheckGrammar.hs') diff --git a/src/GF/Devel/CheckGrammar.hs b/src/GF/Devel/CheckGrammar.hs index f0ec8318c..0910802d1 100644 --- a/src/GF/Devel/CheckGrammar.hs +++ b/src/GF/Devel/CheckGrammar.hs @@ -580,6 +580,13 @@ inferLType gr trm = case trm of --- checkIfComplexVariantType trm ty check trm ty + EPattType ty -> do + ty' <- justCheck ty typeType + return (ty',typeType) + EPatt p -> do + ty <- inferPatt p + return (trm, EPattType ty) + _ -> prtFail "cannot infer lintype of" trm where @@ -616,6 +623,7 @@ inferLType gr trm = case trm of PInt _ -> True PFloat _ -> True PChar -> True + PChars _ -> True PSeq p q -> isConstPatt p && isConstPatt q PAlt p q -> isConstPatt p && isConstPatt q PRep p -> isConstPatt p @@ -631,6 +639,7 @@ inferLType gr trm = case trm of PSeq _ _ -> return $ typeStr PRep _ -> return $ typeStr PChar -> return $ typeStr + PChars _ -> return $ typeStr _ -> infer (patt2term p) >>= return . snd -- cgit v1.2.3