()
| 138 | } |
| 139 | |
| 140 | private parseAdditive(): ExprNode { |
| 141 | let left = this.parseMultiplicative(); |
| 142 | while (true) { |
| 143 | this.skipWhitespace(); |
| 144 | const ch = this.peek(); |
| 145 | if (ch !== "+" && ch !== "-") break; |
| 146 | this.pos++; |
| 147 | const right = this.parseMultiplicative(); |
| 148 | left = { kind: "binary", op: ch as BinaryOp, left, right }; |
| 149 | } |
| 150 | return left; |
| 151 | } |
| 152 | |
| 153 | private parseMultiplicative(): ExprNode { |
| 154 | let left = this.parseUnary(); |
no test coverage detected