forked from GitHub/gf-core
fixed the mysterious "file..gfc" error
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -148,7 +148,7 @@ checkCompleteGrammar abs cnc = do
|
|||||||
AbsFun (Yes _) _ -> case lookupIdent c js of
|
AbsFun (Yes _) _ -> case lookupIdent c js of
|
||||||
Ok _ -> return js
|
Ok _ -> return js
|
||||||
_ -> do
|
_ -> do
|
||||||
checkWarn $ "Warning: no linearization of" +++ prt c
|
checkWarn $ "WARNING: no linearization of" +++ prt c
|
||||||
return js
|
return js
|
||||||
AbsCat (Yes _) _ -> case lookupIdent c js of
|
AbsCat (Yes _) _ -> case lookupIdent c js of
|
||||||
Ok (AnyInd _ _) -> return js
|
Ok (AnyInd _ _) -> return js
|
||||||
@@ -475,7 +475,7 @@ inferLType gr trm = case trm of
|
|||||||
|
|
||||||
K s -> do
|
K s -> do
|
||||||
if elem ' ' s
|
if elem ' ' s
|
||||||
then checkWarn ("Warning: space in token \"" ++ s ++
|
then checkWarn ("WARNING: space in token \"" ++ s ++
|
||||||
"\". Lexical analysis may fail.")
|
"\". Lexical analysis may fail.")
|
||||||
else return ()
|
else return ()
|
||||||
return (trm, typeStr)
|
return (trm, typeStr)
|
||||||
@@ -492,6 +492,11 @@ inferLType gr trm = case trm of
|
|||||||
Glue s1 s2 ->
|
Glue s1 s2 ->
|
||||||
check2 (flip justCheck typeStr) Glue s1 s2 typeStr ---- typeTok
|
check2 (flip justCheck typeStr) Glue s1 s2 typeStr ---- typeTok
|
||||||
|
|
||||||
|
---- hack from Rename.identRenameTerm, to live with files with naming conflicts 18/6/2007
|
||||||
|
Strs (Cn (IC "#conflict") : ts) -> do
|
||||||
|
checkWarn ("WARNING: unresolved constant, could be any of" +++ unwords (map prt ts))
|
||||||
|
infer $ head ts
|
||||||
|
|
||||||
Strs ts -> do
|
Strs ts -> do
|
||||||
ts' <- mapM (\t -> justCheck t typeStr) ts
|
ts' <- mapM (\t -> justCheck t typeStr) ts
|
||||||
return (Strs ts', typeStrs)
|
return (Strs ts', typeStrs)
|
||||||
@@ -696,7 +701,7 @@ checkLType env trm typ0 = do
|
|||||||
ps <- checkErr $ testOvershadow ps0 vs
|
ps <- checkErr $ testOvershadow ps0 vs
|
||||||
if null ps
|
if null ps
|
||||||
then return ()
|
then return ()
|
||||||
else checkWarn $ "Warning: patterns never reached:" +++
|
else checkWarn $ "WARNING: patterns never reached:" +++
|
||||||
concat (intersperse ", " (map prt ps))
|
concat (intersperse ", " (map prt ps))
|
||||||
|
|
||||||
_ -> return () -- happens with variable types
|
_ -> return () -- happens with variable types
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ compileOne opts env@((_,srcgr,cancgr0,eenv),_) file = do
|
|||||||
|
|
||||||
b <- ioeIO $ doesFileExist file
|
b <- ioeIO $ doesFileExist file
|
||||||
if not b
|
if not b
|
||||||
then compileOne opts env $ gfcFile (init (init file))
|
then compileOne opts env $ gfcFile $ unsuffixFile file
|
||||||
else do
|
else do
|
||||||
|
|
||||||
sm0 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
|
sm0 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
|
||||||
|
|||||||
@@ -103,8 +103,9 @@ renameIdentTerm env@(act,imps) t =
|
|||||||
[] -> alt c ("constant not found:" +++ prt c)
|
[] -> alt c ("constant not found:" +++ prt c)
|
||||||
fs -> case nub [f c | f <- fs] of
|
fs -> case nub [f c | f <- fs] of
|
||||||
[tr] -> return tr
|
[tr] -> return tr
|
||||||
ts@(tr:_) ->
|
ts -> return $ Strs $ (cnIC "#conflict") : reverse ts
|
||||||
Bad $ "conflicting imports:" +++ unwords (map prt ts)
|
-- a warning will be generated in CheckGrammar, and the head returned
|
||||||
|
-- in next V: Bad $ "conflicting imports:" +++ unwords (map prt ts)
|
||||||
|
|
||||||
|
|
||||||
--- | would it make sense to optimize this by inlining?
|
--- | would it make sense to optimize this by inlining?
|
||||||
|
|||||||
Reference in New Issue
Block a user