(parser)
| 4816 | this.args = { lhs, rhs }; |
| 4817 | } |
| 4818 | static parse(parser) { |
| 4819 | var expr = parser.parseElement("comparisonOperator"); |
| 4820 | var logicalOp, initialLogicalOp = null; |
| 4821 | logicalOp = parser.matchToken("and") || parser.matchToken("or"); |
| 4822 | while (logicalOp) { |
| 4823 | initialLogicalOp = initialLogicalOp || logicalOp; |
| 4824 | if (initialLogicalOp.value !== logicalOp.value) { |
| 4825 | parser.raiseError("You must parenthesize logical operations with different operators"); |
| 4826 | } |
| 4827 | var rhs = parser.requireElement("comparisonOperator"); |
| 4828 | const operator = logicalOp.value; |
| 4829 | expr = new _LogicalOperator(expr, operator, rhs); |
| 4830 | logicalOp = parser.matchToken("and") || parser.matchToken("or"); |
| 4831 | } |
| 4832 | return expr; |
| 4833 | } |
| 4834 | resolve(context, { lhs: lhsVal, rhs: rhsVal }) { |
| 4835 | if (this.operator === "and") { |
| 4836 | return lhsVal && rhsVal; |
nothing calls this directly
no test coverage detected