diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2013-09-23 09:18:27 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2013-09-23 09:18:27 +0000 |
| commit | 14061ef4df8da8cad6f1c88b40d29bd5913a5155 (patch) | |
| tree | e3033216527a53130f1a8b23418429661896d4bf /src/compiler/GF/Compile | |
| parent | 9cbd28e9cec5d6270f2a03fa4fbeefb60169e217 (diff) | |
GF.Grammar.Grammar.allExtends now returns a list of source modules instead of just the module names. This saves extra lookups later
Diffstat (limited to 'src/compiler/GF/Compile')
| -rw-r--r-- | src/compiler/GF/Compile/GrammarToPGF.hs | 3 | ||||
| -rw-r--r-- | src/compiler/GF/Compile/Rename.hs | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs index b1a2c5d33..41f6f8ff0 100644 --- a/src/compiler/GF/Compile/GrammarToPGF.hs +++ b/src/compiler/GF/Compile/GrammarToPGF.hs @@ -65,8 +65,7 @@ mkCanon2pgf opts gr am = do [(0,i2i f) | ((m,f),AbsFun (Just (L _ ty)) _ _ (Just True),_) <- adefs, snd (GM.valCat ty) == cat] mkConcr cm = do - let cflags = concatOptions [mflags mo | (i,mo) <- modules gr, isModCnc mo, - Just r <- [lookup i (allExtendSpecs gr cm)]] + let cflags = concatOptions [mflags mo | (i,mo) <- modules gr, isModCnc mo] (seqs,cdefs) <- addMissingPMCFGs Map.empty diff --git a/src/compiler/GF/Compile/Rename.hs b/src/compiler/GF/Compile/Rename.hs index 6031ab938..e81582bc9 100644 --- a/src/compiler/GF/Compile/Rename.hs +++ b/src/compiler/GF/Compile/Rename.hs @@ -125,10 +125,10 @@ tree2status o = case o of buildStatus :: SourceGrammar -> SourceModule -> Check Status buildStatus gr mo@(m,mi) = checkIn (ppLocation (msrc mi) NoLoc <> colon) $ do - let gr1 = prependModule gr mo - ops = [OSimple e | e <- allExtends gr1 m] ++ mopens mi - mods <- checkErr $ mapM (lookupModule gr1 . openedModule) ops - let sts = map modInfo2status $ zip ops mods + let gr1 = prependModule gr mo + exts = [(OSimple m,mi) | (m,mi) <- allExtends gr1 m] + ops <- checkErr $ mapM (\o -> lookupModule gr1 (openedModule o) >>= \mi -> return (o,mi)) (mopens mi) + let sts = map modInfo2status (exts++ops) return (if isModCnc mi then (emptyBinTree, reverse sts) -- the module itself does not define any names else (self2status m mi,reverse sts)) -- so the empty ident is not needed |
