Commit 5606454b authored by John van Groningen's avatar John van Groningen
Browse files

in 'transform' of trans.icl also transform expressions in selections of an Update node

parent 5f4c1e3e
...@@ -671,6 +671,22 @@ where ...@@ -671,6 +671,22 @@ where
= transformSelection opt_type selectors expr ti = transformSelection opt_type selectors expr ti
transform (Update expr1 selectors expr2) ro ti transform (Update expr1 selectors expr2) ro ti
# (expr1,ti) = transform expr1 ro ti # (expr1,ti) = transform expr1 ro ti
# (selectors,ti) = transform_expressions_in_selectors selectors ti
with
transform_expressions_in_selectors [selection=:RecordSelection _ _ : selections] ti
# (selections,ti) = transform_expressions_in_selectors selections ti
= ([selection:selections],ti)
transform_expressions_in_selectors [ArraySelection ds ep expr : selections] ti
# (expr,ti) = transform expr ro ti
# (selections,ti) = transform_expressions_in_selectors selections ti
= ([ArraySelection ds ep expr:selections],ti)
transform_expressions_in_selectors [DictionarySelection bv dictionary_selections ep expr : selections] ti
# (expr,ti) = transform expr ro ti
# (dictionary_selections,ti) = transform_expressions_in_selectors dictionary_selections ti
# (selections,ti) = transform_expressions_in_selectors selections ti
= ([DictionarySelection bv dictionary_selections ep expr:selections],ti)
transform_expressions_in_selectors [] ti
= ([],ti)
# (expr2,ti) = transform expr2 ro ti # (expr2,ti) = transform expr2 ro ti
= (Update expr1 selectors expr2,ti) = (Update expr1 selectors expr2,ti)
transform (RecordUpdate cons_symbol expr exprs) ro ti transform (RecordUpdate cons_symbol expr exprs) ro ti
...@@ -2117,6 +2133,7 @@ transformApplication app [] ro ti ...@@ -2117,6 +2133,7 @@ transformApplication app [] ro ti
transformApplication app extra_args ro ti transformApplication app extra_args ro ti
= (App app @ extra_args, ti) = (App app @ extra_args, ti)
transformSelection :: (Optional .(Global DefinedSymbol)) [Selection] Expression *TransformInfo -> (!Expression,!*TransformInfo)
transformSelection No s=:[RecordSelection _ field_index : selectors] transformSelection No s=:[RecordSelection _ field_index : selectors]
app=:(App {app_symb={symb_kind= SK_Constructor _ }, app_args, app_info_ptr}) app=:(App {app_symb={symb_kind= SK_Constructor _ }, app_args, app_info_ptr})
ti=:{ti_symbol_heap} ti=:{ti_symbol_heap}
......
Supports Markdown
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