packages feed

ghc-lib-parser-ex 9.0.0.3 → 9.0.0.4

raw patch · 8 files changed

+30/−6 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

ChangeLog.md view
@@ -1,5 +1,11 @@ # Changelog for ghc-lib-parser-ex +## 9.0.0.4 released 2021-03-11+- Bugfix for `GHC.Hs.Dump`++## 0.20210228 released 2021-02-28+- Update to `ghc-lib-0.20210228`+ ## 9.0.0.3 released 2021-02-08 - Cabal bugfix 
README.md view
@@ -1,5 +1,5 @@ # ghc-lib-parser-ex [![License BSD3](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](http://opensource.org/licenses/BSD-3-Clause) [![Hackage version](https://img.shields.io/hackage/v/ghc-lib-parser-ex.svg?label=Hackage)](https://hackage.haskell.org/package/ghc-lib-parser-ex) [![Stackage version](https://www.stackage.org/package/ghc-lib-parser-ex/badge/nightly?label=Stackage)](https://www.stackage.org/package/ghc-lib-parser-ex)  [![Build Status](https://shayne-fletcher.visualstudio.com/ghc-lib-parser-ex/_apis/build/status/shayne-fletcher.ghc-lib-parser-ex?branchName=master)](https://shayne-fletcher.visualstudio.com/ghc-lib-parser-ex/_build/latest?definitionId=1&branchName=master)-Copyright © 2020, Shayne Fletcher. All rights reserved.+Copyright © 2020-2021 Shayne Fletcher. All rights reserved. SPDX-License-Identifier: BSD-3-Clause  The `ghc-lib-parser-ex` package contains GHC API parse tree utilities. It works with or without [`ghc-lib-parser`](https://github.com/digital-asset/ghc-lib).
cbits/ghclib_api.h view
@@ -20,7 +20,7 @@ #         error Unsupported GHC API version #      endif #    else-#      if __GLASGOW_HASKELL__   == 811+#      if __GLASGOW_HASKELL__   == 901 #        define GHCLIB_API_HEAD #      elif __GLASGOW_HASKELL__ == 900 #        define GHCLIB_API_900
ghc-lib-parser-ex.cabal view
@@ -1,6 +1,6 @@ cabal-version: >= 1.18 name:           ghc-lib-parser-ex-version:        9.0.0.3+version:        9.0.0.4 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/Dump.hs view
@@ -17,7 +17,7 @@  #if !defined(MIN_VERSION_ghc_lib_parser) -- Using native ghc.-#  if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_810)+#  if defined (GHCLIB_API_HEAD) || defined(GHCLIB_API_900) || defined (GHCLIB_API_810) import GHC.Hs.Dump #  else import HsDumpAst
src/Language/Haskell/GhclibParserEx/GHC/Hs/Expr.hs view
@@ -159,8 +159,13 @@ isUnboxed = \case Unboxed -> True; _ -> False  isWholeFrac :: HsExpr GhcPs -> Bool+#if defined (GHCLIB_API_HEAD)+isWholeFrac (HsLit _ (HsRat _ fl@FL{} _)) = denominator (rationalFromFractionalLit fl) == 1+isWholeFrac (HsOverLit _ (OverLit _ (HsFractional fl@FL {}) _)) = denominator (rationalFromFractionalLit fl) == 1+#else isWholeFrac (HsLit _ (HsRat _ (FL _ _ v) _)) = denominator v == 1 isWholeFrac (HsOverLit _ (OverLit _ (HsFractional (FL _ _ v)) _)) = denominator v == 1+#endif isWholeFrac _ = False  varToStr :: LHsExpr GhcPs -> String
src/Language/Haskell/GhclibParserEx/GHC/Parser.hs view
@@ -98,8 +98,14 @@ parseExpression :: String -> DynFlags -> ParseResult (LHsExpr GhcPs) #if defined (GHCLIB_API_HEAD) parseExpression s flags =+  -- The need for annotations here came about first manifested with+  -- ghc-9.0.1   case parse Parser.parseExpression s flags of-    POk s e -> unP (runPV . unECP $ e) s+    POk state e ->+      let e' = e :: ECP+          parser_validator = unECP e' :: PV (LHsExpr GhcPs)+          parser = runPV parser_validator :: P (LHsExpr GhcPs)+      in unP parser state :: ParseResult (LHsExpr GhcPs)     PFailed ps -> PFailed ps #elif defined (GHCLIB_API_810) || defined (GHCLIB_API_900) parseExpression s flags =
test/Test.hs view
@@ -177,7 +177,11 @@   ]   where     flags = defaultDynFlags fakeSettings fakeLlvmConfig+#if defined (GHCLIB_API_HEAD)+    report flags msgs = concat [ showSDoc flags msg | msg <- pprMsgEnvelopeBagWithLoc msgs ]+#else     report flags msgs = concat [ showSDoc flags msg | msg <- pprErrMsgBagWithLoc msgs ]+#endif  #if defined (GHCLIB_API_HEAD) || defined (GHCLIB_API_900) moduleTest :: String -> DynFlags -> (Located HsModule -> IO ()) -> IO ()@@ -382,8 +386,11 @@   ]   where     flags = defaultDynFlags fakeSettings fakeLlvmConfig+#if defined(GHCLIB_API_HEAD)+    report flags msgs = concat [ showSDoc flags msg | msg <- pprMsgEnvelopeBagWithLoc msgs ]+#else     report flags msgs = concat [ showSDoc flags msg | msg <- pprErrMsgBagWithLoc msgs ]-+#endif nameTests :: TestTree nameTests = testGroup "Name tests"   [ testCase "modName (1)" $