putting pattern macros in place (not properly tested yet)

This commit is contained in:
aarne
2008-03-15 21:02:59 +00:00
parent 1196bbe21f
commit 2a314b679d
13 changed files with 133 additions and 48 deletions
+9
View File
@@ -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