PyF 0.11.1.1 → 0.11.2.1
raw patch · 6 files changed
+53/−12 lines, 6 filesdep ~basedep ~bytestringdep ~ghcPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, bytestring, ghc, template-haskell, text, time
API changes (from Hackage documentation)
Files
- ChangeLog.md +10/−0
- PyF.cabal +7/−7
- src/PyF/Internal/Meta.hs +15/−1
- src/PyF/Internal/Parser.hs +13/−1
- src/PyF/Internal/PythonSyntax.hs +5/−2
- src/PyF/Internal/QQ.hs +3/−1
ChangeLog.md view
@@ -1,5 +1,15 @@ # Revision history for PyF +## 0.11.2.1 -- 2023-10-25++- Final version for GHC 9.8++## 0.11.2.0++- Fix for the neovim treesitter syntax highlighter for `fmt` and `fmtTrim` quasiquotes+- Initial support for GHC 9.8+- Version bump for new MTL+ ## 0.11.1.1 -- 2023-03-15 - Support for GHC 9.6. Thank you @Kleidukos for initiating the port.
PyF.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: PyF-version: 0.11.1.1+version: 0.11.2.1 synopsis: Quasiquotations for a python like interpolated string formatter description: Quasiquotations for a python like interpolated string formatter. license: BSD-3-Clause@@ -27,14 +27,14 @@ PyF.Internal.ParserEx PyF.Internal.Parser - build-depends: base >= 4.12 && < 4.19- , bytestring >= 0.10.8 && < 0.12- , template-haskell >= 2.14.0 && < 2.21- , text >= 1.2.3 && <= 2.1- , time >= 1.8.0 && < 1.13+ build-depends: base >= 4.12 && < 4.20+ , bytestring >= 0.10.8 && < 0.13+ , template-haskell >= 2.14.0 && < 2.22+ , text >= 1.2.3 && < 2.2+ , time >= 1.8.0 && < 1.14 , parsec >= 3.1.13 && < 3.2 , mtl >= 2.2.2 && < 2.4- , ghc >= 8.6.1 && < 9.7+ , ghc >= 8.6.1 if impl(ghc < 9.2.1) build-depends: ghc-boot >= 8.6.1 && < 9.7
src/PyF/Internal/Meta.hs view
@@ -99,6 +99,14 @@ toLit (HsRat _ f _) = TH.FloatPrimL (fl_value f) toLit (HsFloatPrim _ f) = TH.FloatPrimL (fl_value f) toLit (HsDoublePrim _ f) = TH.DoublePrimL (fl_value f)+#if MIN_VERSION_ghc(9,7,0)+toLit (HsInt8Prim _ i) = TH.IntPrimL i+toLit (HsInt16Prim _ i) = TH.IntPrimL i+toLit (HsInt32Prim _ i) = TH.IntPrimL i+toLit (HsWord8Prim _ i) = TH.WordPrimL i+toLit (HsWord16Prim _ i) = TH.WordPrimL i+toLit (HsWord32Prim _ i) = TH.WordPrimL i+#endif #if !MIN_VERSION_ghc(9,0,0) toLit (XLit _) = noTH "toLit" "XLit"@@ -231,7 +239,13 @@ (FromThen a b) -> TH.FromThenR (toExp d $ unLoc a) (toExp d $ unLoc b) (FromTo a b) -> TH.FromToR (toExp d $ unLoc a) (toExp d $ unLoc b) (FromThenTo a b c) -> TH.FromThenToR (toExp d $ unLoc a) (toExp d $ unLoc b) (toExp d $ unLoc c)-#if MIN_VERSION_ghc(9,6,0)+#if MIN_VERSION_ghc(9,7,0)+toExp _ (HsOverLabel _ lbl _) = TH.LabelE (fromSourceText lbl)+ where+ fromSourceText :: SourceText -> String+ fromSourceText (SourceText s) = unpackFS s+ fromSourceText NoSourceText = ""+#elif MIN_VERSION_ghc(9,6,0) toExp _ (HsOverLabel _ lbl _) = TH.LabelE (fromSourceText lbl) where fromSourceText :: SourceText -> String
src/PyF/Internal/Parser.hs view
@@ -72,7 +72,19 @@ PFailed _ (SrcLoc.srcSpanEnd -> SrcLoc.RealSrcLoc srcLoc) doc -> #endif -#if MIN_VERSION_ghc(9,6,0)+#if MIN_VERSION_ghc(9,7,0)+ let+ err = renderWithContext defaultSDocContext+ $ vcat+ $ map formatBulleted+ $ map (\psMessage -> diagnosticMessage (defaultDiagnosticOpts @PsMessage) psMessage)+ $ map errMsgDiagnostic+ $ sortMsgBag Nothing+ $ getMessages $ errorMessages+ line' = SrcLoc.srcLocLine srcLoc+ col = SrcLoc.srcLocCol srcLoc+ in Left (line', col, err)+#elif MIN_VERSION_ghc(9,6,0) let err = renderWithContext defaultSDocContext $ vcat
src/PyF/Internal/PythonSyntax.hs view
@@ -25,7 +25,8 @@ where import Control.Applicative (some)-import Control.Monad.Reader+import Control.Monad (replicateM_, void)+import Control.Monad.Reader (Reader, asks) import qualified Data.Char import Data.Maybe (fromMaybe) import GHC (GhcPs, HsExpr)@@ -37,7 +38,9 @@ import Text.Parsec import Data.Data (Data) -#if MIN_VERSION_ghc(9,6,0)+#if MIN_VERSION_ghc(9,7,0)++#elif MIN_VERSION_ghc(9,6,0) -- For some reasons, theses function are not exported anymore by some others import Data.Functor (void) import Control.Monad (replicateM_)
src/PyF/Internal/QQ.hs view
@@ -258,7 +258,9 @@ reportErrorAt :: SrcSpan -> String -> Q () reportErrorAt loc msg = unsafeRunTcM $ addErrAt loc msg' where-#if MIN_VERSION_ghc(9,6,0)+#if MIN_VERSION_ghc(9,7,0)+ msg' = TcRnUnknownMessage (UnknownDiagnostic (const NoDiagnosticOpts) (mkPlainError noHints (text msg)))+#elif MIN_VERSION_ghc(9,6,0) msg' = TcRnUnknownMessage (UnknownDiagnostic $ mkPlainError noHints $ text msg) #elif MIN_VERSION_ghc(9,3,0)