Run the full parse loop
()
| 118 | |
| 119 | /** Run the full parse loop */ |
| 120 | public parse(): Token[] { |
| 121 | const vals: Token[] = []; |
| 122 | while (this.str.length > 0) { |
| 123 | const obj = this.value(); |
| 124 | if (!obj) { |
| 125 | throw new Error(`failed to parse near \`${this.str.slice(0, 10)}...\``); |
| 126 | } |
| 127 | vals.push(obj); |
| 128 | } |
| 129 | return vals; |
| 130 | } |
| 131 | } |