diff options
author | simonmar <unknown> | 2000-11-07 15:21:43 +0000 |
---|---|---|
committer | simonmar <unknown> | 2000-11-07 15:21:43 +0000 |
commit | bca9dd54c2b39638cb4638aaccf6015a104a1df5 (patch) | |
tree | 3e4bf1a2c5136b8de12a160c2ab3b211d82a7724 /ghc/compiler/parser | |
parent | c8883ba060ec594b09c9d0bfdeeca1190b7f295c (diff) | |
download | haskell-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')
-rw-r--r-- | ghc/compiler/parser/Parser.y | 16 | ||||
-rw-r--r-- | ghc/compiler/parser/RdrHsSyn.lhs | 2 |
2 files changed, 13 insertions, 5 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] } diff --git a/ghc/compiler/parser/RdrHsSyn.lhs b/ghc/compiler/parser/RdrHsSyn.lhs index 54e940879f..8870c14389 100644 --- a/ghc/compiler/parser/RdrHsSyn.lhs +++ b/ghc/compiler/parser/RdrHsSyn.lhs @@ -160,8 +160,6 @@ extract_ty (HsListTy ty) acc = extract_ty ty acc extract_ty (HsTupleTy _ tys) acc = foldr extract_ty acc tys extract_ty (HsFunTy ty1 ty2) acc = extract_ty ty1 (extract_ty ty2 acc) extract_ty (HsPredTy p) acc = extract_pred p acc -extract_ty (HsUsgTy usg ty) acc = extract_ty ty acc -extract_ty (HsUsgForAllTy uv ty) acc = extract_ty ty acc extract_ty (HsTyVar tv) acc = tv : acc extract_ty (HsForAllTy Nothing ctxt ty) acc = extract_ctxt ctxt (extract_ty ty acc) -- Generics |