diff options
| author | aarne <unknown> | 2005-09-20 08:32:55 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2005-09-20 08:32:55 +0000 |
| commit | 6d179267de8f988ab2ee52a5fef99b3b05576222 (patch) | |
| tree | a543ed396c364bd63987517b8ead00fb9d193213 /src/GF/Canon/Subexpressions.hs | |
| parent | 263beccd56f5a6242ea97e696a9843cd0f597e16 (diff) | |
CSEE now works fine
Diffstat (limited to 'src/GF/Canon/Subexpressions.hs')
| -rw-r--r-- | src/GF/Canon/Subexpressions.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/GF/Canon/Subexpressions.hs b/src/GF/Canon/Subexpressions.hs index b1891d065..4ec645b05 100644 --- a/src/GF/Canon/Subexpressions.hs +++ b/src/GF/Canon/Subexpressions.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/09/19 13:01:18 $ +-- > CVS $Date: 2005/09/20 09:32:56 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.3 $ +-- > CVS $Revision: 1.4 $ -- -- Common subexpression elimination. -- all tables. AR 18\/9\/2005. @@ -80,11 +80,14 @@ unSubelimCanon gr@(M.MGrammar modules) = unSubelimModule :: CanonModule -> CanonModule unSubelimModule mo@(i,m) = case m of - M.ModMod (M.Module mt@(M.MTConcrete _) st fs me ops js) -> + M.ModMod (M.Module mt@(M.MTConcrete _) st fs me ops js) | hasSub ljs -> (i, M.ModMod (M.Module mt st fs me ops - (rebuild (map unparInfo (tree2list js))))) + (rebuild (map unparInfo ljs)))) + where ljs = tree2list js _ -> (i,m) where + -- perform this iff the module has opers + hasSub ljs = not $ null [c | (c,ResOper _ _) <- ljs] unparInfo (c,info) = case info of CncFun k xs t m -> [(c, CncFun k xs (unparTerm t) m)] ResOper _ _ -> [] |
