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