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

Method parseHeader

packages/effect/src/unstable/encoding/Toml.ts:73–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 6

parseMethod · 0.95
cookiesMethod · 0.80
cookiesMethod · 0.80
cookiesMethod · 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
failMethod · 0.95
resolveTableMethod · 0.95
joinMethod · 0.80
addMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected