()
| 176 | } |
| 177 | |
| 178 | private parseAtom(): ExprNode { |
| 179 | this.skipWhitespace(); |
| 180 | const ch = this.peek(); |
| 181 | if (ch === null) this.fail("Unexpected end of input"); |
| 182 | |
| 183 | if (ch === "(") { |
| 184 | this.pos++; |
| 185 | const inner = this.parseExpr(); |
| 186 | this.skipWhitespace(); |
| 187 | if (!this.consumeIf(")")) this.fail('Expected ")"'); |
| 188 | return inner; |
| 189 | } |
| 190 | |
| 191 | if (ch === "#") return this.parseWidgetRef(); |
| 192 | if (isDigit(ch)) return this.parseNumberNode(); |
| 193 | if (isIdentifierStart(ch)) return this.parseNamedAtom(); |
| 194 | this.fail(`Unexpected token "${ch}"`); |
| 195 | } |
| 196 | |
| 197 | private parseNamedAtom(): ExprNode { |
| 198 | const identStart = this.pos; |
no test coverage detected