(parser)
| 4223 | this.args = { lhs, rhs }; |
| 4224 | } |
| 4225 | static parse(parser) { |
| 4226 | var expr = parser.parseElement("unaryExpression"); |
| 4227 | var mathOp, initialMathOp = null; |
| 4228 | mathOp = parser.matchAnyOpToken("+", "-", "*", "/") || parser.matchToken("mod"); |
| 4229 | while (mathOp) { |
| 4230 | initialMathOp = initialMathOp || mathOp; |
| 4231 | var operator = mathOp.value; |
| 4232 | if (initialMathOp.value !== operator) { |
| 4233 | parser.raiseError("You must parenthesize math operations with different operators"); |
| 4234 | } |
| 4235 | var rhs = parser.parseElement("unaryExpression"); |
| 4236 | expr = new _MathOperator(expr, operator, rhs); |
| 4237 | mathOp = parser.matchAnyOpToken("+", "-", "*", "/") || parser.matchToken("mod"); |
| 4238 | } |
| 4239 | return expr; |
| 4240 | } |
| 4241 | resolve(context, { lhs: lhsVal, rhs: rhsVal }) { |
| 4242 | if (this.operator === "+") { |
| 4243 | if (Array.isArray(lhsVal)) return lhsVal.concat(rhsVal); |
nothing calls this directly
no test coverage detected