Commit 5cd0c5da authored by John van Groningen's avatar John van Groningen
Browse files

make elements of array generators unique (for arrays with unique elements)

by using a unique selection with unique result, instead of "uselect"
parent e6be5c66
......@@ -440,7 +440,6 @@ transformGenerator {gen_kind=IsArrayGenerator, gen_expr, gen_pattern, gen_positi
less_or_equal = get_predef_id PD_LessOrEqualFun
sub = get_predef_id PD_SubFun
usize = get_predef_id PD_UnqArraySizeFun
uselect = get_predef_id PD_UnqArraySelectFun
pattern = PE_Tuple [gen_pattern, array]
= case index_generator of
No
......@@ -453,7 +452,7 @@ transformGenerator {gen_kind=IsArrayGenerator, gen_expr, gen_pattern, gen_positi
, tg_lhs_arg = [i, n, array]
, tg_case_end_expr = PE_List [i,PE_Ident less_or_equal, n]
, tg_case_end_pattern = PE_Basic (BVB True)
, tg_element = PE_List [PE_Ident uselect, array, i]
, tg_element = PE_Selection (ParsedUniqueSelector True) array [PS_Array i]
, tg_element_is_uselect=True
, tg_pattern = pattern
, tg_rhs_continuation = [PE_List [PE_Ident inc, i], n, array]
......@@ -469,7 +468,7 @@ transformGenerator {gen_kind=IsArrayGenerator, gen_expr, gen_pattern, gen_positi
, tg_lhs_arg = [n,array]
, tg_case_end_expr = PE_List [i,PE_Ident less_or_equal, n]
, tg_case_end_pattern = PE_Basic (BVB True)
, tg_element = PE_List [PE_Ident uselect, array, i]
, tg_element = PE_Selection (ParsedUniqueSelector True) array [PS_Array i]
, tg_element_is_uselect=True
, tg_pattern = pattern
, tg_rhs_continuation = [n,array]
......@@ -482,7 +481,7 @@ transformGenerator {gen_kind=IsArrayGenerator, gen_expr, gen_pattern, gen_positi
, tg_lhs_arg = [array]
, tg_case_end_expr = PE_Empty
, tg_case_end_pattern = PE_Empty
, tg_element = PE_List [PE_Ident uselect, array, i]
, tg_element = PE_Selection (ParsedUniqueSelector True) array [PS_Array i]
, tg_element_is_uselect=True
, tg_pattern = pattern
, tg_rhs_continuation = [array]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment