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