summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax/Expr.hs
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2021-04-01 21:51:17 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-23 18:53:50 -0400
commitf8c6fce4a09762adea6009540e523c2b984b2978 (patch)
treefb0898eadf884f4320e5a05f783f6308663350e9 /compiler/Language/Haskell/Syntax/Expr.hs
parentd82d38239f232c3970a8641bb6d47d436e3cbc11 (diff)
downloadhaskell-f8c6fce4a09762adea6009540e523c2b984b2978.tar.gz
HsToken for HsPar, ParPat, HsCmdPar (#19523)
This patch is a first step towards a simpler design for exact printing.
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Expr.hs')
-rw-r--r--compiler/Language/Haskell/Syntax/Expr.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/Language/Haskell/Syntax/Expr.hs b/compiler/Language/Haskell/Syntax/Expr.hs
index 6f5150a1b4..b4d7b24dea 100644
--- a/compiler/Language/Haskell/Syntax/Expr.hs
+++ b/compiler/Language/Haskell/Syntax/Expr.hs
@@ -404,7 +404,9 @@ data HsExpr p
-- For details on above see note [exact print annotations] in GHC.Parser.Annotation
| HsPar (XPar p)
+ !(LHsToken "(" p)
(LHsExpr p) -- ^ Parenthesised expr; see Note [Parens in HsSyn]
+ !(LHsToken ")" p)
| SectionL (XSectionL p)
(LHsExpr p) -- operand; see Note [Sections in HsSyn]
@@ -928,7 +930,9 @@ data HsCmd id
-- For details on above see note [exact print annotations] in GHC.Parser.Annotation
| HsCmdPar (XCmdPar id)
+ !(LHsToken "(" id)
(LHsCmd id) -- parenthesised command
+ !(LHsToken ")" id)
-- ^ - 'GHC.Parser.Annotation.AnnKeywordId' : 'GHC.Parser.Annotation.AnnOpen' @'('@,
-- 'GHC.Parser.Annotation.AnnClose' @')'@