diff options
author | simonmar <unknown> | 1999-06-30 11:29:53 +0000 |
---|---|---|
committer | simonmar <unknown> | 1999-06-30 11:29:53 +0000 |
commit | cc02bb851921a07a83006988c5bc19b72a3f9049 (patch) | |
tree | 3f2c868e9592489a12da57a6bb604b537081c00f /ghc/compiler/parser/Parser.y | |
parent | 181da0c3e14dc2794f1a68766fc2c46c8948f527 (diff) | |
download | haskell-cc02bb851921a07a83006988c5bc19b72a3f9049.tar.gz |
[project @ 1999-06-30 11:29:53 by simonmar]
Allow the following (not strictly H98) construct:
do
blah
e $ do
blah
This doesn't break any existing code, just allows more programs
through. Only the semantics for layout after a 'do' have changed.
Diffstat (limited to 'ghc/compiler/parser/Parser.y')
-rw-r--r-- | ghc/compiler/parser/Parser.y | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ghc/compiler/parser/Parser.y b/ghc/compiler/parser/Parser.y index 3348da9d3c..ef83b5e295 100644 --- a/ghc/compiler/parser/Parser.y +++ b/ghc/compiler/parser/Parser.y @@ -1,6 +1,6 @@ {- ----------------------------------------------------------------------------- -$Id: Parser.y,v 1.9 1999/06/28 16:42:23 simonmar Exp $ +$Id: Parser.y,v 1.10 1999/06/30 11:29:53 simonmar Exp $ Haskell grammar. @@ -760,8 +760,8 @@ gdpat :: { RdrNameGRHS } -- Statement sequences stmtlist :: { [RdrNameStmt] } - : '{' stmts '}' { reverse $2 } - | layout_on stmts close { reverse $2 } + : '{' stmts '}' { reverse $2 } + | layout_on_for_do stmts close { reverse $2 } stmts :: { [RdrNameStmt] } : ';' stmts1 { $2 } @@ -949,7 +949,8 @@ close :: { () } : vccurly { () } -- context popped in lexer. | error {% popContext } -layout_on :: { () } : {% layoutOn } +layout_on :: { () } : {% layoutOn True{-strict-} } +layout_on_for_do :: { () } : {% layoutOn False } ----------------------------------------------------------------------------- -- Miscellaneous (mostly renamings) |