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

Method parseSequence

packages/effect/src/encoding/Yaml.ts:681–703  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

679 }
680
681 private parseSequence(): Array<unknown> {
682 this.expect("[")
683 const output: Array<unknown> = []
684 this.skipWhitespace()
685 if (this.peek() === "]") {
686 this.index++
687 return output
688 }
689 while (true) {
690 output.push(this.parseSequenceEntry())
691 this.skipWhitespace()
692 if (this.peek() === "]") {
693 this.index++
694 return output
695 }
696 this.expect(",")
697 this.skipWhitespace()
698 if (this.peek() === "]") {
699 this.index++
700 return output
701 }
702 }
703 }
704
705 // YAML 1.2.2 §7.4.1: a sequence entry followed by `:` is a single `key: value` pair, read as a
706 // one-entry mapping. Like any implicit key, its key is on one line.

Callers 1

parseValueMethod · 0.95

Calls 5

expectMethod · 0.95
skipWhitespaceMethod · 0.95
peekMethod · 0.95
parseSequenceEntryMethod · 0.95
pushMethod · 0.65

Tested by

no test coverage detected