Skip to content
Snippets Groups Projects
Commit 1f7cb525 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 1999-06-02 16:05:56 by simonmar]

Small grammar correction: 'x @ Rec{..}' should parse as 'x @
(Rec{..})'.
parent 62b87d58
No related branches found
No related tags found
No related merge requests found
{- {-
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
$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. Haskell grammar.
...@@ -34,7 +34,7 @@ import GlaExts ...@@ -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' 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) (shift parses as 'if x then y else (z + 1)', as per longest-parse rule)
...@@ -52,6 +52,10 @@ Conflicts: 13 shift/reduce ...@@ -52,6 +52,10 @@ Conflicts: 13 shift/reduce
This saves explicitly defining a grammar for the rule lhs that This saves explicitly defining a grammar for the rule lhs that
doesn't include 'forall'. 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 } ...@@ -662,7 +666,7 @@ aexp1 :: { RdrNameHsExpr }
| '[' list ']' { $2 } | '[' list ']' { $2 }
| '(' infixexp qop ')' { SectionL $2 $3 } | '(' infixexp qop ')' { SectionL $2 $3 }
| '(' qopm infixexp ')' { SectionR $2 $3 } | '(' qopm infixexp ')' { SectionR $2 $3 }
| qvar '@' aexp1 { EAsPat $1 $3 } | qvar '@' aexp { EAsPat $1 $3 }
| '_' { EWildPat } | '_' { EWildPat }
| '~' aexp1 { ELazyPat $2 } | '~' aexp1 { ELazyPat $2 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment