breakpoint 0.1.1.0 → 0.1.1.1
raw patch · 6 files changed
+50/−2 lines, 6 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Debug.Breakpoint.GhcFacade: pattern OverLit' :: OverLitVal -> HsOverLit GhcRn
Files
- CHANGELOG.md +3/−0
- breakpoint.cabal +2/−2
- src/Debug/Breakpoint.hs +4/−0
- src/Debug/Breakpoint/GhcFacade.hs +11/−0
- test/OverloadedStrings.hs +28/−0
- test/Spec.hs +2/−0
CHANGELOG.md view
@@ -1,5 +1,8 @@ # Revision history for breakpoint +## 0.1.1.1 -- 2022-11-02+* Support `IsString` version of string literals in `excludeVars`+ ## 0.1.1.0 -- 2022-10-30 * Support for GHC 9.4.*
breakpoint.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: breakpoint-version: 0.1.1.0+version: 0.1.1.1 synopsis: Set breakpoints using a GHC plugin @@ -50,7 +50,7 @@ test-suite spec main-is: Spec.hs- other-modules: ApplicativeDo+ other-modules: ApplicativeDo, OverloadedStrings hs-source-dirs: test build-depends: base, tasty, tasty-hunit, breakpoint, containers type: exitcode-stdio-1.0
src/Debug/Breakpoint.hs view
@@ -433,9 +433,13 @@ else do let extractVarName (Ghc.HsLit _ (Ghc.HsString _ fs)) = Just $ Ghc.mkLexicalFastString fs+ extractVarName (Ghc.HsOverLit _ (Ghc.OverLit' (Ghc.HsIsString _ fs))) =+ Just $ Ghc.mkLexicalFastString fs extractVarName _ = Nothing+ varsToExclude = mapMaybe (extractVarName . Ghc.unLoc) exprsToExclude+ Just <$> mapWriterT (local (overVarSet $ \vs -> foldr M.delete vs varsToExclude))
src/Debug/Breakpoint/GhcFacade.hs view
@@ -21,6 +21,7 @@ , pattern LetStmt' , pattern ExplicitList' , pattern BindStmt'+ , pattern OverLit' ) where #if MIN_VERSION_ghc(9,4,0)@@ -351,4 +352,14 @@ BindStmt' x pat body _ _ = Ghc.BindStmt x pat body #else pattern BindStmt' x pat body bindExpr failExpr = Ghc.BindStmt x pat body bindExpr failExpr+#endif++pattern OverLit'+ :: Ghc.OverLitVal+ -> Ghc.HsOverLit Ghc.GhcRn+pattern OverLit' lit+#if MIN_VERSION_ghc(9,4,0)+ <- Ghc.OverLit _ lit+#else+ <- Ghc.OverLit _ lit _ #endif
+ test/OverloadedStrings.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE OverloadedStrings #-}+module OverloadedStrings+ ( testTree+ ) where++import qualified Data.Map as M+import Test.Tasty+import Test.Tasty.HUnit++import Debug.Breakpoint++-- Needs to be a separate module b/c ApplicativeDo affects other tests++testTree :: TestTree+testTree = testGroup "IsString"+ [ testCase "exclude vars" excludeVarsTest+ ]++excludeVarsTest :: Assertion+excludeVarsTest = do+ let m = test23+ m @?= M.fromList [("x", "True")]++test23 :: M.Map String String+test23 =+ let x = True+ y = False+ in excludeVars ["y"] captureVars
test/Spec.hs view
@@ -11,6 +11,7 @@ import Debug.Breakpoint import qualified ApplicativeDo as ApDo+import qualified OverloadedStrings as OS main :: IO () main = defaultMain testTree@@ -42,6 +43,7 @@ , testCase "Shows type that subclass for Show" showFixedPointNumber , testCase "exclude vars" excludeVarsTest , ApDo.testTree+ , OS.testTree ] -- TODO -- Implicit Params