Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit c1a48de

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Add missing cases to Expression.compare.
Belonging to [master]: - #2820
1 parent cb2f4d4 commit c1a48de

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Compiler/NFFrontEnd/NFExpression.mo

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ public
431431
Call c;
432432
list<Subscript> subs;
433433
ClockKind clk1, clk2;
434+
Mutable<Expression> me;
434435

435436
case INTEGER()
436437
algorithm
@@ -511,6 +512,13 @@ public
511512
then
512513
compareList(exp1.elements, expl);
513514

515+
case RECORD()
516+
algorithm
517+
RECORD(path = p, elements = expl) := exp2;
518+
comp := Absyn.pathCompare(exp1.path, p);
519+
then
520+
if comp == 0 then compareList(exp1.elements, expl) else comp;
521+
514522
case CALL()
515523
algorithm
516524
CALL(call = c) := exp2;
@@ -651,6 +659,24 @@ public
651659
then
652660
comp;
653661

662+
case BOX()
663+
algorithm
664+
BOX(exp = e2) := exp2;
665+
then
666+
compare(exp1.exp, e2);
667+
668+
case MUTABLE()
669+
algorithm
670+
MUTABLE(exp = me) := exp2;
671+
then
672+
compare(Mutable.access(exp1.exp), Mutable.access(me));
673+
674+
case EMPTY()
675+
algorithm
676+
EMPTY(ty = ty) := exp2;
677+
then
678+
valueCompare(exp1.ty, ty);
679+
654680
else
655681
algorithm
656682
Error.assertion(false, getInstanceName() + " got unknown expression.", sourceInfo());

0 commit comments

Comments
 (0)