From 1f7cb525d8e0039ef03beaea84836f8d0640781b Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 2 Jun 1999 16:05:56 +0000 Subject: [PATCH] [project @ 1999-06-02 16:05:56 by simonmar] Small grammar correction: 'x @ Rec{..}' should parse as 'x @ (Rec{..})'. --- ghc/compiler/parser/Parser.y | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 2e7eac9..4c29906 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.3 1999/06/02 15:50:25 simonmar Exp $ +$Id: Parser.y,v 1.4 1999/06/02 16:05:56 simonmar Exp $ Haskell grammar. @@ -34,7 +34,7 @@ import GlaExts {- ----------------------------------------------------------------------------- -Conflicts: 13 shift/reduce +Conflicts: 14 shift/reduce 8 for abiguity in 'if x then y else z + 1' (shift parses as 'if x then y else (z + 1)', as per longest-parse rule) @@ -52,6 +52,10 @@ Conflicts: 13 shift/reduce This saves explicitly defining a grammar for the rule lhs that doesn't include 'forall'. +1 for ambiguity in 'x @ Rec{..}'. + Only sensible parse is 'x @ (Rec{..})', which is what resolving + to shift gives us. + ----------------------------------------------------------------------------- -} @@ -662,7 +666,7 @@ aexp1 :: { RdrNameHsExpr } | '[' list ']' { $2 } | '(' infixexp qop ')' { SectionL $2 $3 } | '(' qopm infixexp ')' { SectionR $2 $3 } - | qvar '@' aexp1 { EAsPat $1 $3 } + | qvar '@' aexp { EAsPat $1 $3 } | '_' { EWildPat } | '~' aexp1 { ELazyPat $2 } -- 1.7.10.4