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/Update.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/GF/Compile/Update.hs') diff --git a/src/GF/Compile/Update.hs b/src/GF/Compile/Update.hs index 82d7a609e..a0aefeea5 100644 --- a/src/GF/Compile/Update.hs +++ b/src/GF/Compile/Update.hs @@ -32,11 +32,9 @@ import Control.Monad -- | update a resource module by adding a new or changing an old definition updateRes :: SourceGrammar -> Ident -> Ident -> Info -> SourceGrammar updateRes gr@(MGrammar ms) m i info = MGrammar $ map upd ms where - upd (n,mod) - | n /= m = (n,mod) - | n == m = case mod of - ModMod r -> (m,ModMod $ updateModule r i info) - _ -> (n,mod) --- no error msg + upd (n,mo) + | n /= m = (n,mo) + | n == m = (n,updateModule mo i info) -- | combine a list of definitions into a balanced binary search tree buildAnyTree :: [(Ident,Info)] -> Err (BinTree Ident Info) -- cgit v1.2.3