Adapt to new GHC modules organization

pull/312/head
jneira 2020-05-13 10:45:14 +02:00 committed by Luke Lau
parent 82d46dcc4a
commit b66d95c6a9
3 changed files with 24 additions and 5 deletions

View File

@ -33,7 +33,13 @@ import qualified Lexer as GHC
import qualified StringBuffer as GHC import qualified StringBuffer as GHC
import qualified Outputable as GHC import qualified Outputable as GHC
import qualified CmdLineParser as GHC import qualified CmdLineParser as GHC
#if MIN_VERSION_ghc(8,10,1) /* ghc-8.10.1 */
import GHC.Hs
#else
import HsSyn import HsSyn
#endif
import SrcLoc ( SrcSpan, Located ) import SrcLoc ( SrcSpan, Located )

View File

@ -13,9 +13,13 @@ where
-- rather project-specific stuff: -- rather project-specific stuff:
--------------------------------- ---------------------------------
#if MIN_VERSION_ghc(8,10,1) /* ghc-8.10.1 */
import GHC.Hs.Extension as E ( GhcPs )
#else
# if MIN_VERSION_ghc(8,4,0) /* ghc-8.4 */ # if MIN_VERSION_ghc(8,4,0) /* ghc-8.4 */
import HsExtension as E ( GhcPs ) import HsExtension as E ( GhcPs )
#endif # endif /* ghc-8.4 */
#endif /* ghc-8.10.1 */
import RdrName as E ( RdrName ) import RdrName as E ( RdrName )
#if MIN_VERSION_ghc(8,8,0) #if MIN_VERSION_ghc(8,8,0)

View File

@ -59,9 +59,13 @@ import Language.Haskell.Brittany.Internal.Config.Types
import Language.Haskell.Brittany.Internal.Types import Language.Haskell.Brittany.Internal.Types
import qualified Data.Generics.Uniplate.Direct as Uniplate import qualified Data.Generics.Uniplate.Direct as Uniplate
#if MIN_VERSION_ghc(8,10,1) /* ghc-8.10.1 */
import qualified GHC.Hs.Extension as HsExtension
#else
# if MIN_VERSION_ghc(8,4,0) /* ghc-8.4 */ # if MIN_VERSION_ghc(8,4,0) /* ghc-8.4 */
import qualified HsExtension import qualified HsExtension
#endif # endif /* ghc-8.4 */
#endif /* ghc-8.10.1 */
@ -299,6 +303,10 @@ lines' s = case break (== '\n') s of
(s1, [_]) -> [s1, ""] (s1, [_]) -> [s1, ""]
(s1, (_:r)) -> s1 : lines' r (s1, (_:r)) -> s1 : lines' r
#if MIN_VERSION_ghc(8,10,1) /* ghc-8.10.1 */
absurdExt :: HsExtension.NoExtField -> a
absurdExt = error "cannot construct NoExtField"
#else
#if MIN_VERSION_ghc(8,6,0) /* ghc-8.6 */ #if MIN_VERSION_ghc(8,6,0) /* ghc-8.6 */
-- | A method to dismiss NoExt patterns for total matches -- | A method to dismiss NoExt patterns for total matches
absurdExt :: HsExtension.NoExt -> a absurdExt :: HsExtension.NoExt -> a
@ -306,4 +314,5 @@ absurdExt = error "cannot construct NoExt"
#else #else
absurdExt :: () absurdExt :: ()
absurdExt = () absurdExt = ()
#endif #endif /* ghc-8.6 */
#endif /* ghc-8.10.1 */