(parser)
| 4609 | } |
| 4610 | } |
| 4611 | static parse(parser) { |
| 4612 | var expr = parser.parseElement("mathOperator"); |
| 4613 | var comparisonToken = parser.matchAnyOpToken("<", ">", "<=", ">=", "==", "===", "!=", "!=="); |
| 4614 | var operator = comparisonToken ? comparisonToken.value : null; |
| 4615 | var hasRightValue = true; |
| 4616 | var typeCheck = false; |
| 4617 | if (operator == null) { |
| 4618 | if (parser.matchToken("is") || parser.matchToken("am")) { |
| 4619 | if (parser.matchToken("not")) { |
| 4620 | if (parser.matchToken("in")) { |
| 4621 | operator = "not in"; |
| 4622 | } else if (parser.matchToken("a") || parser.matchToken("an")) { |
| 4623 | operator = "not a"; |
| 4624 | typeCheck = true; |
| 4625 | } else if (parser.matchToken("empty")) { |
| 4626 | operator = "not empty"; |
| 4627 | hasRightValue = false; |
| 4628 | } else if (parser.matchToken("between")) { |
| 4629 | operator = "not between"; |
| 4630 | } else if (parser.matchToken("really")) { |
| 4631 | operator = "!=="; |
| 4632 | if (parser.matchToken("equal")) parser.matchToken("to"); |
| 4633 | } else if (parser.matchToken("equal")) { |
| 4634 | parser.matchToken("to"); |
| 4635 | operator = "!="; |
| 4636 | } else { |
| 4637 | operator = "is not"; |
| 4638 | } |
| 4639 | } else if (parser.matchToken("in")) { |
| 4640 | operator = "in"; |
| 4641 | } else if (parser.matchToken("a") || parser.matchToken("an")) { |
| 4642 | operator = "a"; |
| 4643 | typeCheck = true; |
| 4644 | } else if (parser.matchToken("empty")) { |
| 4645 | operator = "empty"; |
| 4646 | hasRightValue = false; |
| 4647 | } else if (parser.matchToken("between")) { |
| 4648 | operator = "between"; |
| 4649 | } else if (parser.matchToken("less")) { |
| 4650 | parser.requireToken("than"); |
| 4651 | if (parser.matchToken("or")) { |
| 4652 | parser.requireToken("equal"); |
| 4653 | parser.requireToken("to"); |
| 4654 | operator = "<="; |
| 4655 | } else { |
| 4656 | operator = "<"; |
| 4657 | } |
| 4658 | } else if (parser.matchToken("greater")) { |
| 4659 | parser.requireToken("than"); |
| 4660 | if (parser.matchToken("or")) { |
| 4661 | parser.requireToken("equal"); |
| 4662 | parser.requireToken("to"); |
| 4663 | operator = ">="; |
| 4664 | } else { |
| 4665 | operator = ">"; |
| 4666 | } |
| 4667 | } else if (parser.matchToken("really")) { |
| 4668 | operator = "==="; |
nothing calls this directly
no test coverage detected