@@ -2448,7 +2448,7 @@ algorithm
24482448 local
24492449 DAE . ComponentRef cr1, cr2;
24502450 DAE . Exp e1, e2;
2451- DAE . Type ty ;
2451+ DAE . Operator op ;
24522452 list< DAE . Exp > elst1, elst2;
24532453 list< list< DAE . Exp >> elstlst1, elstlst2;
24542454 list< DAE . Var > varLst1, varLst2;
@@ -2459,18 +2459,18 @@ algorithm
24592459 then (cr1, cr2, lhs, rhs, false )::inTpls;
24602460
24612461 // a = -b;
2462- case (DAE . CREF (componentRef = cr1), DAE . UNARY (DAE . UMINUS (ty ), DAE . CREF (componentRef = cr2)), _)
2463- then (cr1, cr2, DAE . UNARY (DAE . UMINUS (ty) , lhs), rhs, true )::inTpls;
2462+ case (DAE . CREF (componentRef = cr1), DAE . UNARY (op as DAE . UMINUS (_ ), DAE . CREF (componentRef = cr2)), _)
2463+ then (cr1, cr2, DAE . UNARY (op , lhs), rhs, true )::inTpls;
24642464
2465- case (DAE . CREF (componentRef = cr1), DAE . UNARY (DAE . UMINUS_ARR (ty ), DAE . CREF (componentRef = cr2)), _)
2466- then (cr1, cr2, DAE . UNARY (DAE . UMINUS_ARR (ty) , lhs), rhs, true )::inTpls;
2465+ case (DAE . CREF (componentRef = cr1), DAE . UNARY (op as DAE . UMINUS_ARR (_ ), DAE . CREF (componentRef = cr2)), _)
2466+ then (cr1, cr2, DAE . UNARY (op , lhs), rhs, true )::inTpls;
24672467
24682468 // -a = b;
2469- case (DAE . UNARY (DAE . UMINUS (ty ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2470- then (cr1, cr2, lhs, DAE . UNARY (DAE . UMINUS (ty) , rhs), true )::inTpls;
2469+ case (DAE . UNARY (op as DAE . UMINUS (_ ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2470+ then (cr1, cr2, lhs, DAE . UNARY (op , rhs), true )::inTpls;
24712471
2472- case (DAE . UNARY (DAE . UMINUS_ARR (ty ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2473- then (cr1, cr2, lhs, DAE . UNARY (DAE . UMINUS_ARR (ty) , rhs), true )::inTpls;
2472+ case (DAE . UNARY (op as DAE . UMINUS_ARR (_ ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2473+ then (cr1, cr2, lhs, DAE . UNARY (op , rhs), true )::inTpls;
24742474
24752475 // -a = -b;
24762476 case (DAE . UNARY (DAE . UMINUS (_), e1 as DAE . CREF (componentRef = cr1)), DAE . UNARY (DAE . UMINUS (_), e2 as DAE . CREF (componentRef = cr2)), _)
@@ -2480,12 +2480,12 @@ algorithm
24802480 then (cr1, cr2, e1, e2, false )::inTpls;
24812481
24822482 // a = not b;
2483- case (DAE . CREF (componentRef = cr1), DAE . LUNARY (DAE . NOT (ty ), DAE . CREF (componentRef = cr2)), _)
2484- then (cr1, cr2, DAE . LUNARY (DAE . NOT (ty) , lhs), rhs, true )::inTpls;
2483+ case (DAE . CREF (componentRef = cr1), DAE . LUNARY (op as DAE . NOT (_ ), DAE . CREF (componentRef = cr2)), _)
2484+ then (cr1, cr2, DAE . LUNARY (op , lhs), rhs, true )::inTpls;
24852485
24862486 // not a = b;
2487- case (DAE . LUNARY (DAE . NOT (ty ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2488- then (cr1, cr2, lhs, DAE . LUNARY (DAE . NOT (ty) , rhs), true )::inTpls;
2487+ case (DAE . LUNARY (op as DAE . NOT (_ ), DAE . CREF (componentRef = cr1)), DAE . CREF (componentRef = cr2), _)
2488+ then (cr1, cr2, lhs, DAE . LUNARY (op , rhs), true )::inTpls;
24892489
24902490 // not a = not b;
24912491 case (DAE . LUNARY (DAE . NOT (_), e1 as DAE . CREF (componentRef = cr1)), DAE . LUNARY (DAE . NOT (_), e2 as DAE . CREF (componentRef = cr2)), _)
@@ -2543,20 +2543,19 @@ algorithm
25432543 // case (DAE.LUNARY(DAE.NOT(_), DAE.ARRAY(array = elst1, ty=ty)), DAE.LUNARY(DAE.NOT(_), e2 as DAE.CREF(componentRef = cr2)), _)
25442544
25452545 // a = Record(b1, b2, b3, ..)
2546- case (DAE . CREF (componentRef = cr1), DAE . CALL (path= pathb, expLst= elst2, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (varLst= varLst2, complexClassType= ClassInf . RECORD (pathb1)))), _) equation
2547- true = Absyn . pathEqual(pathb, pathb1);
2546+ case (DAE . CREF (componentRef = cr1), DAE . CALL (path= pathb, expLst= elst2, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (varLst= varLst2, complexClassType= ClassInf . RECORD (pathb1)))), _)
2547+ guard Absyn . pathEqual(pathb, pathb1)
25482548 then aliasRecord(cr1, varLst2, elst2, inTpls);
25492549
25502550 // Record(a1, a2, a3, ..) = b
2551- case (DAE . CALL (path= patha, expLst= elst1, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (varLst= varLst1, complexClassType= ClassInf . RECORD (patha1)))), DAE . CREF (componentRef = cr2), _) equation
2552- true = Absyn . pathEqual(patha, patha1);
2551+ case (DAE . CALL (path= patha, expLst= elst1, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (varLst= varLst1, complexClassType= ClassInf . RECORD (patha1)))), DAE . CREF (componentRef = cr2), _)
2552+ guard Absyn . pathEqual(patha, patha1)
25532553 then aliasRecord(cr2, varLst1, elst1, inTpls);
25542554
25552555 // Record(a1, a2, a3, ..) = Record(b1, b2, b3, ..)
25562556 case (DAE . CALL (path= patha, expLst= elst1, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (complexClassType= ClassInf . RECORD (patha1)))),
2557- DAE . CALL (path= pathb, expLst= elst2, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (complexClassType= ClassInf . RECORD (pathb1)))), _) equation
2558- true = Absyn . pathEqual(patha, patha1);
2559- true = Absyn . pathEqual(pathb, pathb1);
2557+ DAE . CALL (path= pathb, expLst= elst2, attr= DAE . CALL_ATTR (ty= DAE . T_COMPLEX (complexClassType= ClassInf . RECORD (pathb1)))), _)
2558+ guard Absyn . pathEqual(patha, patha1) and Absyn . pathEqual(pathb, pathb1)
25602559 then List . threadFold(elst1, elst2, aliasEquation1, inTpls);
25612560
25622561 // matchcontinue part
@@ -2620,6 +2619,7 @@ algorithm
26202619 DAE . ComponentRef cr1, cr2;
26212620 DAE . Exp e1, e2;
26222621 DAE . Type ty, ty1;
2622+ DAE . Operator op;
26232623 list< DAE . Exp > elst;
26242624 list< DAE . Var > vlst;
26252625 DAE . Ident ident;
@@ -2634,20 +2634,20 @@ algorithm
26342634 then aliasRecord(cr, vlst, elst, (cr1, cr2, e1, e2, false )::inTpls);
26352635
26362636 // a = -b
2637- case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . UNARY (DAE . UMINUS (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
2637+ case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . UNARY (op as DAE . UMINUS (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
26382638 cr1 = ComponentReference . crefPrependIdent(cr, ident, {}, ty);
2639- e1 = DAE . UNARY (DAE . UMINUS (ty1) , DAE . CREF (cr1, ty));
2639+ e1 = DAE . UNARY (op , DAE . CREF (cr1, ty));
26402640 then aliasRecord(cr, vlst, elst, (cr1, cr2, e1, e2, true )::inTpls);
26412641
2642- case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . UNARY (DAE . UMINUS_ARR (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
2642+ case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . UNARY (op as DAE . UMINUS_ARR (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
26432643 cr1 = ComponentReference . crefPrependIdent(cr, ident, {}, ty);
2644- e1 = DAE . UNARY (DAE . UMINUS_ARR (ty1) , DAE . CREF (cr1, ty));
2644+ e1 = DAE . UNARY (op , DAE . CREF (cr1, ty));
26452645 then aliasRecord(cr, vlst, elst, (cr1, cr2, e1, e2, true )::inTpls);
26462646
26472647 // a = not b
2648- case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . LUNARY (DAE . NOT (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
2648+ case (_, DAE . TYPES_VAR (name= ident, ty= ty)::vlst, (e2 as DAE . LUNARY (op as DAE . NOT (ty1), DAE . CREF (componentRef = cr2)))::elst, _) equation
26492649 cr1 = ComponentReference . crefPrependIdent(cr, ident, {}, ty);
2650- e1 = DAE . LUNARY (DAE . NOT (ty1) , DAE . CREF (cr1, ty));
2650+ e1 = DAE . LUNARY (op , DAE . CREF (cr1, ty));
26512651 then aliasRecord(cr, vlst, elst, (cr1, cr2, e1, e2, true )::inTpls);
26522652
26532653 // a = {b1, b2, b3}
0 commit comments