From c544ef31823c7d2c28c28cae408cca5d71e6978d Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 21 May 2008 13:10:54 +0000 Subject: use ByteString internally in Ident, CId and Label --- src-3.0/GF/Compile/Rename.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src-3.0/GF/Compile/Rename.hs') diff --git a/src-3.0/GF/Compile/Rename.hs b/src-3.0/GF/Compile/Rename.hs index c3fef557b..68f4d754f 100644 --- a/src-3.0/GF/Compile/Rename.hs +++ b/src-3.0/GF/Compile/Rename.hs @@ -29,6 +29,7 @@ module GF.Compile.Rename (renameGrammar, import GF.Grammar.Grammar import GF.Grammar.Values +import GF.Grammar.Predef import GF.Infra.Modules import GF.Infra.Ident import GF.Grammar.Macros @@ -90,11 +91,9 @@ renameIdentTerm env@(act,imps) t = [(m, st) | (OSimple _ m, st) <- imps] -- qualif is always possible -- this facility is mainly for BWC with GF1: you need not import PredefAbs - predefAbs c s = case c of - IC "Int" -> return $ Q cPredefAbs cInt - IC "Float" -> return $ Q cPredefAbs cFloat - IC "String" -> return $ Q cPredefAbs cString - _ -> Bad s + predefAbs c s + | isPredefCat c = return $ Q cPredefAbs c + | otherwise = Bad s ident alt c = case lookupTree prt c act of Ok f -> return $ f c @@ -104,7 +103,6 @@ renameIdentTerm env@(act,imps) t = fs -> case nub [f c | f <- fs] of [tr] -> return tr ts@(t:_) -> trace ("WARNING: conflict" +++ unwords (map prt ts)) (return t) ----- 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) -- cgit v1.2.3