summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2006-01-16 09:47:08 +0000
committeraarne <aarne@cs.chalmers.se>2006-01-16 09:47:08 +0000
commit74c5d41152a0315e038e3d37ac992a26f975b729 (patch)
tree054569ba3fb777feb9997f59266756a72563ede6 /src/GF/Compile
parent90c7caa788cff71121bebf54cf21f23318cb46c7 (diff)
incompleteness warning and PNeg in CheckGrammar
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/CheckGrammar.hs20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index 1daf4fd62..931a84a58 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -178,6 +178,9 @@ checkResInfo gr (c,info) = do
(_, Yes de) -> do
(de',ty') <- infer 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 (c, ResOper pty' pde')
@@ -673,7 +676,7 @@ checkLType env trm typ0 = do
pattContext :: LTEnv -> Type -> Patt -> Check Context
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
t <- checkErr $ lookupResType cnc q c
(cont,v) <- checkErr $ typeFormCnc t
@@ -710,17 +713,18 @@ pattContext env typ p = case p of
g1 <- pattContext env typ p
g2 <- pattContext env typ q
return $ g1 ++ g2
- PRep p' -> do
- co <- pattContext env typeStr p'
- if not (null co)
- then checkWarn ("no variable bound inside * pattern" +++ prt p)
- >> return []
- else return []
- PNeg p' -> pattContext env typ p'
+ PRep p' -> noBind p'
+ PNeg p' -> noBind p'
_ -> return [] ---- check types!
where
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