X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=18c5f89e221d331ba30c566e34747a70e980f8cb;hb=331923fd7adec11980e776dd33442c654cca0280;hp=6aef4721262a7c5339e944023c2319c64ecba1a4;hpb=ccc9a4a5c7131e5bece84c0983d7d3f8d6480967;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 6aef472..18c5f89 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -83,7 +83,7 @@ import Control.Monad ( when ) import Data.Char import System.FilePath -import System.IO ( hPutStrLn, stderr ) +import System.IO ( stderr, hPutChar ) -- ----------------------------------------------------------------------------- -- DynFlags @@ -222,6 +222,7 @@ data DynFlag | Opt_TransformListComp | Opt_GeneralizedNewtypeDeriving | Opt_RecursiveDo + | Opt_PostfixOperators | Opt_PatternGuards | Opt_LiberalTypeSynonyms | Opt_Rank2Types @@ -594,9 +595,14 @@ defaultDynFlags = log_action = \severity srcSpan style msg -> case severity of - SevInfo -> hPutStrLn stderr (show (msg style)) - SevFatal -> hPutStrLn stderr (show (msg style)) - _ -> hPutStrLn stderr ('\n':show ((mkLocMessage srcSpan msg) style)) + SevInfo -> printErrs (msg style) + SevFatal -> printErrs (msg style) + _ -> do + hPutChar stderr '\n' + printErrs ((mkLocMessage srcSpan msg) style) + -- careful (#2302): printErrs prints in UTF-8, whereas + -- converting to string first and using hPutStr would + -- just emit the low 8 bits of each unicode char. } {- @@ -1483,6 +1489,7 @@ languageOptions = [ dynFlag | (_, dynFlag, _) <- xFlags ] xFlags :: [(String, DynFlag, Bool -> Deprecated)] xFlags = [ ( "CPP", Opt_Cpp, const Supported ), + ( "PostfixOperators", Opt_PostfixOperators, const Supported ), ( "PatternGuards", Opt_PatternGuards, const Supported ), ( "UnicodeSyntax", Opt_UnicodeSyntax, const Supported ), ( "MagicHash", Opt_MagicHash, const Supported ), @@ -1570,6 +1577,7 @@ glasgowExtsFlags = [ , Opt_PolymorphicComponents , Opt_ExistentialQuantification , Opt_UnicodeSyntax + , Opt_PostfixOperators , Opt_PatternGuards , Opt_LiberalTypeSynonyms , Opt_RankNTypes