Skip to content

Commit

Permalink
#2318 Use _ instead of {} in lhs of equations
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22700 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 9, 2014
1 parent f64b0b1 commit df3fc54
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Compiler/FrontEnd/Expression.mo
Expand Up @@ -10689,4 +10689,14 @@ algorithm
end match;
end renameExpCrefIdent;

public function emptyToWild
input DAE.Exp exp;
output DAE.Exp outExp;
protected
DAE.Type ty;
algorithm
ty := typeof(exp);
outExp := Util.if_(Types.isZeroLengthArray(ty),DAE.CREF(DAE.WILD(),ty),exp);
end emptyToWild;

end Expression;
14 changes: 11 additions & 3 deletions Compiler/FrontEnd/InstSection.mo
Expand Up @@ -1394,14 +1394,16 @@ protected function instEqEquation2
algorithm
outDae := matchcontinue (inExp1,inExp2,inType3, inConst, source,inInitial4)
local
DAE.DAElist dae; DAE.Exp e1,e2;
DAE.DAElist dae;
DAE.Exp e,e1,e2;
SCode.Initial initial_;
DAE.ComponentRef cr;
DAE.Type t;
list<DAE.Var> vs;
DAE.Type tt;
list<DAE.Exp> exps1,exps2;
list<DAE.Type> tys;
Boolean b;

case (e1,e2,DAE.T_INTEGER(varLst = _),_,_,initial_)
equation
Expand Down Expand Up @@ -1443,11 +1445,17 @@ algorithm
then dae;

// tuples
case (DAE.TUPLE(exps1),e2,DAE.T_TUPLE(tupleType = t::tys),_,_,initial_)
equation
exps1 = List.map(exps1,Expression.emptyToWild);
e1 = DAE.TUPLE(exps1);
dae = makeDaeEquation(e1, e2, source, initial_);
then dae;

case (e1,e2,DAE.T_TUPLE(tupleType = _),_,_,initial_)
equation
dae = makeDaeEquation(e1, e2, source, initial_);
then
dae;
then dae;

// MetaModelica types
case (e1,e2,DAE.T_METALIST(listType = _),_,_,initial_)
Expand Down

0 comments on commit df3fc54

Please sign in to comment.