summaryrefslogtreecommitdiff
path: root/ghc/compiler/parser/Parser.y
diff options
context:
space:
mode:
authorsimonmar <unknown>2000-11-07 15:21:43 +0000
committersimonmar <unknown>2000-11-07 15:21:43 +0000
commitbca9dd54c2b39638cb4638aaccf6015a104a1df5 (patch)
tree3e4bf1a2c5136b8de12a160c2ab3b211d82a7724 /ghc/compiler/parser/Parser.y
parentc8883ba060ec594b09c9d0bfdeeca1190b7f295c (diff)
downloadhaskell-bca9dd54c2b39638cb4638aaccf6015a104a1df5.tar.gz
[project @ 2000-11-07 15:21:38 by simonmar]
This commit completes the merge of compiler part of the HEAD with the before-ghci-branch to before-ghci-branch-merged.
Diffstat (limited to 'ghc/compiler/parser/Parser.y')
-rw-r--r--ghc/compiler/parser/Parser.y16
1 files changed, 13 insertions, 3 deletions
diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y
index fce6c581ef..779c235abe 100644
--- a/ghc/compiler/parser/Parser.y
+++ b/ghc/compiler/parser/Parser.y
@@ -1,6 +1,6 @@
{-
-----------------------------------------------------------------------------
-$Id: Parser.y,v 1.46 2000/10/31 17:30:17 simonpj Exp $
+$Id: Parser.y,v 1.47 2000/11/07 15:21:40 simonmar Exp $
Haskell grammar.
@@ -762,8 +762,14 @@ list :: { RdrNameHsExpr }
| exp ',' exp '..' { ArithSeqIn (FromThen $1 $3) }
| exp '..' exp { ArithSeqIn (FromTo $1 $3) }
| exp ',' exp '..' exp { ArithSeqIn (FromThenTo $1 $3 $5) }
- | exp srcloc '|' quals { HsDo ListComp (reverse
- (ReturnStmt $1 : $4)) $2 }
+ | exp srcloc pquals {% let { body [qs] = qs;
+ body qss = [ParStmt (map reverse qss)] }
+ in
+ returnP ( HsDo ListComp
+ (reverse (ReturnStmt $1 : body $3))
+ $2
+ )
+ }
lexps :: { [RdrNameHsExpr] }
: lexps ',' exp { $3 : $1 }
@@ -772,6 +778,10 @@ lexps :: { [RdrNameHsExpr] }
-----------------------------------------------------------------------------
-- List Comprehensions
+pquals :: { [[RdrNameStmt]] }
+ : pquals '|' quals { $3 : $1 }
+ | '|' quals { [$2] }
+
quals :: { [RdrNameStmt] }
: quals ',' qual { $3 : $1 }
| qual { [$1] }