()
| 71 | } |
| 72 | |
| 73 | private parseHeader(): void { |
| 74 | this.expect("[") |
| 75 | const array = this.peek() === "[" |
| 76 | if (array) { |
| 77 | this.advance() |
| 78 | } |
| 79 | this.skipInlineWhitespace() |
| 80 | const path = this.parseKeyPath("]") |
| 81 | this.skipInlineWhitespace() |
| 82 | this.expect("]") |
| 83 | if (array) { |
| 84 | this.expect("]") |
| 85 | } |
| 86 | this.finishStatement() |
| 87 | |
| 88 | const pathKey = JSON.stringify(path) |
| 89 | if (!array && this.explicitTables.has(pathKey)) { |
| 90 | this.fail(`Cannot redefine table '${path.join(".")}'`) |
| 91 | } |
| 92 | if (!array) { |
| 93 | this.explicitTables.add(pathKey) |
| 94 | } |
| 95 | this.current = this.resolveTable(path, array) |
| 96 | } |
| 97 | |
| 98 | private resolveTable(path: ReadonlyArray<string>, array: boolean): Table { |
| 99 | let table = this.root |
no test coverage detected