From d95ca4a103c9023aa104b25acdc9c21418de6a14 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 19 Jan 2009 13:23:03 +0000 Subject: refactor the GF.Grammar.Grammar syntax. The obsolete constructions are removed --- src/GF/Compile/RemoveLiT.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/GF/Compile/RemoveLiT.hs') 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 -- cgit v1.2.3