()
| 121 | } |
| 122 | |
| 123 | private parseCompare(): ExprNode { |
| 124 | const left = this.parseAdditive(); |
| 125 | this.skipWhitespace(); |
| 126 | const op = this.consumeCompareOp(); |
| 127 | if (op === null) return left; |
| 128 | const right = this.parseAdditive(); |
| 129 | this.skipWhitespace(); |
| 130 | const extra = this.consumeCompareOp(); |
| 131 | if (extra !== null) { |
| 132 | this.fail( |
| 133 | "Only one comparison operator is allowed in a compare expression", |
| 134 | this.pos - extra.length, |
| 135 | ); |
| 136 | } |
| 137 | return { kind: "compare", op, left, right }; |
| 138 | } |
| 139 | |
| 140 | private parseAdditive(): ExprNode { |
| 141 | let left = this.parseMultiplicative(); |
no test coverage detected