r=(q+r)-c and r=q+(r-c) are now both also 'augmentable', and BinExprSplitter doesn't check for associativeOperator anymore

This commit is contained in:
Irmen de Jong
2021-11-20 01:21:33 +01:00
parent 87600b23db
commit f9399bcce7
7 changed files with 50 additions and 16 deletions

View File

@@ -49,7 +49,7 @@ X = BinExpr X = LeftExpr
if(assignment.target isSameAs binExpr.left || assignment.target isSameAs binExpr.right)
return noModifications
if(binExpr.right.isSimple && !assignment.isAugmentable) {
if(binExpr.right.isSimple) {
val firstAssign = Assignment(assignment.target.copy(), binExpr.left, binExpr.left.position)
val targetExpr = assignment.target.toExpression()
val augExpr = BinaryExpression(targetExpr, binExpr.operator, binExpr.right, binExpr.right.position)