(parser)
| 4481 | this.args = { lhs, rhs }; |
| 4482 | } |
| 4483 | static parse(parser) { |
| 4484 | var expr = parser.parseElement("comparisonOperator"); |
| 4485 | var logicalOp, initialLogicalOp = null; |
| 4486 | logicalOp = parser.matchToken("and") || parser.matchToken("or"); |
| 4487 | while (logicalOp) { |
| 4488 | initialLogicalOp = initialLogicalOp || logicalOp; |
| 4489 | if (initialLogicalOp.value !== logicalOp.value) { |
| 4490 | parser.raiseError("You must parenthesize logical operations with different operators"); |
| 4491 | } |
| 4492 | var rhs = parser.requireElement("comparisonOperator"); |
| 4493 | const operator = logicalOp.value; |
| 4494 | expr = new _LogicalOperator(expr, operator, rhs); |
| 4495 | logicalOp = parser.matchToken("and") || parser.matchToken("or"); |
| 4496 | } |
| 4497 | return expr; |
| 4498 | } |
| 4499 | resolve(context, { lhs: lhsVal, rhs: rhsVal }) { |
| 4500 | if (this.operator === "and") { |
| 4501 | return lhsVal && rhsVal; |
nothing calls this directly
no test coverage detected