diff options
| author | krasimir <krasimir@chalmers.se> | 2009-01-19 13:23:03 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-01-19 13:23:03 +0000 |
| commit | d95ca4a103c9023aa104b25acdc9c21418de6a14 (patch) | |
| tree | 7cff6e45e2dc1ba08deb503589e21770c7f239b3 /src/GF/Compile/RemoveLiT.hs | |
| parent | fa7ab84471652c40079e4f77d242208376c4b668 (diff) | |
refactor the GF.Grammar.Grammar syntax. The obsolete constructions are removed
Diffstat (limited to 'src/GF/Compile/RemoveLiT.hs')
| -rw-r--r-- | src/GF/Compile/RemoveLiT.hs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/GF/Compile/RemoveLiT.hs b/src/GF/Compile/RemoveLiT.hs index a641737eb..14a9a1da1 100644 --- a/src/GF/Compile/RemoveLiT.hs +++ b/src/GF/Compile/RemoveLiT.hs @@ -32,13 +32,10 @@ import Control.Monad removeLiT :: SourceGrammar -> Err SourceGrammar removeLiT gr = liftM MGrammar $ mapM (remlModule gr) (modules gr) -remlModule :: SourceGrammar -> (Ident,SourceModInfo) -> Err (Ident,SourceModInfo) -remlModule gr mi@(name,mod) = case mod of - ModMod mo -> do - js1 <- mapMTree (remlResInfo gr) (jments mo) - let mod2 = ModMod $ mo {jments = js1} - return $ (name,mod2) - _ -> return mi +remlModule :: SourceGrammar -> SourceModule -> Err SourceModule +remlModule gr mi@(name,mo) = do + js1 <- mapMTree (remlResInfo gr) (jments mo) + return (name,mo{jments = js1}) remlResInfo :: SourceGrammar -> (Ident,Info) -> Err Info remlResInfo gr (i,info) = case info of @@ -59,6 +56,6 @@ remlTerm gr trm = case trm of _ -> composOp (remlTerm gr) trm where look c = err (const $ return defLinType) return $ lookupLincat gr m c - m = case [cnc | (cnc,ModMod m) <- modules gr, isModCnc m] of + m = case [cnc | (cnc,m) <- modules gr, isModCnc m] of cnc:_ -> cnc -- actually there is always exactly one - _ -> cCNC + _ -> cCNC |
