1
0
forked from GitHub/gf-core

Improved interface and instance compilation.

Improved interface and instance compilation.
Restored an optimization of the optimizer: up to 4x faster now.
This commit is contained in:
aarne
2003-11-13 16:02:25 +00:00
parent 25c8690586
commit c5146d0614
6 changed files with 20 additions and 8 deletions

View File

@@ -172,6 +172,10 @@ computeTerm gr = comp where
_ -> return $ ExtR r' s'
-- case-expand tables
T i@(TComp _) cs -> do
cs' <- mapPairsM (comp g) cs
return $ T i cs'
T i cs -> do
pty0 <- getTableType i
ptyp <- comp g pty0

View File

@@ -86,7 +86,7 @@ refreshGrammar = liftM (MGrammar . snd) . foldM refreshModule (0,[]) . modules
refreshModule :: (Int,[SourceModule]) -> SourceModule -> Err (Int,[SourceModule])
refreshModule (k,ms) mi@(i,m) = case m of
ModMod mo@(Module mt fs st me ops js) | (isModCnc mo || mt == MTResource) -> do
ModMod mo@(Module mt fs st me ops js) | (isModCnc mo || isModRes mo) -> do
(k',js') <- foldM refreshRes (k,[]) $ tree2list js
return (k', (i, ModMod(Module mt fs st me ops (buildTree js'))) : ms)
_ -> return (k, mi:ms)