| 289 | } |
| 290 | |
| 291 | private parseWidgetRef(): ExprNode { |
| 292 | this.expect("#"); |
| 293 | const start = this.pos; |
| 294 | while (true) { |
| 295 | const ch = this.peek(); |
| 296 | if (ch === null || ch === "." || isWhitespace(ch)) break; |
| 297 | this.pos++; |
| 298 | } |
| 299 | const id = this.source.slice(start, this.pos); |
| 300 | if (id.length === 0) this.fail('Expected widget ID after "#"'); |
| 301 | if (!this.consumeIf(".")) this.fail('Expected "." after widget ID'); |
| 302 | const prop = this.readProp(); |
| 303 | return { |
| 304 | kind: "ref", |
| 305 | scope: { kind: "widget", id }, |
| 306 | prop, |
| 307 | }; |
| 308 | } |
| 309 | |
| 310 | private parseNumberNode(): Readonly<{ kind: "number"; value: number }> { |
| 311 | const start = this.pos; |