Apply patch from Daniel Schürmann: https://sourceforge.net/p/boomerang/bugs/78/
[boomerang.git] / boomerang / transformations / int_canolize.t.old
blob290afc82310643acfed9150c025da6ccea86b022
1 x - n becomes x + (-n)
2 n + (-n) becomes 0
3 x + 0 becomes x
4 (x + a) + b where (kind(a) == opIntConst) && (kind(b) == opIntConst) becomes x + (a + b)
5 (x - a) + b where (kind(a) == opIntConst) && (kind(b) == opIntConst) becomes x + ((-a) + b)
6 (x * k) - x becomes x * (k-1)
7 x + (x * k) becomes x * (k+1)
8 a + (a*n) where kind(n) == opIntConst becomes a*(n+1)
9 (a*n)*m where (kind(n) == opIntConst) && (kind(m) == opIntConst) becomes a*(n*m)