summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2022-03-07 22:23:29 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-03-28 19:23:28 -0400
commit8229885cb6a9f78ab09468f3797e3ec48ea24f82 (patch)
tree568e100868454269d5e6a382d3503bd40a9ba548 /compiler/GHC/Parser.y
parent89cb13153dbe9a88706c43dbf0f681e90ecaa599 (diff)
downloadhaskell-8229885cb6a9f78ab09468f3797e3ec48ea24f82.tar.gz
EPA: let stmt with semicolon has wrong anchor
The code let ;x =1 Captures the semicolon annotation, but did not widen the anchor in the ValBinds. Fix that. Closes #20247
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index 225eabd212..af6bb3d51a 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -1793,7 +1793,7 @@ binds :: { Located (HsLocalBinds GhcPs) }
-- No type declarations
: decllist {% do { val_binds <- cvBindGroup (unLoc $ snd $ unLoc $1)
; cs <- getCommentsFor (gl $1)
- ; return (sL1 $1 $ HsValBinds (EpAnn (glR $1) (fst $ unLoc $1) cs) val_binds)} }
+ ; return (sL1 $1 $ HsValBinds (fixValbindsAnn $ EpAnn (glR $1) (fst $ unLoc $1) cs) val_binds)} }
| '{' dbinds '}' {% acs (\cs -> (L (comb3 $1 $2 $3)
$ HsIPBinds (EpAnn (glR $1) (AnnList (Just$ glR $2) (Just $ moc $1) (Just $ mcc $3) [] []) cs) (IPBinds noExtField (reverse $ unLoc $2)))) }