Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/6f2f83800dd89af67cbf6de4d9b2afda4af0938f

>---------------------------------------------------------------

commit 6f2f83800dd89af67cbf6de4d9b2afda4af0938f
Author: Ian Lynagh <[email protected]>
Date:   Tue Jun 12 01:14:29 2012 +0100

    Build fixes

>---------------------------------------------------------------

 ghc/GhciMonad.hs     |    6 ++++--
 ghc/GhciTags.hs      |   12 +++++++-----
 ghc/InteractiveUI.hs |    5 +++--
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs
index 3dc69ee..c6eb619 100644
--- a/ghc/GhciMonad.hs
+++ b/ghc/GhciMonad.hs
@@ -252,12 +252,14 @@ unsetOption opt
 printForUser :: GhcMonad m => SDoc -> m ()
 printForUser doc = do
   unqual <- GHC.getPrintUnqual
-  MonadUtils.liftIO $ Outputable.printForUser stdout unqual doc
+  dflags <- getDynFlags
+  MonadUtils.liftIO $ Outputable.printForUser dflags stdout unqual doc
 
 printForUserPartWay :: SDoc -> GHCi ()
 printForUserPartWay doc = do
   unqual <- GHC.getPrintUnqual
-  liftIO $ Outputable.printForUserPartWay stdout opt_PprUserLength unqual doc
+  dflags <- getDynFlags
+  liftIO $ Outputable.printForUserPartWay dflags stdout opt_PprUserLength 
unqual doc
 
 -- | Run a single Haskell expression
 runStmt :: String -> GHC.SingleStep -> GHCi (Maybe GHC.RunResult)
diff --git a/ghc/GhciTags.hs b/ghc/GhciTags.hs
index d37b93f..e838269 100644
--- a/ghc/GhciTags.hs
+++ b/ghc/GhciTags.hs
@@ -86,12 +86,13 @@ listModuleTags m = do
   case mbModInfo of
     Nothing -> return []
     Just mInfo -> do
+       dflags <- getDynFlags
        mb_print_unqual <- GHC.mkPrintUnqualifiedForModule mInfo
        let unqual = fromMaybe GHC.alwaysQualify mb_print_unqual
        let names = fromMaybe [] $GHC.modInfoTopLevelScope mInfo
        let localNames = filter ((m==) . nameModule) names
        mbTyThings <- mapM GHC.lookupName localNames
-       return $! [ tagInfo unqual exported kind name realLoc
+       return $! [ tagInfo dflags unqual exported kind name realLoc
                      | tyThing <- catMaybes mbTyThings
                      , let name = getName tyThing
                      , let exported = GHC.modInfoIsExportedName mInfo name
@@ -119,11 +120,12 @@ data TagInfo = TagInfo
 
 
 -- get tag info, for later translation into Vim or Emacs style
-tagInfo :: PrintUnqualified -> Bool -> Char -> Name -> RealSrcLoc -> TagInfo
-tagInfo unqual exported kind name loc
+tagInfo :: DynFlags -> PrintUnqualified -> Bool -> Char -> Name -> RealSrcLoc
+        -> TagInfo
+tagInfo dflags unqual exported kind name loc
     = TagInfo exported kind
-        (showSDocForUser unqual $ pprOccName (nameOccName name))
-        (showSDocForUser unqual $ ftext (srcLocFile loc))
+        (showSDocForUser dflags unqual $ pprOccName (nameOccName name))
+        (showSDocForUser dflags unqual $ ftext (srcLocFile loc))
         (srcLocLine loc) (srcLocCol loc) Nothing
 
 
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index 7e83565..4e83252 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -961,8 +961,9 @@ info :: String -> InputT GHCi ()
 info "" = ghcError (CmdLineError "syntax: ':i <thing-you-want-info-about>'")
 info s  = handleSourceError GHC.printException $ do
     unqual <- GHC.getPrintUnqual
+    dflags <- getDynFlags
     sdocs  <- mapM infoThing (words s)
-    mapM_ (liftIO . putStrLn . showSDocForUser unqual) sdocs
+    mapM_ (liftIO . putStrLn . showSDocForUser dflags unqual) sdocs
 
 infoThing :: GHC.GhcMonad m => String -> m SDoc
 infoThing str = do
@@ -1589,7 +1590,7 @@ browseModule bang modl exports_only = do
             prettyThings = map (pretty pefas) things
             prettyThings' | bang      = annotate $ zip modNames prettyThings
                           | otherwise = prettyThings
-        liftIO $ putStrLn $ showSDocForUser unqual (vcat prettyThings')
+        liftIO $ putStrLn $ showSDocForUser dflags unqual (vcat prettyThings')
         -- ToDo: modInfoInstances currently throws an exception for
         -- package modules.  When it works, we can do this:
         --        $$ vcat (map GHC.pprInstance (GHC.modInfoInstances mod_info))



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to