aboutsummaryrefslogtreecommitdiff
path: root/frontend/postparse.icl
diff options
context:
space:
mode:
authorjohnvg2004-12-14 13:28:09 +0000
committerjohnvg2004-12-14 13:28:09 +0000
commit02e1da7ec11670110dbca3f3971586566261ede3 (patch)
tree03cb161f1f4633d9f1a6a09e63f9e8c972eab643 /frontend/postparse.icl
parentfix conversion of selection (pattern match in lhs of where or let) (diff)
remove workaround for a bug in Clean 2.0, that seems to have been fixed already
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1503 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/postparse.icl')
-rw-r--r--frontend/postparse.icl13
1 files changed, 0 insertions, 13 deletions
diff --git a/frontend/postparse.icl b/frontend/postparse.icl
index a440111..244d62c 100644
--- a/frontend/postparse.icl
+++ b/frontend/postparse.icl
@@ -964,23 +964,10 @@ makeComprehensions [{tq_generators, tq_filter, tq_end, tq_call, tq_lhs_args, tq_
case_with_default case_ident expr expr_is_uselect pattern=:(PE_Ident ident) rhs=:{rhs_alts=UnGuardedExpr ung_exp=:{ewl_nodes,ewl_expr,ewl_locals=LocalParsedDefs [],ewl_position},rhs_locals=LocalParsedDefs []} default_rhs
# new_node={ndwl_strict=False,ndwl_def={bind_src=expr,bind_dst=pattern},ndwl_locals=LocalParsedDefs [],ndwl_position=ewl_position}
= {rhs & rhs_alts=UnGuardedExpr {ung_exp & ewl_nodes=[new_node:ewl_nodes]}}
-/* Clean 2.0 generates incorrect code for:
case_with_default case_ident expr expr_is_uselect=:True pattern=:(PE_Tuple [PE_Ident ident1,ident2_exp=:PE_Ident ident2]) rhs=:{rhs_alts=UnGuardedExpr ung_exp=:{ewl_nodes,ewl_expr,ewl_locals=LocalParsedDefs [],ewl_position},rhs_locals=LocalParsedDefs []} default_rhs
# new_node1={ndwl_strict=False,ndwl_def={bind_src=expr,bind_dst=pattern},ndwl_locals=LocalParsedDefs [],ndwl_position=ewl_position}
# new_node2={ndwl_strict=True,ndwl_def={bind_src=ident2_exp,bind_dst=ident2_exp},ndwl_locals=LocalParsedDefs [],ndwl_position=ewl_position}
= {rhs & rhs_alts=UnGuardedExpr {ung_exp & ewl_nodes=[new_node1,new_node2:ewl_nodes]}}
- we therefore use:
-*/
- case_with_default case_ident expr expr_is_uselect pattern=:(PE_Tuple [PE_Ident ident1,ident2_exp=:PE_Ident ident2]) rhs=:{rhs_alts=UnGuardedExpr ung_exp=:{ewl_nodes,ewl_expr,ewl_locals=LocalParsedDefs [],ewl_position},rhs_locals=LocalParsedDefs []} default_rhs
- | expr_is_uselect
- # new_node1={ndwl_strict=False,ndwl_def={bind_src=expr,bind_dst=pattern},ndwl_locals=LocalParsedDefs [],ndwl_position=ewl_position}
- # new_node2={ndwl_strict=True,ndwl_def={bind_src=ident2_exp,bind_dst=ident2_exp},ndwl_locals=LocalParsedDefs [],ndwl_position=ewl_position}
- = {rhs & rhs_alts=UnGuardedExpr {ung_exp & ewl_nodes=[new_node1,new_node2:ewl_nodes]}}
- = exprToRhs (PE_Case case_ident expr
- [ {calt_pattern = pattern, calt_rhs = rhs}
- , {calt_pattern = PE_WildCard, calt_rhs = exprToRhs default_rhs}
- ])
-/**/
case_with_default case_ident expr expr_is_uselect PE_Empty rhs default_rhs
= rhs
case_with_default case_ident expr expr_is_uselect pattern rhs default_rhs