[project @ 1999-06-02 16:05:56 by simonmar]
authorsimonmar <unknown>
Wed, 2 Jun 1999 16:05:56 +0000 (16:05 +0000)
committersimonmar <unknown>
Wed, 2 Jun 1999 16:05:56 +0000 (16:05 +0000)
Small grammar correction: 'x @ Rec{..}' should parse as 'x @
(Rec{..})'.

ghc/compiler/parser/Parser.y

index 2e7eac9..4c29906 100644 (file)
@@ -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 }