ghc-srcspan-plugin 0.2.1.0 → 0.2.2.0
raw patch · 3 files changed
+13/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
ghc-srcspan-plugin.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: ghc-srcspan-plugin-version: 0.2.1.0+version: 0.2.2.0 synopsis: Generic GHC Plugin for annotating Haskell code with source location data. description: This package provides a generic Core-to-Core pass for
src/GHC/Plugins/ErrorLoc.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} module GHC.Plugins.ErrorLoc (plugin, errorAt, undefinedAt, fromJustAt) where@@ -23,9 +24,16 @@ maybeM <- lookupModule (mkModuleName "Data.Maybe") Nothing fmjstVar <- lookupId =<< lookupName maybeM (mkVarOcc "fromJust") +#if __GLASGOW_HASKELL__ < 800 let subst = [ (eRROR_ID, errorAtVar), (uNDEFINED_ID, undefAtVar) , (fmjstVar, fmjstAtVar) ]+#else+ -- GHC 8 uses HasCallStack to provide source locations for+ -- error and undefined, so rewriting them is pointless+ let subst = [ (fmjstVar, fmjstAtVar) ]+#endif+ let annotate = mkErrorAt subst
src/GHC/Plugins/SrcSpan.hs view
@@ -84,7 +84,11 @@ mixEntries <- getMixEntries modName (hpcDir df) `catch` \(_ :: SomeException) -> return [] let hpc = IntMap.fromList $ zip [0..] mixEntries+#if __GLASGOW_HASKELL__ < 800 let bk = IntMap.fromList $ Array.assocs $ modBreaks_locs mg_modBreaks+#else+ let bk = maybe IntMap.empty (IntMap.fromList . Array.assocs . modBreaks_locs) mg_modBreaks+#endif return (tickSpan hpc bk)