MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseHeader

Method parseHeader

packages/effect/src/encoding/Toml.ts:102–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 8

parseMethod · 0.95
cookiesMethod · 0.80
cookiesMethod · 0.80
cookiesMethod · 0.80
Cookies.test.tsFile · 0.80
cookiesMethod · 0.80
cookiesMethod · 0.80

Calls 11

expectMethod · 0.95
peekMethod · 0.95
advanceMethod · 0.95
skipInlineWhitespaceMethod · 0.95
parseKeyPathMethod · 0.95
finishStatementMethod · 0.95
resolveTableMethod · 0.95
failMethod · 0.95
hasMethod · 0.65
addMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected