Changeset c1c920a9 in OpenModelica
- Timestamp:
- 2020-02-07T15:24:45+01:00 (4 years ago)
- Parents:
- de5194e
- git-author:
- Per Östlund <per.ostlund@…> (02/07/20 15:20:31)
- git-committer:
- Per Östlund <per.ostlund@…> (02/07/20 15:24:45)
- Location:
- OMCompiler/Compiler/NFFrontEnd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
OMCompiler/Compiler/NFFrontEnd/NFCeval.mo
rdf2744d rc1c920a9 1803 1803 1804 1804 case Call.TYPED_REDUCTION() 1805 then evalReduction(c.fn, c.exp, c. ty, c.iters);1805 then evalReduction(c.fn, c.exp, c.iters); 1806 1806 1807 1807 else … … 3157 3157 input Function fn; 3158 3158 input Expression exp; 3159 input Type ty;3160 3159 input list<tuple<InstNode, Expression>> iterators; 3161 3160 output Expression result; … … 3163 3162 result := evalExpPartial(exp); 3164 3163 result := Expression.bindingExpMap(result, 3165 function evalReduction2(fn = fn, ty = ty,iterators = iterators));3164 function evalReduction2(fn = fn, iterators = iterators)); 3166 3165 end evalReduction; 3167 3166 … … 3169 3168 input Function fn; 3170 3169 input Expression exp; 3171 input Type ty;3172 3170 input list<tuple<InstNode, Expression>> iterators; 3173 3171 output Expression result; … … 3177 3175 list<Mutable<Expression>> iters; 3178 3176 ReductionFn red_fn; 3177 Type ty; 3179 3178 algorithm 3180 3179 (e, ranges, iters) := createIterationRanges(exp, iterators); 3180 ty := Expression.typeOf(e); 3181 3181 3182 3182 (red_fn, default_exp) := match AbsynUtil.pathString(Function.name(fn)) -
OMCompiler/Compiler/NFFrontEnd/NFEvalFunction.mo
rdf2744d rc1c920a9 538 538 Mutable<Expression> var_ptr; 539 539 540 // variable := value 540 541 case (Expression.MUTABLE(exp = var_ptr), _) 541 542 algorithm … … 544 545 (); 545 546 547 // (var1, var2, ...) := (value1, value2, ...) 546 548 case (Expression.TUPLE(), Expression.TUPLE(elements = vals)) 547 549 algorithm … … 553 555 (); 554 556 557 // variable[subscript1, subscript2, ...] := value 555 558 case (Expression.SUBSCRIPTED_EXP(exp = Expression.MUTABLE(exp = var_ptr)), _) 556 559 algorithm … … 558 561 then 559 562 (); 563 564 // _ := value 565 case (Expression.CREF(cref = ComponentRef.WILD()), _) 566 then (); 560 567 561 568 else … … 630 637 case (Expression.ARRAY(), Subscript.WHOLE() :: rest_subs) 631 638 algorithm 632 if not listEmpty(rest_subs) then 639 if listEmpty(rest_subs) then 640 arrayExp.elements := Expression.arrayElements(value); 641 else 633 642 arrayExp.elements := list(assignArrayElement(e, rest_subs, v) threaded for 634 643 e in arrayExp.elements, v in Expression.arrayElements(value));
Note: See TracChangeset
for help on using the changeset viewer.