()
| 84 | } |
| 85 | |
| 86 | parse(): ExprNode { |
| 87 | this.skipWhitespace(); |
| 88 | if (this.isEof()) { |
| 89 | this.fail("Unexpected end of input"); |
| 90 | } |
| 91 | const node = this.parseExpr(); |
| 92 | this.skipWhitespace(); |
| 93 | if (!this.isEof()) { |
| 94 | const tok = this.peek(); |
| 95 | this.fail(tok === null ? "Unexpected end of input" : `Unexpected token "${tok}"`); |
| 96 | } |
| 97 | return node; |
| 98 | } |
| 99 | |
| 100 | private parseExpr(): ExprNode { |
| 101 | return this.parseTernary(); |