diff options
| author | simonmar <unknown> | 1999-06-25 14:38:54 +0000 |
|---|---|---|
| committer | simonmar <unknown> | 1999-06-25 14:38:54 +0000 |
| commit | ea342fbcc2fe973f2a7026dcaa424c57adde30a0 (patch) | |
| tree | 822e72cfe70efe315529a8c7a0bc362d554ef62a | |
| parent | efeacd997b659e1bbd15fe9be4fdb018f5a99d54 (diff) | |
| download | haskell-ea342fbcc2fe973f2a7026dcaa424c57adde30a0.tar.gz | |
[project @ 1999-06-25 14:38:54 by simonmar]
'do' expressions must have a non-empty list of statements.
| -rw-r--r-- | ghc/compiler/parser/Parser.y | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 4d24d4c3e3..475534f139 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.6 1999/06/07 14:58:40 simonmar Exp $ +$Id: Parser.y,v 1.7 1999/06/25 14:38:54 simonmar Exp $ Haskell grammar. @@ -764,10 +764,13 @@ stmtlist :: { [RdrNameStmt] } | layout_on stmts close { reverse $2 } stmts :: { [RdrNameStmt] } - : stmts ';' stmt { $3 : $1 } - | stmts ';' { $1 } + : ';' stmts1 { $2 } + | stmts1 { $1 } + +stmts1 :: { [RdrNameStmt] } + : stmts1 ';' stmt { $3 : $1 } + | stmts1 ';' { $1 } | stmt { [$1] } - | {- empty -} { [] } stmt :: { RdrNameStmt } : srcloc infixexp '<-' exp {% checkPattern $2 `thenP` \p -> |
