()
| 100 | } |
| 101 | |
| 102 | private parseHeader(): void { |
| 103 | this.expect("[") |
| 104 | const array = this.peek() === "[" |
| 105 | if (array) { |
| 106 | this.advance() |
| 107 | } |
| 108 | this.skipInlineWhitespace() |
| 109 | const path = this.parseKeyPath("]") |
| 110 | this.skipInlineWhitespace() |
| 111 | this.expect("]") |
| 112 | if (array) { |
| 113 | this.expect("]") |
| 114 | } |
| 115 | this.finishStatement() |
| 116 | |
| 117 | const table = this.resolveTable(path, array) |
| 118 | if (!array && (this.explicitTables.has(table) || this.dottedTables.has(table))) { |
| 119 | this.fail(`Cannot redefine table '${path.join(".")}'`) |
| 120 | } |
| 121 | if (!array) { |
| 122 | this.explicitTables.add(table) |
| 123 | } |
| 124 | this.current = table |
| 125 | } |
| 126 | |
| 127 | private resolveTable(path: ReadonlyArray<string>, array: boolean): Table { |
| 128 | let table = this.root |
no test coverage detected