From 21fd2310c1671a596d39cbe336929c6eebeca566 Mon Sep 17 00:00:00 2001
From: Takano Akio <aljee@hyper.cx>
Date: Wed, 15 Aug 2012 14:07:20 +0900
Subject: [PATCH] Parser: allow a field binding to have a texp

This allows placing a view pattern or a bang pattern
directly inside a record pattern. For example,

data Rec = Rec { fld :: Int }
f Rec{ fld = !x } = x
g Rec{ fld = show -> y } = y
---
 compiler/parser/Parser.y.pp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 6c19812..0fa2c40 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1752,10 +1752,10 @@ fbinds1 :: { ([HsRecField RdrName (LHsExpr RdrName)], Bool) }
         | '..'                          { ([],   True) }
   
 fbind   :: { HsRecField RdrName (LHsExpr RdrName) }
-        : qvar '=' exp  { HsRecField $1 $3                False }
-        | qvar          { HsRecField $1 placeHolderPunRhs True }
-                        -- In the punning case, use a place-holder
-                        -- The renamer fills in the final value
+        : qvar '=' texp  { HsRecField $1 $3                False }
+        | qvar           { HsRecField $1 placeHolderPunRhs True }
+                         -- In the punning case, use a place-holder
+                         -- The renamer fills in the final value
 
 -----------------------------------------------------------------------------
 -- Implicit Parameter Bindings
-- 
1.7.1

