From 096c861fb4cb7feba5db4752da029c639527b3b3 Mon Sep 17 00:00:00 2001 From: aarne Date: Thu, 12 Aug 2004 09:02:00 +0000 Subject: fixes for Janna --- src/GF/Compile/ShellState.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/GF/Compile/ShellState.hs') diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs index 18b237745..e1e64e85c 100644 --- a/src/GF/Compile/ShellState.hs +++ b/src/GF/Compile/ShellState.hs @@ -122,7 +122,8 @@ updateShellState opts sh ((_,sgr,gr),rts) = do a' = ifNull Nothing (return . head) $ allAbstracts cgr0 abstr0 <- case abstract sh of Just a -> do - --- test that abstract is compatible + -- test that abstract is compatible + testErr (maybe True (a==) a') ("expected abstract" +++ P.prt a) return $ Just a _ -> return a' let cgr = filterAbstracts abstr0 cgr0 @@ -173,7 +174,7 @@ abstractName sh = maybe "(none)" P.prt (abstract sh) -- throw away those abstracts that are not needed --- could be more aggressive filterAbstracts :: Maybe Ident -> CanonGrammar -> CanonGrammar -filterAbstracts abstr cgr = M.MGrammar [m | m <- ms, needed m] where +filterAbstracts abstr cgr = M.MGrammar (nubBy (\x y -> fst x == fst y) [m | m <- ms, needed m]) where ms = M.modules cgr needed (i,_) = case abstr of Just a -> elem i $ needs a -- cgit v1.2.3