This repository was archived by the owner on May 18, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -761,11 +761,14 @@ public
761761 input Operator op;
762762 output Expression outExp;
763763 output Boolean expanded;
764+ protected
765+ Operator scalar_op;
764766 algorithm
765767 (outExp, expanded) := expand(exp);
768+ scalar_op := Operator . scalarize(op);
766769
767770 if expanded then
768- outExp := Expression . mapArrayElements(outExp, function makeUnaryOp(op = op ));
771+ outExp := Expression . mapArrayElements(outExp, function makeUnaryOp(op = scalar_op ));
769772 end if ;
770773 end expandUnary;
771774
@@ -815,11 +818,14 @@ public
815818 input Operator op;
816819 output Expression outExp;
817820 output Boolean expanded;
821+ protected
822+ Operator scalar_op;
818823 algorithm
819824 (outExp, expanded) := expand(exp);
825+ scalar_op := Operator . scalarize(op);
820826
821827 if expanded then
822- outExp := Expression . mapArrayElements(outExp, function makeLogicalUnaryOp(op = op ));
828+ outExp := Expression . mapArrayElements(outExp, function makeLogicalUnaryOp(op = scalar_op ));
823829 else
824830 outExp := exp;
825831 end if ;
Original file line number Diff line number Diff line change @@ -195,6 +195,12 @@ public
195195 op. ty := ty;
196196 end setType;
197197
198+ function scalarize
199+ input output Operator op;
200+ algorithm
201+ op. ty := Type . arrayElementType(op. ty);
202+ end scalarize;
203+
198204 function symbol
199205 input Operator op;
200206 input String spacing = " " ;
You can’t perform that action at this time.
0 commit comments