summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-12-22 13:22:10 +0000
committersimonpj@microsoft.com <unknown>2010-12-22 13:22:10 +0000
commitba05282d3915e7051b3f016366b971a8506b0093 (patch)
tree05d423503e37522664a2db87d9585e9fc63ed565 /compiler/parser
parent16dd51fb989fa0fe10f04da19f9724ff31838470 (diff)
downloadhaskell-ba05282d3915e7051b3f016366b971a8506b0093.tar.gz
Tidy up rebindable syntax for MDo
For a long time an 'mdo' expression has had a SyntaxTable attached to it. However, we're busy deprecating SyntaxTables in favour of rebindable syntax attached to individual Stmts, and MDoExpr was totally inconsistent with DoExpr in this regard. This patch tidies it all up. Now there's no SyntaxTable on MDoExpr, and 'modo' is generally handled much more like 'do'. There is resulting small change in behaviour: now MonadFix is required only if you actually *use* recursion in mdo. This seems consistent with the implicit dependency analysis that is done for mdo. Still to do: * Deal with #4148 (this patch is on the way) * Get rid of the last remaining SyntaxTable on HsCmdTop
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y.pp4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 98599498ae..a0cc96417c 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1284,7 +1284,9 @@ exp10 :: { LHsExpr RdrName }
return (L loc (mkHsDo DoExpr stmts body)) }
| 'mdo' stmtlist {% let loc = comb2 $1 $2 in
checkDo loc (unLoc $2) >>= \ (stmts,body) ->
- return (L loc (mkHsDo (MDoExpr noPostTcTable) stmts body)) }
+ return (L loc (mkHsDo MDoExpr
+ [L loc (mkRecStmt stmts)]
+ body)) }
| scc_annot exp { LL $ if opt_SccProfilingOn
then HsSCC (unLoc $1) $2
else HsPar $2 }