(parser)
| 4548 | this.args = { lhs, rhs }; |
| 4549 | } |
| 4550 | static parse(parser) { |
| 4551 | var expr = parser.parseElement("collectionExpression"); |
| 4552 | var mathOp, initialMathOp = null; |
| 4553 | mathOp = parser.matchAnyOpToken("+", "-", "*", "/") || parser.matchToken("mod"); |
| 4554 | while (mathOp) { |
| 4555 | initialMathOp = initialMathOp || mathOp; |
| 4556 | var operator = mathOp.value; |
| 4557 | if (initialMathOp.value !== operator) { |
| 4558 | parser.raiseError("You must parenthesize math operations with different operators"); |
| 4559 | } |
| 4560 | var rhs = parser.parseElement("collectionExpression"); |
| 4561 | expr = new _MathOperator(expr, operator, rhs); |
| 4562 | mathOp = parser.matchAnyOpToken("+", "-", "*", "/") || parser.matchToken("mod"); |
| 4563 | } |
| 4564 | return expr; |
| 4565 | } |
| 4566 | resolve(context, { lhs: lhsVal, rhs: rhsVal }) { |
| 4567 | if (this.operator === "+") { |
| 4568 | if (Array.isArray(lhsVal)) return lhsVal.concat(rhsVal); |
nothing calls this directly
no test coverage detected