From cf45ed4d1eb7ac250a124504415921535c1224de Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 26 Nov 2003 10:07:19 +0000 Subject: [PATCH] [project @ 2003-11-26 10:07:19 by simonmar] Haskell 98 doesn't allow extra commas in record construction/update, so neither should GHC. --- ghc/compiler/parser/Parser.y | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 68cc7ea..9333122 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- -*-haskell-*- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.129 2003/11/06 17:09:53 simonpj Exp $ +$Id: Parser.y,v 1.130 2003/11/26 10:07:19 simonmar Exp $ Haskell grammar. @@ -951,7 +951,7 @@ aexp :: { RdrNameHsExpr } | aexp1 { $1 } aexp1 :: { RdrNameHsExpr } - : aexp1 '{' fbinds '}' {% (mkRecConstrOrUpdate $1 (reverse $3)) } + : aexp1 '{' fbinds '}' {% (mkRecConstrOrUpdate $1 (reverse $3)) } | aexp2 { $1 } -- Here was the syntax for type applications that I was planning @@ -1148,12 +1148,14 @@ qual :: { RdrNameStmt } ----------------------------------------------------------------------------- -- Record Field Update/Construction -fbinds :: { RdrNameHsRecordBinds } - : fbinds ',' fbind { $3 : $1 } - | fbinds ',' { $1 } - | fbind { [$1] } +fbinds :: { RdrNameHsRecordBinds } + : fbinds1 { $1 } | {- empty -} { [] } +fbinds1 :: { RdrNameHsRecordBinds } + : fbinds1 ',' fbind { $3 : $1 } + | fbind { [$1] } + fbind :: { (RdrName, RdrNameHsExpr) } : qvar '=' exp { ($1,$3) } -- 1.7.10.4