Skip to content

Commit

Permalink
Prepare release v1.10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz committed May 21, 2024
1 parent e867719 commit 1cde16d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-05-21 v1.10.0.0
* Make the Language.Haskell.GHC.ExactPrint.Transform API pure
* Remove EPOoptions fields that had no effect
2024-05-16 v1.9.0.0
* Support GHC 9.10.1
2022-12-19 v1.8.0.0
Expand Down
2 changes: 1 addition & 1 deletion ghc-exactprint.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: ghc-exactprint
version: 1.9.0.0
version: 1.10.0.0
synopsis: ExactPrint for GHC
description: Using the API Annotations available from GHC 9.2.1, this
library provides a means to round trip any code that can
Expand Down
20 changes: 10 additions & 10 deletions src/Language/Haskell/GHC/ExactPrint/Transform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,13 @@ balanceCommentsFB (L lf (FunBind x n (MG o (L lm matches)))) second
lf' = setCommentsEpAnn lf (EpaComments before)
matches' :: [LocatedA (Match GhcPs (LHsExpr GhcPs))]
matches' = case matches of
(L lm' m':ms') ->
(L (addCommentsToEpAnn lm' (EpaComments middle )) m':ms')
(L lm' m0:ms') ->
(L (addCommentsToEpAnn lm' (EpaComments middle )) m0:ms')
_ -> error "balanceCommentsFB"
matches'' = balanceCommentsListA matches'
(m,ms) = case reverse matches'' of
(L lm' m':ms') ->
(L (addCommentsToEpAnn lm' (EpaCommentsBalanced [] after)) m',ms')
(L lm' m0:ms') ->
(L (addCommentsToEpAnn lm' (EpaCommentsBalanced [] after)) m0,ms')
_ -> error "balanceCommentsFB4"
(m',second') = balanceCommentsA m second
m'' = balanceCommentsMatch m'
Expand All @@ -455,7 +455,7 @@ balanceCommentsMatch (L l (Match am mctxt pats (GRHSs xg grhss binds)))
(move',stay') = break simpleBreak (trailingCommentsDeltas (anchorFromLocatedA (L l ())) cs1f)
move = map snd move'
stay = map snd stay'
(l'', grhss', binds', logInfo)
(l'', grhss', binds', _logInfo)
= case reverse grhss of
[] -> (l, [], binds, (EpaComments [], noSrcSpanA))
(L lg (GRHS ag grs rhs):gs) ->
Expand Down Expand Up @@ -682,7 +682,7 @@ balanceSameLineComments (L la (Match anm mctxt pats (GRHSs x grhss lb)))
= (L la' (Match anm mctxt pats (GRHSs x grhss' lb)))
where
simpleBreak n (r,_) = r > n
(la',grhss', logInfo) = case reverse grhss of
(la',grhss', _logInfo) = case reverse grhss of
[] -> (la,grhss,[])
(L lg (GRHS ga gs rhs):grs) -> (la'',reverse $ (L lg (GRHS ga' gs rhs)):grs,[(gac,(csp,csf))])
where
Expand Down Expand Up @@ -864,8 +864,8 @@ instance HasDecls (LocatedA (Match GhcPs (LocatedA (HsExpr GhcPs)))) where
(l', rhs') = case binds of
EmptyLocalBinds{} ->
let
L l' m' = balanceSameLineComments m
in (l', grhssGRHSs $ m_grhss m')
L l0 m' = balanceSameLineComments m
in (l0, grhssGRHSs $ m_grhss m')
_ -> (l, rhs)
binds'' = replaceDeclsValbinds WithWhere binds newBinds
in (L l' (Match xm c p (GRHSs xr rhs' binds'')))
Expand Down Expand Up @@ -1141,8 +1141,8 @@ modifyValD p decl f = (packFunDecl decl', r)
then do
let
ds = hsDecls match
(ds',r) = f match ds
put r
(ds',r0) = f match ds
put r0
let match' = replaceDecls match ds'
return match'
else return match
Expand Down

0 comments on commit 1cde16d

Please sign in to comment.