[Git][ghc/ghc][master] EPA: Widen stmtslist to include last semicolon

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sun May 5 04:19:36 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00
EPA: Widen stmtslist to include last semicolon

Closes #24754

- - - - -


5 changed files:

- compiler/GHC/Parser.y
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/Test24754.hs
- testsuite/tests/printer/all.T


Changes:

=====================================
compiler/GHC/Parser.y
=====================================
@@ -3444,7 +3444,7 @@ stmts :: { forall b. DisambECP b => PV (Located (OrdList AddEpAnn,[LStmt GhcPs (
                              [] -> return (sLZ $1 $> ((fst $ unLoc $1) `snocOL` (mj AnnSemi $2),snd $ unLoc $1))
                              (h:t) -> do
                                { h' <- addTrailingSemiA h (gl $2)
-                               ; return $ sL1 $1 (fst $ unLoc $1,h':t) }}
+                               ; return $ sLZ $1 $> (fst $ unLoc $1,h':t) }}
         | stmt                   { $1 >>= \ $1 ->
                                    return $ sL1 $1 (nilOL,[$1]) }
         | {- empty -}            { return $ noLoc (nilOL,[]) }


=====================================
testsuite/tests/parser/should_compile/DumpSemis.stderr
=====================================
@@ -856,7 +856,7 @@
                    (EpaSpan { DumpSemis.hs:22:10-30 })
                    (AnnList
                     (Just
-                     (EpaSpan { DumpSemis.hs:22:12-25 }))
+                     (EpaSpan { DumpSemis.hs:22:12-28 }))
                     (Just
                      (AddEpAnn AnnOpenC (EpaSpan { DumpSemis.hs:22:10 })))
                     (Just


=====================================
testsuite/tests/printer/Makefile
=====================================
@@ -851,3 +851,8 @@ DataDeclShort:
 Test24749:
 	$(CHECK_PPR)   $(LIBDIR) Test24749.hs
 	$(CHECK_EXACT) $(LIBDIR) Test24749.hs
+
+.PHONY: Test24754
+Test24754:
+	$(CHECK_PPR)   $(LIBDIR) Test24754.hs
+	$(CHECK_EXACT) $(LIBDIR) Test24754.hs


=====================================
testsuite/tests/printer/Test24754.hs
=====================================
@@ -0,0 +1,4 @@
+module Test24754 where
+
+eh1  =  try (do return r;) <|> (do
+                return r)


=====================================
testsuite/tests/printer/all.T
=====================================
@@ -203,3 +203,4 @@ test('MatchPatComments', [ignore_stderr, req_ppr_deps], makefile_test, ['MatchPa
 test('Test24748', [ignore_stderr, req_ppr_deps], makefile_test, ['Test24748'])
 test('DataDeclShort', [ignore_stderr, req_ppr_deps], makefile_test, ['DataDeclShort'])
 test('Test24749', [ignore_stderr, req_ppr_deps], makefile_test, ['Test24749'])
+test('Test24754', [ignore_stderr, req_ppr_deps], makefile_test, ['Test24754'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7eab4e019205cfced90f06242a9afa23dfcaa70b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7eab4e019205cfced90f06242a9afa23dfcaa70b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240505/31c454c2/attachment-0001.html>


More information about the ghc-commits mailing list