[Git][ghc/ghc][master] EPA: Preserve comments for pattern synonym sig

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat May 4 00:54:01 UTC 2024



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


Commits:
bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00
EPA: Preserve comments for pattern synonym sig

Closes #24749

- - - - -


4 changed files:

- compiler/GHC/Parser.y
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/Test24749.hs
- testsuite/tests/printer/all.T


Changes:

=====================================
compiler/GHC/Parser.y
=====================================
@@ -2653,7 +2653,7 @@ sigdecl :: { LHsDecl GhcPs }
                                     (Fixity fixText fixPrec (unLoc $1)))))
                    }}
 
-        | pattern_synonym_sig   { sL1a $1 . SigD noExtField . unLoc $ $1 }
+        | pattern_synonym_sig   { L (getLoc $1) . SigD noExtField . unLoc $ $1 }
 
         | '{-# COMPLETE' qcon_list opt_tyconsig  '#-}'
                 {% let (dcolon, tc) = $3


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


=====================================
testsuite/tests/printer/Test24749.hs
=====================================
@@ -0,0 +1,11 @@
+{-# LANGUAGE PatternSynonyms #-}
+module Test24749 where
+
+-- c0
+pattern (:|) ::
+  -- c1
+  a ->
+  -- c2
+  a ->
+  -- c3
+  Domino a


=====================================
testsuite/tests/printer/all.T
=====================================
@@ -202,3 +202,4 @@ test('CaseAltComments', [ignore_stderr, req_ppr_deps], makefile_test, ['CaseAltC
 test('MatchPatComments', [ignore_stderr, req_ppr_deps], makefile_test, ['MatchPatComments'])
 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'])



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/bf3d4db0894233ec72f092a4a34bce9ed4ff4e21
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/20240503/51e73337/attachment-0001.html>


More information about the ghc-commits mailing list