haskell-tools-debug 0.9.0.0 → 1.0.0.0
raw patch · 5 files changed
+36/−47 lines, 5 filesdep ~basedep ~ghcdep ~haskell-tools-ast
Dependency ranges changed: base, ghc, haskell-tools-ast, haskell-tools-backend-ghc, haskell-tools-builtin-refactorings, haskell-tools-prettyprint, haskell-tools-refactor, template-haskell
Files
- Language/Haskell/Tools/Debug.hs +5/−9
- Language/Haskell/Tools/Debug/DebugGhcAST.hs +18/−14
- Language/Haskell/Tools/Debug/RangeDebug.hs +1/−8
- Language/Haskell/Tools/Debug/RangeDebugInstances.hs +3/−7
- haskell-tools-debug.cabal +9/−9
Language/Haskell/Tools/Debug.hs view
@@ -1,7 +1,4 @@- {-# LANGUAGE StandaloneDeriving - , DeriveGeneric - , LambdaCase - #-} + {-# LANGUAGE DeriveGeneric, LambdaCase, StandaloneDeriving #-} module Language.Haskell.Tools.Debug where import Control.Monad (Monad(..), (=<<), forM_) @@ -36,12 +33,11 @@ _ <- useFlags args useDirs [workingDir] ms <- loadModule workingDir moduleName - let modSum = ms { ms_hspp_opts = (ms_hspp_opts ms) { hscTarget = HscAsm, ghcLink = LinkInMemory } } - p <- parseModule modSum + p <- parseModule ms t <- typecheckModule p let annots = pm_annotations $ tm_parsed_module t - hasCPP = Cpp `xopt` ms_hspp_opts modSum + hasCPP = Cpp `xopt` ms_hspp_opts ms liftIO $ putStrLn "=========== tokens:" liftIO $ putStrLn $ show (fst annots) @@ -55,10 +51,10 @@ liftIO $ putStrLn $ show (typecheckedSource t) liftIO $ putStrLn "=========== parsed:" --transformed <- runTrf (fst annots) (getPragmaComments $ snd annots) $ trfModule (pm_parsed_source p) - parseTrf <- runTrf (fst annots) (getPragmaComments $ snd annots) $ trfModule modSum (pm_parsed_source p) + parseTrf <- runTrf (fst annots) (getPragmaComments $ snd annots) $ trfModule ms (pm_parsed_source p) liftIO $ putStrLn $ srcInfoDebug parseTrf liftIO $ putStrLn "=========== typed:" - transformed <- addTypeInfos (typecheckedSource t) =<< (runTrf (fst annots) (getPragmaComments $ snd annots) $ trfModuleRename modSum parseTrf (fromJust $ tm_renamed_source t) (pm_parsed_source p)) + transformed <- addTypeInfos (typecheckedSource t) =<< (runTrf (fst annots) (getPragmaComments $ snd annots) $ trfModuleRename ms parseTrf (fromJust $ tm_renamed_source t) (pm_parsed_source p)) liftIO $ putStrLn $ srcInfoDebug transformed liftIO $ putStrLn "=========== ranges fixed:" sourceOrigin <- if hasCPP then liftIO $ hGetStringBuffer (workingDir </> map (\case '.' -> pathSeparator; c -> c) moduleName <.> "hs")
Language/Haskell/Tools/Debug/DebugGhcAST.hs view
@@ -1,7 +1,4 @@-{-# LANGUAGE StandaloneDeriving - , TypeSynonymInstances - , FlexibleInstances - #-} +{-# LANGUAGE FlexibleContexts, FlexibleInstances, StandaloneDeriving, UndecidableInstances #-} -- | A module for showing GHC's syntax tree representation. module Language.Haskell.Tools.Debug.DebugGhcAST where @@ -16,13 +13,14 @@ import FieldLabel (FieldLbl(..)) import ForeignCall import GHC -import Module (UnitId(..), Module(..), ModuleName(..)) +import Module (Module(..), ModuleName(..)) import OccName (OccName(..)) -import Outputable (Outputable(..), OutputableBndr(..), showSDocUnsafe) +import Outputable (Outputable(..), showSDocUnsafe) import PatSyn (PatSyn(..)) import RdrName (RdrName(..)) import TcEvidence import UniqFM (UniqFM(..)) +import UniqSet (UniqSet(..)) instance Show a => Show (Located a) where show (L l a) = "L(" ++ shortShowSpan l ++ ") (" ++ show a ++ ")" @@ -58,11 +56,11 @@ deriving instance Show (HsConDeclDetails RdrName) deriving instance Show (HsConPatDetails RdrName) deriving instance Show (HsDataDefn RdrName) +deriving instance Show (HsDerivingClause RdrName) deriving instance Show (HsDecl RdrName) deriving instance Show (HsExpr RdrName) deriving instance Show (HsGroup RdrName) deriving instance Show (HsLocalBindsLR RdrName RdrName) -deriving instance Show (HsMatchContext RdrName) deriving instance Show (HsModule RdrName) deriving instance Show (HsOverLit RdrName) deriving instance Show (HsPatSynDetails (Located RdrName)) @@ -78,11 +76,12 @@ deriving instance Show (HsValBindsLR RdrName RdrName) deriving instance Show (HsWildCardInfo RdrName) deriving instance Show (IE RdrName) +deriving instance Show (IEWrappedName RdrName) deriving instance Show (ImportDecl RdrName) deriving instance Show (InstDecl RdrName) deriving instance Show (LHsQTyVars RdrName) deriving instance Show a => Show (Match RdrName a) -deriving instance Show (MatchFixity RdrName) +deriving instance Show (HsMatchContext RdrName) deriving instance Show a => Show (MatchGroup RdrName a) deriving instance Show (ParStmtBlock RdrName RdrName) deriving instance Show (Pat RdrName) @@ -136,6 +135,7 @@ deriving instance Show (HsConDeclDetails Name) deriving instance Show (HsConPatDetails Name) deriving instance Show (HsDataDefn Name) +deriving instance Show (HsDerivingClause Name) deriving instance Show (HsDecl Name) deriving instance Show (HsExpr Name) deriving instance Show (HsGroup Name) @@ -156,11 +156,11 @@ deriving instance Show (HsValBindsLR Name Name) deriving instance Show (HsWildCardInfo Name) deriving instance Show (IE Name) +deriving instance Show (IEWrappedName Name) deriving instance Show (ImportDecl Name) deriving instance Show (InstDecl Name) deriving instance Show (LHsQTyVars Name) deriving instance Show a => Show (Match Name a) -deriving instance Show (MatchFixity Name) deriving instance Show a => Show (MatchGroup Name a) deriving instance Show (ParStmtBlock Name Name) deriving instance Show (Pat Name) @@ -214,6 +214,7 @@ deriving instance Show (HsConDeclDetails Id) deriving instance Show (HsConPatDetails Id) deriving instance Show (HsDataDefn Id) +deriving instance Show (HsDerivingClause Id) deriving instance Show (HsDecl Id) deriving instance Show (HsExpr Id) deriving instance Show (HsGroup Id) @@ -234,11 +235,11 @@ deriving instance Show (HsValBindsLR Id Id) deriving instance Show (HsWildCardInfo Id) deriving instance Show (IE Id) +deriving instance Show (IEWrappedName Id) deriving instance Show (ImportDecl Id) deriving instance Show (InstDecl Id) deriving instance Show (LHsQTyVars Id) deriving instance Show a => Show (Match Id a) -deriving instance Show (MatchFixity Id) deriving instance Show a => Show (MatchGroup Id a) deriving instance Show (ParStmtBlock Id Id) deriving instance Show (Pat Id) @@ -330,9 +331,6 @@ deriving instance Show t => Show (HsWildCardBndrs Id t) deriving instance (Show a, Show b) => Show (HsRecField' a b) - -instance Show UnitId where - show = showSDocUnsafe . ppr instance Show Name where show = showSDocUnsafe . ppr instance Show HsTyLit where @@ -351,11 +349,17 @@ show = showSDocUnsafe . ppr instance Show TcCoercion where show = showSDocUnsafe . ppr +instance Show DerivStrategy where + show = showSDocUnsafe . ppr instance Outputable a => Show (UniqFM a) where show = showSDocUnsafe . ppr +instance Outputable a => Show (UniqSet a) where + show = showSDocUnsafe . ppr instance Outputable a => Show (Tickish a) where show = showSDocUnsafe . ppr -instance OutputableBndr a => Show (HsIPBinds a) where +instance OutputableBndrId a => Show (HsIPBinds a) where + show = showSDocUnsafe . ppr +instance Show LexicalFixity where show = showSDocUnsafe . ppr instance Show a => Show (Bag a) where
Language/Haskell/Tools/Debug/RangeDebug.hs view
@@ -1,11 +1,4 @@-{-# LANGUAGE TypeOperators - , DefaultSignatures - , StandaloneDeriving - , FlexibleContexts - , FlexibleInstances - , MultiParamTypeClasses - , TypeFamilies - #-} +{-# LANGUAGE DefaultSignatures, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, TypeFamilies, TypeOperators #-} -- | A module for displaying debug info about the source annotations of the syntax tree in different phases. module Language.Haskell.Tools.Debug.RangeDebug where
Language/Haskell/Tools/Debug/RangeDebugInstances.hs view
@@ -1,10 +1,4 @@-{-# LANGUAGE FlexibleContexts - , FlexibleInstances - , MultiParamTypeClasses - , StandaloneDeriving - , DeriveGeneric - , UndecidableInstances - #-} +{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, TypeFamilies, UndecidableInstances #-} module Language.Haskell.Tools.Debug.RangeDebugInstances where import Language.Haskell.Tools.Debug.RangeDebug (TreeDebug(..)) @@ -60,6 +54,7 @@ instance (SourceInfo st, Domain dom) => TreeDebug UConDecl dom st instance (SourceInfo st, Domain dom) => TreeDebug UFieldDecl dom st instance (SourceInfo st, Domain dom) => TreeDebug UDeriving dom st +instance (SourceInfo st, Domain dom) => TreeDebug UDeriveStrategy dom st instance (SourceInfo st, Domain dom) => TreeDebug UInstanceRule dom st instance (SourceInfo st, Domain dom) => TreeDebug UInstanceHead dom st instance (SourceInfo st, Domain dom) => TreeDebug UTypeEqn dom st @@ -115,6 +110,7 @@ instance (SourceInfo st, Domain dom) => TreeDebug UMatchLhs dom st instance (SourceInfo st, Domain dom) => TreeDebug UInlinePragma dom st instance (SourceInfo st, Domain dom) => TreeDebug USpecializePragma dom st +instance (SourceInfo st, Domain dom) => TreeDebug UUnboxedSumPlaceHolder dom st -- ULiteral instance (SourceInfo st, Domain dom) => TreeDebug ULiteral dom st
haskell-tools-debug.cabal view
@@ -1,5 +1,5 @@ name: haskell-tools-debug -version: 0.9.0.0 +version: 1.0.0.0 synopsis: Debugging Tools for Haskell-tools description: Debugging Tools for Haskell-tools homepage: https://github.com/haskell-tools/haskell-tools @@ -16,18 +16,18 @@ other-modules: Language.Haskell.Tools.Debug.DebugGhcAST , Language.Haskell.Tools.Debug.RangeDebug , Language.Haskell.Tools.Debug.RangeDebugInstances - build-depends: base >= 4.9 && < 4.10 + build-depends: base >= 4.10 && < 4.11 , filepath >= 1.4 && < 1.5 - , template-haskell >= 2.11 && < 2.12 + , template-haskell >= 2.12 && < 2.13 , references >= 0.3 && < 0.4 , split >= 0.2 && < 0.3 - , ghc >= 8.0 && < 8.1 + , ghc >= 8.2 && < 8.3 , ghc-paths >= 0.1 && < 0.2 - , haskell-tools-ast >= 0.9 && < 0.10 - , haskell-tools-backend-ghc >= 0.9 && < 0.10 - , haskell-tools-refactor >= 0.9 && < 0.10 - , haskell-tools-prettyprint >= 0.9 && < 0.10 - , haskell-tools-builtin-refactorings >= 0.9 && < 0.10 + , haskell-tools-ast >= 1.0 && < 1.1 + , haskell-tools-backend-ghc >= 1.0 && < 1.1 + , haskell-tools-refactor >= 1.0 && < 1.1 + , haskell-tools-prettyprint >= 1.0 && < 1.1 + , haskell-tools-builtin-refactorings >= 1.0 && < 1.1 default-language: Haskell2010 executable ht-debug