summaryrefslogtreecommitdiff
path: root/src/GF/Devel/CheckGrammar.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-03-15 21:02:59 +0000
committeraarne <aarne@cs.chalmers.se>2008-03-15 21:02:59 +0000
commit6cbb8086c8bcaca638b993a75017b7738cd923c9 (patch)
tree5f8584f310d1a40f3ac85cfe17c7bc0eae656e38 /src/GF/Devel/CheckGrammar.hs
parente60237136b0a8285874fd57d38ec3518aa94b162 (diff)
putting pattern macros in place (not properly tested yet)
Diffstat (limited to 'src/GF/Devel/CheckGrammar.hs')
-rw-r--r--src/GF/Devel/CheckGrammar.hs9
1 files changed, 9 insertions, 0 deletions
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