File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ import Data.Maybe
3333-- e.g. unlit/cpp. Return the resulting buffer and the DynFlags it implies.
3434preprocessor :: GhcMonad m => FilePath -> Maybe StringBuffer -> ExceptT [FileDiagnostic ] m (StringBuffer , DynFlags )
3535preprocessor filename mbContents = do
36- contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
37- let isOnDisk = isNothing mbContents
38-
39- -- unlit content if literate Haskell ending
40- (isOnDisk, contents) <- if isLiterate filename
41- then do
36+ -- Perform unlit
37+ (isOnDisk, contents) <- if isLiterate filename then do
4238 dflags <- getDynFlags
4339 newcontent <- liftIO $ runLhs dflags filename mbContents
4440 return (False , newcontent)
45- else return (isOnDisk, contents)
41+ else do
42+ contents <- liftIO $ maybe (hGetStringBuffer filename) return mbContents
43+ let isOnDisk = isNothing mbContents
44+ return (isOnDisk, contents)
4645
46+ -- Perform cpp
4747 dflags <- ExceptT $ parsePragmasIntoDynFlags filename contents
4848 if not $ xopt LangExt. Cpp dflags then
4949 return (contents, dflags)
You can’t perform that action at this time.
0 commit comments