Skip to content

Commit 587c82b

Browse files
committed
Handle some additional expressions
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20591 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent f654556 commit 587c82b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Compiler/FrontEnd/Expression.mo

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,14 @@ algorithm
16521652
Boolean bstart,bstop;
16531653
Integer istart,istep,istop;
16541654
Real rstart,rstep,rstop;
1655+
list<list<DAE.Exp>> matrix;
1656+
DAE.Type ty;
16551657
case DAE.ARRAY(array=es) then es;
1658+
case DAE.MATRIX(matrix=matrix,ty=ty)
1659+
equation
1660+
ty = Types.unliftArray(ty);
1661+
es = List.map2(matrix,makeArray,ty,not Types.arrayType(ty));
1662+
then es;
16561663
case DAE.RANGE(DAE.T_BOOL(varLst = _), DAE.BCONST(bstart), NONE(), DAE.BCONST(bstop))
16571664
then List.map(ExpressionSimplify.simplifyRangeBool(bstart, bstop), makeBoolExp);
16581665

@@ -2113,9 +2120,11 @@ algorithm
21132120
case (DAE.TSUB(ty = tp)) then tp;
21142121
case (DAE.CODE(ty = tp)) then tp;
21152122
/* array reduction with known size */
2116-
case (DAE.REDUCTION(iterators={DAE.REDUCTIONITER(exp=e,guardExp=NONE())},reductionInfo=DAE.REDUCTIONINFO(exprType=ty,path = Absyn.IDENT("array"))))
2123+
case (DAE.REDUCTION(iterators={DAE.REDUCTIONITER(exp=e,guardExp=NONE())},reductionInfo=DAE.REDUCTIONINFO(exprType=ty as DAE.T_ARRAY(dims=dim::_),path = Absyn.IDENT("array"))))
21172124
equation
2125+
false = dimensionKnown(dim);
21182126
DAE.T_ARRAY(dims={dim}) = typeof(e);
2127+
true = dimensionKnown(dim);
21192128
tp = liftArrayR(Types.unliftArray(Types.simplifyType(ty)),dim);
21202129
then tp;
21212130
case (DAE.REDUCTION(reductionInfo=DAE.REDUCTIONINFO(exprType=ty)))

0 commit comments

Comments
 (0)