summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2021-05-06 18:47:51 +0100
committerBen Gamari <ben@smart-cactus.org>2021-05-12 20:27:10 -0400
commit06bf6feed2d159df8ff1a08c1e4ab6c86a7910a2 (patch)
tree244fddda0bb72590a759a7ce6184e6f644dd6600 /compiler/GHC/Parser
parent4841d6c9ab60c7cd27d4993beb34cd44c1328439 (diff)
downloadhaskell-06bf6feed2d159df8ff1a08c1e4ab6c86a7910a2.tar.gz
EPA: properly capture leading semicolons in statement lists
For the fragment blah = do { ; print "a" ; print "b" } capture the leading semicolon before 'print "a"' in 'al_rest' in AnnList instead of in 'al_trailing'. Closes #19798 (cherry picked from commit 736d47ffb7370ba4348b142c913b88e4c82347d0)
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r--compiler/GHC/Parser/Annotation.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs
index 8dc12555a0..8d47c699ba 100644
--- a/compiler/GHC/Parser/Annotation.hs
+++ b/compiler/GHC/Parser/Annotation.hs
@@ -689,7 +689,9 @@ data AnnList
al_open :: Maybe AddEpAnn,
al_close :: Maybe AddEpAnn,
al_rest :: [AddEpAnn], -- ^ context, such as 'where' keyword
- al_trailing :: [TrailingAnn]
+ al_trailing :: [TrailingAnn] -- ^ items appearing after the
+ -- list, such as '=>' for a
+ -- context
} deriving (Data,Eq)
-- ---------------------------------------------------------------------