(stop: "=" | "]")
| 186 | } |
| 187 | |
| 188 | private parseKeyPath(stop: "=" | "]"): Array<string> { |
| 189 | const keys: Array<string> = [] |
| 190 | while (true) { |
| 191 | this.skipInlineWhitespace() |
| 192 | const character = this.peek() |
| 193 | let key: string |
| 194 | if (character === "\"") { |
| 195 | key = this.parseBasicString(false) |
| 196 | } else if (character === "'") { |
| 197 | key = this.parseLiteralString(false) |
| 198 | } else { |
| 199 | const start = this.index |
| 200 | while (/[A-Za-z0-9_-]/.test(this.peek())) { |
| 201 | this.advance() |
| 202 | } |
| 203 | key = this.input.slice(start, this.index) |
| 204 | if (key.length === 0) { |
| 205 | this.fail("Expected a key") |
| 206 | } |
| 207 | } |
| 208 | keys.push(key) |
| 209 | this.skipInlineWhitespace() |
| 210 | if (this.peek() === ".") { |
| 211 | this.advance() |
| 212 | continue |
| 213 | } |
| 214 | if (this.peek() !== stop) { |
| 215 | this.fail(`Expected '${stop}'`) |
| 216 | } |
| 217 | return keys |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | private parseValue(): unknown { |
| 222 | const character = this.peek() |
no test coverage detected