forked from GitHub/gf-core
incompleteness warning and PNeg in CheckGrammar
This commit is contained in:
@@ -316,5 +316,21 @@ oper
|
|||||||
in
|
in
|
||||||
mkV singen singt sing sang saenge gesungen ;
|
mkV singen singt sing sang saenge gesungen ;
|
||||||
|
|
||||||
|
V0 : Type = V ;
|
||||||
|
V2S, V2V, V2Q, V2A : Type = V2 ;
|
||||||
|
AS, A2S, AV : Type = A ;
|
||||||
|
A2V : Type = A2 ;
|
||||||
|
|
||||||
|
mkV0 v = v ** {lock_V = <>} ;
|
||||||
|
mkV2S v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||||
|
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2 = <>} ;
|
||||||
|
mkVA v = v ** {lock_VA = <>} ;
|
||||||
|
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||||
|
mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||||
|
|
||||||
|
mkAS v = v ** {lock_A = <>} ;
|
||||||
|
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||||
|
mkAV v = v ** {lock_A = <>} ;
|
||||||
|
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -178,6 +178,9 @@ checkResInfo gr (c,info) = do
|
|||||||
(_, Yes de) -> do
|
(_, Yes de) -> do
|
||||||
(de',ty') <- infer de
|
(de',ty') <- infer de
|
||||||
return (Yes ty', Yes de')
|
return (Yes ty', Yes de')
|
||||||
|
(_,Nope) -> do
|
||||||
|
checkWarn "No definition given to oper"
|
||||||
|
return (pty,pde)
|
||||||
_ -> return (pty, pde) --- other cases are uninteresting
|
_ -> return (pty, pde) --- other cases are uninteresting
|
||||||
return (c, ResOper pty' pde')
|
return (c, ResOper pty' pde')
|
||||||
|
|
||||||
@@ -673,7 +676,7 @@ checkLType env trm typ0 = do
|
|||||||
|
|
||||||
pattContext :: LTEnv -> Type -> Patt -> Check Context
|
pattContext :: LTEnv -> Type -> Patt -> Check Context
|
||||||
pattContext env typ p = case p of
|
pattContext env typ p = case p of
|
||||||
PV x -> return [(x,typ)]
|
PV x | not (isWildIdent x) -> return [(x,typ)]
|
||||||
PP q c ps | q /= cPredef -> do ---- why this /=? AR 6/1/2006
|
PP q c ps | q /= cPredef -> do ---- why this /=? AR 6/1/2006
|
||||||
t <- checkErr $ lookupResType cnc q c
|
t <- checkErr $ lookupResType cnc q c
|
||||||
(cont,v) <- checkErr $ typeFormCnc t
|
(cont,v) <- checkErr $ typeFormCnc t
|
||||||
@@ -710,17 +713,18 @@ pattContext env typ p = case p of
|
|||||||
g1 <- pattContext env typ p
|
g1 <- pattContext env typ p
|
||||||
g2 <- pattContext env typ q
|
g2 <- pattContext env typ q
|
||||||
return $ g1 ++ g2
|
return $ g1 ++ g2
|
||||||
PRep p' -> do
|
PRep p' -> noBind p'
|
||||||
co <- pattContext env typeStr p'
|
PNeg p' -> noBind p'
|
||||||
if not (null co)
|
|
||||||
then checkWarn ("no variable bound inside * pattern" +++ prt p)
|
|
||||||
>> return []
|
|
||||||
else return []
|
|
||||||
PNeg p' -> pattContext env typ p'
|
|
||||||
|
|
||||||
_ -> return [] ---- check types!
|
_ -> return [] ---- check types!
|
||||||
where
|
where
|
||||||
cnc = env
|
cnc = env
|
||||||
|
noBind p' = do
|
||||||
|
co <- pattContext env typeStr p'
|
||||||
|
if not (null co)
|
||||||
|
then checkWarn ("no variable bound inside pattern" +++ prt p)
|
||||||
|
>> return []
|
||||||
|
else return []
|
||||||
|
|
||||||
-- auxiliaries
|
-- auxiliaries
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user