summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-06-18 21:21:13 +0000
committeraarne <aarne@cs.chalmers.se>2007-06-18 21:21:13 +0000
commitc212633be8264ce724ad2304861ee4cf0111b70b (patch)
treea8b62c7c4f42c897d841c9c08cf2c1091cda178b /src
parent6b99696e860e9d12fb3102867e622bbf828cf271 (diff)
fixed the mysterious "file..gfc" error
Diffstat (limited to 'src')
-rw-r--r--src/GF/Compile/CheckGrammar.hs11
-rw-r--r--src/GF/Compile/Compile.hs2
-rw-r--r--src/GF/Compile/Rename.hs5
3 files changed, 12 insertions, 6 deletions
diff --git a/src/GF/Compile/CheckGrammar.hs b/src/GF/Compile/CheckGrammar.hs
index 85da644c8..8c113ba97 100644
--- a/src/GF/Compile/CheckGrammar.hs
+++ b/src/GF/Compile/CheckGrammar.hs
@@ -148,7 +148,7 @@ checkCompleteGrammar abs cnc = do
AbsFun (Yes _) _ -> case lookupIdent c js of
Ok _ -> return js
_ -> do
- checkWarn $ "Warning: no linearization of" +++ prt c
+ checkWarn $ "WARNING: no linearization of" +++ prt c
return js
AbsCat (Yes _) _ -> case lookupIdent c js of
Ok (AnyInd _ _) -> return js
@@ -475,7 +475,7 @@ inferLType gr trm = case trm of
K s -> do
if elem ' ' s
- then checkWarn ("Warning: space in token \"" ++ s ++
+ then checkWarn ("WARNING: space in token \"" ++ s ++
"\". Lexical analysis may fail.")
else return ()
return (trm, typeStr)
@@ -492,6 +492,11 @@ inferLType gr trm = case trm of
Glue s1 s2 ->
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
ts' <- mapM (\t -> justCheck t typeStr) ts
return (Strs ts', typeStrs)
@@ -696,7 +701,7 @@ checkLType env trm typ0 = do
ps <- checkErr $ testOvershadow ps0 vs
if null ps
then return ()
- else checkWarn $ "Warning: patterns never reached:" +++
+ else checkWarn $ "WARNING: patterns never reached:" +++
concat (intersperse ", " (map prt ps))
_ -> return () -- happens with variable types
diff --git a/src/GF/Compile/Compile.hs b/src/GF/Compile/Compile.hs
index cf1c542f5..dd806b646 100644
--- a/src/GF/Compile/Compile.hs
+++ b/src/GF/Compile/Compile.hs
@@ -217,7 +217,7 @@ compileOne opts env@((_,srcgr,cancgr0,eenv),_) file = do
b <- ioeIO $ doesFileExist file
if not b
- then compileOne opts env $ gfcFile (init (init file))
+ then compileOne opts env $ gfcFile $ unsuffixFile file
else do
sm0 <- putpOpt ("- parsing" +++ file) ("- compiling" +++ file ++ "... ") $
diff --git a/src/GF/Compile/Rename.hs b/src/GF/Compile/Rename.hs
index 52fb44211..0a148f02f 100644
--- a/src/GF/Compile/Rename.hs
+++ b/src/GF/Compile/Rename.hs
@@ -103,8 +103,9 @@ renameIdentTerm env@(act,imps) t =
[] -> alt c ("constant not found:" +++ prt c)
fs -> case nub [f c | f <- fs] of
[tr] -> return tr
- ts@(tr:_) ->
- Bad $ "conflicting imports:" +++ unwords (map prt ts)
+ ts -> return $ Strs $ (cnIC "#conflict") : reverse 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?