(stop: "=" | "]")
| 153 | } |
| 154 | |
| 155 | private parseKeyPath(stop: "=" | "]"): Array<string> { |
| 156 | const keys: Array<string> = [] |
| 157 | while (true) { |
| 158 | this.skipInlineWhitespace() |
| 159 | const character = this.peek() |
| 160 | let key: string |
| 161 | if (character === "\"") { |
| 162 | key = this.parseBasicString(false) |
| 163 | } else if (character === "'") { |
| 164 | key = this.parseLiteralString(false) |
| 165 | } else { |
| 166 | const start = this.index |
| 167 | while (/[A-Za-z0-9_-]/.test(this.peek())) { |
| 168 | this.advance() |
| 169 | } |
| 170 | key = this.input.slice(start, this.index) |
| 171 | } |
| 172 | if (key.length === 0) { |
| 173 | this.fail("Expected a key") |
| 174 | } |
| 175 | keys.push(key) |
| 176 | this.skipInlineWhitespace() |
| 177 | if (this.peek() === ".") { |
| 178 | this.advance() |
| 179 | continue |
| 180 | } |
| 181 | if (this.peek() !== stop) { |
| 182 | this.fail(`Expected '${stop}'`) |
| 183 | } |
| 184 | return keys |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | private parseValue(): unknown { |
| 189 | const character = this.peek() |
no test coverage detected