X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FInteractiveUI.hs;h=5f9f74fab62cbf02d7e715f8ba4ca2f7d873d6a2;hb=3d0ad8a75e9874e222e2e149b8914e2ed74af7b8;hp=ce6b69d87a848d631e1c2451df62b51fe300f8ff;hpb=b334ad284ffdbc251ed8cab9ba41977424400a88;p=ghc-hetmet.git diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index ce6b69d..5f9f74f 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -1092,8 +1092,10 @@ setOptions wds = do -- first, deal with the GHCi opts (+s, +t, etc.) let (plus_opts, minus_opts) = partition isPlus wds mapM_ setOpt plus_opts - -- then, dynamic flags + newDynFlags minus_opts + +newDynFlags minus_opts = do dflags <- getDynFlags let pkg_flags = packageFlags dflags (dflags',leftovers) <- io $ GHC.parseDynamicFlags dflags minus_opts @@ -1131,10 +1133,11 @@ unsetOptions str mapM_ unsetOpt plus_opts - -- can't do GHC flags for now - if (not (null minus_opts)) - then throwDyn (CmdLineError "can't unset GHC command-line flags") - else return () + let no_flag ('-':'f':rest) = return ("-fno-" ++ rest) + no_flag f = throwDyn (ProgramError ("don't know how to reverse " ++ f)) + + no_flags <- mapM no_flag minus_opts + newDynFlags no_flags isMinus ('-':s) = True isMinus _ = False @@ -1790,7 +1793,7 @@ mkTickArray ticks [ (line, (nm,span)) | (nm,span) <- ticks, line <- srcSpanLines span ] where - max_line = maximum (map GHC.srcSpanEndLine (map snd ticks)) + max_line = foldr max 0 (map GHC.srcSpanEndLine (map snd ticks)) srcSpanLines span = [ GHC.srcSpanStartLine span .. GHC.srcSpanEndLine span ]