(xs: ReadonlyArray<Expression> /* , generated: Set<string> */)
| 607 | |
| 608 | // -a -> 0-a |
| 609 | if (isFunction(expr, 'Negate') && headAdmits(operator, expr)) |
| 610 | result = matchVariation('Subtract', [0, expr.op1]); |
| 611 | |
| 612 | if (result !== null) return result; |
| 613 | } |
| 614 | |
| 615 | // The pattern is ['Multiply', a, b] |
| 616 | if (operator === 'Multiply') { |
| 617 | // x -> 1*x |
| 618 | let result = matchVariation('Multiply', [1, expr]); |
| 619 | if (result !== null) return result; |
| 620 | |
| 621 | // -x -> -1*x |
| 622 | if (isFunction(expr, 'Negate') && headAdmits(operator, expr)) { |
| 623 | result = matchVariation('Multiply', [-1, expr.op1]); |
| 624 | if (result !== null) return result; |
nothing calls this directly
no test coverage detected