Commit eee9cb91 authored by John van Groningen's avatar John van Groningen
Browse files

convert record updates of multiple records into one update node

parent 3d41fb40
...@@ -1858,19 +1858,18 @@ where ...@@ -1858,19 +1858,18 @@ where
addKinds _ [] addKinds _ []
= [] = []
convertExpr (RecordUpdate _ expr updates) convertExpr (RecordUpdate _ expr updates)
= foldl (convertUpdate) (convertExpr expr) updates = beUpdateNode (beArgs (convertExpr expr) (convertUpdates updates))
where where
convertUpdate expr {bind_src=NoBind _} convertUpdates []
= expr = beNoArgs
convertUpdate expr {bind_src, bind_dst=bind_dst=:{glob_module, glob_object={fs_index}}} convertUpdates [{bind_src=NoBind _}:updates]
= beUpdateNode = convertUpdates updates
(beArgs convertUpdates [{bind_src, bind_dst=bind_dst=:{glob_module, glob_object={fs_index}}}:updates]
expr = (beArgs
(beArgs (beSelectorNode BESelector (beFieldSymbol fs_index glob_module)
(beSelectorNode BESelector (beFieldSymbol fs_index glob_module) (beArgs (convertExpr bind_src)
(beArgs (convertExpr bind_src) beNoArgs))
beNoArgs)) (convertUpdates updates))
beNoArgs))
convertExpr (Update expr1 [singleSelection] expr2) convertExpr (Update expr1 [singleSelection] expr2)
= case singleSelection of = case singleSelection of
RecordSelection _ _ RecordSelection _ _
......
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