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

Method parseInlineTable

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

Source from the content-addressed store, hash-verified

388 }
389
390 private parseInlineTable(): Table {
391 this.expect("{")
392 const output = makeTable()
393 this.skipInlineWhitespace()
394 if (this.peek() === "}") {
395 this.advance()
396 return output
397 }
398 while (true) {
399 const keys = this.parseKeyPath("=")
400 this.skipInlineWhitespace()
401 this.expect("=")
402 this.skipInlineWhitespace()
403 this.assign(output, keys, this.parseValue())
404 this.skipInlineWhitespace()
405 if (this.peek() === "}") {
406 this.advance()
407 return output
408 }
409 this.expect(",")
410 this.skipInlineWhitespace()
411 if (this.peek() === "}") {
412 this.fail("Inline tables cannot end with a trailing comma")
413 }
414 }
415 }
416
417 private skipDocumentWhitespace(): void {
418 while (!this.done) {

Callers 1

parseValueMethod · 0.95

Calls 9

expectMethod · 0.95
skipInlineWhitespaceMethod · 0.95
peekMethod · 0.95
advanceMethod · 0.95
parseKeyPathMethod · 0.95
assignMethod · 0.95
parseValueMethod · 0.95
failMethod · 0.95
makeTableFunction · 0.85

Tested by

no test coverage detected