Skip to content

Commit 12a5593

Browse files
Jan ŠilarOpenModelica-Hudson
authored andcommitted
Option<ComponentRef> domainOpt; added to SCode.EQ_EQUALS.
Subsequent changes.
1 parent bf029a0 commit 12a5593

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

Compiler/FrontEnd/InstBinding.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ algorithm
551551
lhs := Expression.makeCrefExp(inComponentRef, t);
552552
acr := ComponentReference.unelabCref(inComponentRef);
553553
aexp1 := Absyn.CREF(acr);
554-
scode := SCode.EQ_EQUALS(aexp1,aexp2,SCode.noComment,info);
554+
scode := SCode.EQ_EQUALS(aexp1,aexp2,NONE(),SCode.noComment,info);
555555
source := DAEUtil.addSymbolicTransformation(inSource,DAE.FLATTEN(scode,NONE()));
556556
dae := InstSection.instEqEquation(lhs, DAE.PROP(inType,DAE.C_VAR()), e, prop2, source, SCode.NON_INITIAL(), inImpl);
557557
then

Compiler/FrontEnd/InstExtends.mo

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,11 +1230,17 @@ algorithm
12301230
(cache,eqll) = fixListList(cache,env,eqll,ht,fixEEquation);
12311231
(cache,eql) = fixList(cache,env,eql,ht,fixEEquation);
12321232
then (cache,SCode.EQ_IF(expl,eqll,eql,comment,info));
1233-
case (cache,env,SCode.EQ_EQUALS(exp1,exp2,comment,info),ht)
1233+
case (cache,env,SCode.EQ_EQUALS(exp1,exp2,NONE(),comment,info),ht)
12341234
equation
12351235
(cache,exp1) = fixExp(cache,env,exp1,ht);
12361236
(cache,exp2) = fixExp(cache,env,exp2,ht);
1237-
then (cache,SCode.EQ_EQUALS(exp1,exp2,comment,info));
1237+
then (cache,SCode.EQ_EQUALS(exp1,exp2,NONE(),comment,info));
1238+
case (cache,env,SCode.EQ_EQUALS(exp1,exp2,SOME(cref),comment,info),ht)
1239+
equation
1240+
(cache,exp1) = fixExp(cache,env,exp1,ht);
1241+
(cache,exp2) = fixExp(cache,env,exp2,ht);
1242+
(cache,cref) = fixCref(cache,env,cref,ht);
1243+
then (cache,SCode.EQ_EQUALS(exp1,exp2,SOME(cref),comment,info));
12381244
case (cache,env,SCode.EQ_CONNECT(cref1,cref2,comment,info),ht)
12391245
equation
12401246
(cache,cref1) = fixCref(cache,env,cref1,ht);

Compiler/FrontEnd/SCode.mo

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ uniontype EEquation
270270
record EQ_EQUALS "the equality equation"
271271
Absyn.Exp expLeft "the expression on the left side of the operator";
272272
Absyn.Exp expRight "the expression on the right side of the operator";
273+
Option<Absyn.ComponentRef> domainOpt "domain for PDEs" ;
273274
Comment comment;
274275
SourceInfo info;
275276
end EQ_EQUALS;
@@ -1460,13 +1461,21 @@ algorithm
14601461
then
14611462
true;
14621463

1463-
case(EQ_EQUALS(expLeft = e11, expRight = e12),EQ_EQUALS(expLeft = e21, expRight = e22))
1464+
case(EQ_EQUALS(expLeft = e11, expRight = e12, domainOpt = NONE()),EQ_EQUALS(expLeft = e21, expRight = e22, domainOpt = NONE()))
14641465
equation
14651466
true = Absyn.expEqual(e11,e21);
14661467
true = Absyn.expEqual(e12,e22);
14671468
then
14681469
true;
14691470

1471+
case(EQ_EQUALS(expLeft = e11, expRight = e12, domainOpt = SOME(cr1)),EQ_EQUALS(expLeft = e21, expRight = e22, domainOpt = SOME(cr2)))
1472+
equation
1473+
true = Absyn.expEqual(e11,e21);
1474+
true = Absyn.expEqual(e12,e22);
1475+
true = Absyn.crefEqual(cr1,cr2);
1476+
then
1477+
true;
1478+
14701479
case(EQ_CONNECT(crefLeft = cr11, crefRight = cr12),EQ_CONNECT(crefLeft = cr21, crefRight = cr22))
14711480
equation
14721481
true = Absyn.crefEqual(cr11,cr21);
@@ -2557,19 +2566,20 @@ algorithm
25572566
SourceInfo info;
25582567
Absyn.ComponentRef cr1, cr2;
25592568
Ident index;
2569+
Option<Absyn.ComponentRef> domainOpt;
25602570

25612571
case (EQ_IF(expl1, then_branch, else_branch, comment, info), traverser, arg)
25622572
equation
25632573
(expl1, arg) = Absyn.traverseExpList(expl1, traverser, arg);
25642574
then
25652575
(EQ_IF(expl1, then_branch, else_branch, comment, info), arg);
25662576

2567-
case (EQ_EQUALS(e1, e2, comment, info), traverser, arg)
2577+
case (EQ_EQUALS(e1, e2, domainOpt, comment, info), traverser, arg)
25682578
equation
25692579
(e1, arg) = traverser(e1, arg);
25702580
(e2, arg) = traverser(e2, arg);
25712581
then
2572-
(EQ_EQUALS(e1, e2, comment, info), arg);
2582+
(EQ_EQUALS(e1, e2, domainOpt, comment, info), arg);
25732583

25742584
case (EQ_CONNECT(cr1, cr2, comment, info), _, _)
25752585
equation

Compiler/FrontEnd/SCodeUtil.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,7 @@ algorithm
16401640
SCode.EQ_WHEN(inEquation.whenExp, body, branches, inComment, inInfo);
16411641

16421642
case Absyn.EQ_EQUALS()
1643-
then SCode.EQ_EQUALS(inEquation.leftSide, inEquation.rightSide, inComment, inInfo);
1643+
then SCode.EQ_EQUALS(inEquation.leftSide, inEquation.rightSide, inEquation.domainOpt, inComment, inInfo);
16441644

16451645
case Absyn.EQ_CONNECT()
16461646
algorithm

Compiler/Template/SCodeTV.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ package SCode
486486
record EQ_EQUALS
487487
Absyn.Exp expLeft;
488488
Absyn.Exp expRight;
489+
Option<ComponentRef> domainOpt;
489490
Comment comment;
490491
SourceInfo info;
491492
end EQ_EQUALS;

Compiler/Template/SimCodeTV.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2494,6 +2494,7 @@ uniontype EEquation
24942494
record EQ_EQUALS "the equality equation"
24952495
Absyn.Exp expLeft "the expression on the left side of the operator";
24962496
Absyn.Exp expRight "the expression on the right side of the operator";
2497+
Option<ComponentRef> domainOpt;
24972498
Option<Comment> comment;
24982499
builtin.SourceInfo info;
24992500
end EQ_EQUALS;

0 commit comments

Comments
 (0)