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.
This commit is contained in:
hallgren
2011-08-30 18:54:50 +00:00
parent 2001788b02
commit ba10b5b0ca
12 changed files with 52 additions and 37 deletions

View File

@@ -61,7 +61,7 @@ unsubexpModule sm@(i,mo)
Q (m,c) | isOperIdent c -> --- name convention of subexp opers
errVal t $ liftM unparTerm $ lookupResDef gr (m,c)
_ -> C.composSafeOp unparTerm t
gr = M.MGrammar [sm]
gr = M.mGrammar [sm]
rebuild = buildTree . concat
-- implementation