summaryrefslogtreecommitdiff
path: root/compiler/cmm
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-10-22 14:34:00 +0000
committersimonpj@microsoft.com <unknown>2010-10-22 14:34:00 +0000
commit4e0c994eb1613c62e94069642d7acdb2e69b773b (patch)
tree2cafc28f98f8a22d34642bece27b2294cbdbafc8 /compiler/cmm
parent79723c6692289fd01a2d0548d03a6547eae41ecb (diff)
downloadhaskell-4e0c994eb1613c62e94069642d7acdb2e69b773b.tar.gz
Add rebindable syntax for if-then-else
There are two main changes * New LANGUAGE option RebindableSyntax, which implies NoImplicitPrelude * if-the-else becomes rebindable, with function name "ifThenElse" (but case expressions are unaffected) Thanks to Sam Anklesaria for doing most of the work here
Diffstat (limited to 'compiler/cmm')
-rw-r--r--compiler/cmm/CmmParse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y
index 33a4b809d8..aaa7c42813 100644
--- a/compiler/cmm/CmmParse.y
+++ b/compiler/cmm/CmmParse.y
@@ -411,7 +411,7 @@ stmt :: { ExtCode }
| 'return' maybe_actuals ';'
{ do e <- sequence $2; stmtEC (CmmReturn e) }
| 'if' bool_expr '{' body '}' else
- { ifThenElse $2 $4 $6 }
+ { cmmIfThenElse $2 $4 $6 }
opt_never_returns :: { CmmReturnInfo }
: { CmmMayReturn }
@@ -947,7 +947,7 @@ data BoolExpr
-- ToDo: smart constructors which simplify the boolean expression.
-ifThenElse cond then_part else_part = do
+cmmIfThenElse cond then_part else_part = do
then_id <- code newLabelC
join_id <- code newLabelC
c <- cond