Avoid 3 space indents

This commit is contained in:
Neil Mitchell 2019-09-11 22:45:03 +01:00
parent a4fafc2d60
commit 20c829038c

View File

@ -33,21 +33,21 @@ import Data.Maybe
-- e.g. unlit/cpp. Return the resulting buffer and the DynFlags it implies.
preprocessor :: GhcMonad m => FilePath -> Maybe StringBuffer -> ExceptT [FileDiagnostic] m (StringBuffer, DynFlags)
preprocessor filename mbContents = do
-- Perform unlit
(isOnDisk, contents) <- if isLiterate filename then do
-- Perform unlit
(isOnDisk, contents) <- if isLiterate filename then do
dflags <- getDynFlags
newcontent <- liftIO $ runLhs dflags filename mbContents
return (False, newcontent)
else do
contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
let isOnDisk = isNothing mbContents
return (isOnDisk, contents)
else do
contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
let isOnDisk = isNothing mbContents
return (isOnDisk, contents)
-- Perform cpp
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
if not $ xopt LangExt.Cpp dflags then
-- Perform cpp
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
if not $ xopt LangExt.Cpp dflags then
return (contents, dflags)
else do
else do
contents <- liftIO $ runCpp dflags filename $ if isOnDisk then Nothing else Just contents
dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
return (contents, dflags)