Finish ParseModule
parent
dde016f5fe
commit
2fd0b861dd
|
@ -34,7 +34,11 @@ parseModule
|
||||||
-> FilePath
|
-> FilePath
|
||||||
-> (GHC.Driver.Session.DynFlags -> io (Either String a))
|
-> (GHC.Driver.Session.DynFlags -> io (Either String a))
|
||||||
-> String
|
-> String
|
||||||
|
#if MIN_VERSION_ghc(9,2,1)
|
||||||
|
-> io (Either String (GHC.ParsedSource, a))
|
||||||
|
#else
|
||||||
-> io (Either String (ExactPrint.Anns, GHC.ParsedSource, a))
|
-> io (Either String (ExactPrint.Anns, GHC.ParsedSource, a))
|
||||||
|
#endif
|
||||||
parseModule arguments1 filePath checkDynFlags string = Except.runExceptT $ do
|
parseModule arguments1 filePath checkDynFlags string = Except.runExceptT $ do
|
||||||
let
|
let
|
||||||
dynFlags1 = GHC.Driver.Session.gopt_set
|
dynFlags1 = GHC.Driver.Session.gopt_set
|
||||||
|
@ -68,7 +72,11 @@ parseModule arguments1 filePath checkDynFlags string = Except.runExceptT $ do
|
||||||
ExactPrint.parseModuleFromStringInternal dynFlags3 filePath string
|
ExactPrint.parseModuleFromStringInternal dynFlags3 filePath string
|
||||||
case parseResult of
|
case parseResult of
|
||||||
Left errorMessages -> handleErrorMessages errorMessages
|
Left errorMessages -> handleErrorMessages errorMessages
|
||||||
|
#if MIN_VERSION_ghc(9,2,1)
|
||||||
|
Right parsedSource -> pure (parsedSource, dynFlagsResult)
|
||||||
|
#else
|
||||||
Right (anns, parsedSource) -> pure (anns, parsedSource, dynFlagsResult)
|
Right (anns, parsedSource) -> pure (anns, parsedSource, dynFlagsResult)
|
||||||
|
#endif
|
||||||
|
|
||||||
handleLeftovers
|
handleLeftovers
|
||||||
:: Monad m => [GHC.Types.SrcLoc.Located String] -> Except.ExceptT String m ()
|
:: Monad m => [GHC.Types.SrcLoc.Located String] -> Except.ExceptT String m ()
|
||||||
|
@ -293,6 +301,7 @@ initialTargetPlatform = GHC.Settings.Platform
|
||||||
, GHC.Settings.platformLeadingUnderscore = False
|
, GHC.Settings.platformLeadingUnderscore = False
|
||||||
#if MIN_VERSION_ghc(9,2,1)
|
#if MIN_VERSION_ghc(9,2,1)
|
||||||
, GHC.Settings.platformArchOS = initialPlatformArchOS
|
, GHC.Settings.platformArchOS = initialPlatformArchOS
|
||||||
|
, GHC.Settings.platform_constants = Just initialPlatformConstants
|
||||||
#else
|
#else
|
||||||
, GHC.Settings.platformMini = initialPlatformMini
|
, GHC.Settings.platformMini = initialPlatformMini
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue