summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile/Rename.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2011-08-30 18:54:50 +0000
committerhallgren <hallgren@chalmers.se>2011-08-30 18:54:50 +0000
commitba10b5b0ca0c906b1b5c94f64b37b5a34f200f71 (patch)
tree360302c1d8eb917dd650a9df405b3cca504459ab /src/compiler/GF/Compile/Rename.hs
parent2001788b0242a0c945655c503262ccf104bcc3bd (diff)
GF.Infra.Modules: keep the modules of a grammar in a finite map instead of a list
This speeds up the compilation of PhrasebookFin.pgf by 12%, mosly by speeding up calls to lookupModule in calls from lookupParamValues, in calls from allParamValues. The invariant "modules are stored in dependency order" is no longer respected! But the type MGrammar is now abstract, making it easier to maintain this or other invariants in the future.
Diffstat (limited to 'src/compiler/GF/Compile/Rename.hs')
-rw-r--r--src/compiler/GF/Compile/Rename.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/Rename.hs b/src/compiler/GF/Compile/Rename.hs
index c8bf8cdd9..f1c7e2022 100644
--- a/src/compiler/GF/Compile/Rename.hs
+++ b/src/compiler/GF/Compile/Rename.hs
@@ -62,7 +62,7 @@ renameSourceJudgement g m (i,t) = do
renameModule :: [SourceModule] -> SourceModule -> Check SourceModule
renameModule ms (name,mo) = checkIn (text "renaming module" <+> ppIdent name) $ do
let js1 = jments mo
- status <- buildStatus (MGrammar ms) name mo
+ status <- buildStatus (mGrammar ms) name mo
js2 <- checkMap (renameInfo status name) js1
return (name, mo {opens = map forceQualif (opens mo), jments = js2})
@@ -128,7 +128,7 @@ tree2status o = case o of
buildStatus :: SourceGrammar -> Ident -> SourceModInfo -> Check Status
buildStatus gr c mo = let mo' = self2status c mo in do
- let gr1 = MGrammar ((c,mo) : modules gr)
+ let gr1 = mGrammar ((c,mo) : modules gr)
ops = [OSimple e | e <- allExtends gr1 c] ++ opens mo
mods <- checkErr $ mapM (lookupModule gr1 . openedModule) ops
let sts = map modInfo2status $ zip ops mods