()
| 151 | } |
| 152 | |
| 153 | private parseMultiplicative(): ExprNode { |
| 154 | let left = this.parseUnary(); |
| 155 | while (true) { |
| 156 | this.skipWhitespace(); |
| 157 | const ch = this.peek(); |
| 158 | if (ch !== "*" && ch !== "/") break; |
| 159 | this.pos++; |
| 160 | const right = this.parseUnary(); |
| 161 | left = { kind: "binary", op: ch as BinaryOp, left, right }; |
| 162 | } |
| 163 | return left; |
| 164 | } |
| 165 | |
| 166 | private parseUnary(): ExprNode { |
| 167 | this.skipWhitespace(); |
no test coverage detected