diff options
author | johnvg | 2013-11-04 16:22:41 +0000 |
---|---|---|
committer | johnvg | 2013-11-04 16:22:41 +0000 |
commit | ecc2d455e4f66755fb4a82de63b08373ae351dd0 (patch) | |
tree | 7a75bb3aec1875bf79654219bef1421639cef3e7 /frontend | |
parent | remove unused argument ca and result of functions: (diff) |
fix comprehensions with a non lower case identifier as pattern,
for example: [0 \\ [] <- [[]]]
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2317 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/postparse.icl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/postparse.icl b/frontend/postparse.icl index 3f09591..f1dd0ed 100644 --- a/frontend/postparse.icl +++ b/frontend/postparse.icl @@ -948,8 +948,9 @@ makeComprehensions [{tq_generators,tq_let_defs,tq_filter, tq_end, tq_call, tq_lh case_with_default :: Ident ParsedExpr Bool ParsedExpr Rhs ParsedExpr -> Rhs 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]}} + | isLowerCaseName ident.id_name + # 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]}} case_with_default case_ident expr 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} |