aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnvg2001-05-30 14:58:19 +0000
committerjohnvg2001-05-30 14:58:19 +0000
commit9afc844ec8b0ae28a7aec6bbb77e02abf1e79531 (patch)
tree18627327dd88e88fcb0b214d7dce02a8b7a09e2c
parentdetect in 'postparse' when the definition module corresponding (diff)
in 'transform' of trans.icl also transform expressions in selections of an Update node
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@439 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/trans.icl17
1 files changed, 17 insertions, 0 deletions
diff --git a/frontend/trans.icl b/frontend/trans.icl
index 689a24c..6640d02 100644
--- a/frontend/trans.icl
+++ b/frontend/trans.icl
@@ -671,6 +671,22 @@ where
= transformSelection opt_type selectors expr ti
transform (Update expr1 selectors expr2) 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
= (Update expr1 selectors expr2,ti)
transform (RecordUpdate cons_symbol expr exprs) ro ti
@@ -2117,6 +2133,7 @@ transformApplication app [] ro ti
transformApplication app extra_args ro ti
= (App app @ extra_args, ti)
+transformSelection :: (Optional .(Global DefinedSymbol)) [Selection] Expression *TransformInfo -> (!Expression,!*TransformInfo)
transformSelection No s=:[RecordSelection _ field_index : selectors]
app=:(App {app_symb={symb_kind= SK_Constructor _ }, app_args, app_info_ptr})
ti=:{ti_symbol_heap}