`key = …` at the start of a line → the key's decoded path.
(text: string)
| 436 | |
| 437 | /** `key = …` at the start of a line → the key's decoded path. */ |
| 438 | function parseKeyValueStart(text: string): { path: string[] | null; inlineTable: boolean } | null { |
| 439 | const start = skipWs(text, 0); |
| 440 | if (start >= text.length || text[start] === '#' || text[start] === '\r') return null; |
| 441 | const key = parseDottedKey(text, start); |
| 442 | if (!key) return null; |
| 443 | const eq = skipWs(text, key.end); |
| 444 | if (text[eq] !== '=') return null; |
| 445 | return { path: key.path, inlineTable: text[skipWs(text, eq + 1)] === '{' }; |
| 446 | } |
| 447 | |
| 448 | function skipWs(text: string, i: number): number { |
| 449 | while (i < text.length && (text[i] === ' ' || text[i] === '\t')) i++; |
no test coverage detected