ghc-lib-parser-ex 0.20210901 → 0.20211001
raw patch · 5 files changed
+33/−10 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Language.Haskell.GhclibParserEx.GHC.Hs.Pat: isSplicePat :: LPat GhcPs -> Bool
Files
- ChangeLog.md +5/−0
- ghc-lib-parser-ex.cabal +1/−1
- src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs +8/−0
- src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs +7/−6
- test/Test.hs +12/−3
ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for ghc-lib-parser-ex +## 0.20211001 released 2021-10-01+- Add `isSplicePat` to `Language.Haskell.GhclibParserEx.GHC.Hs.Pat`+- Use `genericPlatform` on `GHCLIB_API_HEAD` in `GhclibParserEx.GHC.Settings.Config.hs`+- Update to `ghc-lib-parser-0.20211001`+ ## 0.20210901 released 2021-09-01 - Update to `ghc-lib-parser-0.20210901`
ghc-lib-parser-ex.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.18 name: ghc-lib-parser-ex-version: 0.20210901+version: 0.20211001 description: Please see the README on GitHub at <https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme> homepage: https://github.com/shayne-fletcher/ghc-lib-parser-ex#readme bug-reports: https://github.com/shayne-fletcher/ghc-lib-parser-ex/issues
src/Language/Haskell/GhclibParserEx/GHC/Hs/Pat.hs view
@@ -9,6 +9,7 @@ , fromPChar , hasPFieldsDotDot , isPFieldWildcard, isPWildcard, isPFieldPun, isPatTypeSig, isPBangPat, isPViewPat+ , isSplicePat ) where #if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)@@ -167,4 +168,11 @@ isPatTypeSig (dL -> L _ SigPat{}) = True; isPatTypeSig _ = False isPBangPat (dL -> L _ BangPat{}) = True; isPBangPat _ = False isPViewPat (dL -> L _ ViewPat{}) = True; isPViewPat _ = False+#endif++isSplicePat :: LPat GhcPs -> Bool+#if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_902) || defined (GHCLIB_API_900) || defined (GHCLIB_API_810)+isSplicePat (L _ SplicePat{}) = True; isSplicePat _ = False+#else+isSplicePat (dL -> L _ SplicePat{}) = True; isSplicePat _ = False #endif
src/Language/Haskell/GhclibParserEx/GHC/Settings/Config.hs view
@@ -63,8 +63,11 @@ } #endif platform =+#if defined (GHCLIB_API_HEAD)+ genericPlatform+#else Platform{-#if defined (GHCLIB_API_HEAD) || defined(GHCLIB_API_902) || defined (GHCLIB_API_900)+#if defined(GHCLIB_API_902) || defined (GHCLIB_API_900) -- It doesn't matter what values we write here as these fields are -- not referenced for our purposes. However the fields are strict -- so we must say something.@@ -75,15 +78,12 @@ , platformIsCrossCompiling=False , platformLeadingUnderscore=False , platformTablesNextToCode=False-#if defined (GHCLIB_API_HEAD)- , platform_constants = Nothing-#endif-#if !defined(GHCLIB_API_HEAD) && !defined (GHCLIB_API_900)+#if !defined (GHCLIB_API_900) , platformConstants=platformConstants #endif , #endif-#if defined (GHCLIB_API_HEAD) || defined(GHCLIB_API_902)+#if defined(GHCLIB_API_902) platformWordSize=PW8 , platformArchOS=ArchOS {archOS_arch=ArchUnknown, archOS_OS=OSUnknown} #elif defined (GHCLIB_API_810) || defined (GHCLIB_API_900)@@ -95,6 +95,7 @@ #endif , platformUnregisterised=True }+#endif #if !defined(GHCLIB_API_HEAD) platformConstants = PlatformConstants{pc_DYNAMIC_BY_DEFAULT=False,pc_WORD_SIZE=8}
test/Test.hs view
@@ -390,12 +390,21 @@ , testCase "strToPat" $ assert' . (== "[]") . patToStr . strToPat $ "[]" , testCase "fromPChar" $ test "'a'" $ assert' . (== Just 'a') . fromPChar , testCase "fromPChar" $ test "\"a\"" $ assert' . isNothing . fromPChar+ , testCase "isSplicePat" $ test "$(varP pylonExPtrVarName)" $ assert' . isSplicePat ] where assert' = assertBool ""- test s = patTest s flags- flags = foldl' xopt_set (defaultDynFlags fakeSettings fakeLlvmConfig)- [ TemplateHaskell, QuasiQuotes, TypeApplications, LambdaCase ]+ test = test_with_exts []+ test_with_exts exts s = patTest s (flags exts)+ flags exts = foldl' xopt_set (defaultDynFlags fakeSettings fakeLlvmConfig)+ (exts +++ [ TemplateHaskell+ , TemplateHaskellQuotes+ , QuasiQuotes+ , TypeApplications+ , LambdaCase+ ]+ ) dynFlagsTests :: TestTree dynFlagsTests = testGroup "DynFlags tests"