X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=cacbce24461dd2f21a36366222770b469f7f2e8a;hb=eed77f2ab5d68abad9b6de0b8b17e959d6b021b5;hp=26c4a88fe3c5d30c10c0f145a92fbb2d1f7d4587;hpb=90b9566607ef837329434657c8fabc4bdffdf1af;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index 26c4a88..cacbce2 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -38,6 +38,7 @@ import Name import SrcLoc -- Other random utilities +import ErrUtils import Digraph import BasicTypes hiding (isTopLevel) import Panic hiding (showException) @@ -1410,8 +1411,8 @@ setCmd "" | otherwise = text " " <> text "-fno-" <> text str (ghciFlags,others) = partition (\(_,f)->f `elem` flags) DynFlags.fFlags - nonLanguageDynFlags = filter (\(_,f)->not $ f `elem` map snd xFlags) - others + nonLanguageDynFlags = filterOut (\(_,f) -> f `elem` languageOptions) + others flags = [Opt_PrintExplicitForalls ,Opt_PrintBindResult ,Opt_BreakOnException @@ -1487,7 +1488,8 @@ newDynFlags :: [String] -> GHCi () newDynFlags minus_opts = do dflags <- getDynFlags let pkg_flags = packageFlags dflags - (dflags',leftovers) <- io $ GHC.parseDynamicFlags dflags minus_opts + (dflags', leftovers, warns) <- io $ GHC.parseDynamicFlags dflags minus_opts + io $ handleFlagWarnings dflags' warns if (not (null leftovers)) then throwDyn (CmdLineError ("unrecognised flags: " ++ @@ -1635,7 +1637,8 @@ showPackages = do pkg_ids <- fmap (preloadPackages . pkgState) getDynFlags io $ putStrLn $ showSDoc $ vcat $ text "packages currently loaded:" - : map (nest 2 . text . packageIdString) (sort pkg_ids) + : map (nest 2 . text . packageIdString) + (sortBy (compare `on` packageIdFS) pkg_ids) where showFlag (ExposePackage p) = text $ " -package " ++ p showFlag (HidePackage p) = text $ " -hide-package " ++ p showFlag (IgnorePackage p) = text $ " -ignore-package " ++ p @@ -1645,7 +1648,7 @@ showLanguages = do dflags <- getDynFlags io $ putStrLn $ showSDoc $ vcat $ text "active language flags:" : - [text (" -X" ++ str) | (str,f) <- DynFlags.xFlags, dopt f dflags] + [text (" -X" ++ str) | (str, f, _) <- DynFlags.xFlags, dopt f dflags] -- ----------------------------------------------------------------------------- -- Completion