()
| 950 | } |
| 951 | |
| 952 | private parseEquality(): AST { |
| 953 | // '==','!=','===','!==' |
| 954 | const start = this.inputIndex; |
| 955 | let result = this.parseRelational(); |
| 956 | while (this.next.type == TokenType.Operator) { |
| 957 | const operator = this.next.strValue; |
| 958 | switch (operator) { |
| 959 | case '==': |
| 960 | case '===': |
| 961 | case '!=': |
| 962 | case '!==': |
| 963 | this.advance(); |
| 964 | const right = this.parseRelational(); |
| 965 | result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right); |
| 966 | continue; |
| 967 | } |
| 968 | break; |
| 969 | } |
| 970 | return result; |
| 971 | } |
| 972 | |
| 973 | private parseRelational(): AST { |
| 974 | // '<', '>', '<=', '>=', 'in', 'instanceof' |
no test coverage detected