MCPcopy
hub / github.com/go-yaml/yaml / yaml_emitter_emit_block_sequence_item

Function yaml_emitter_emit_block_sequence_item

emitterc.go:729–762  ·  emitterc.go::yaml_emitter_emit_block_sequence_item

Expect a block item node.

(emitter *yaml_emitter_t, event *yaml_event_t, first bool)

Source from the content-addressed store, hash-verified

727
728// Expect a block item node.
729func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {
730 if first {
731 if !yaml_emitter_increase_indent(emitter, false, false) {
732 return false
733 }
734 }
735 if event.typ == yaml_SEQUENCE_END_EVENT {
736 emitter.indent = emitter.indents[len(emitter.indents)-1]
737 emitter.indents = emitter.indents[:len(emitter.indents)-1]
738 emitter.state = emitter.states[len(emitter.states)-1]
739 emitter.states = emitter.states[:len(emitter.states)-1]
740 return true
741 }
742 if !yaml_emitter_process_head_comment(emitter) {
743 return false
744 }
745 if !yaml_emitter_write_indent(emitter) {
746 return false
747 }
748 if !yaml_emitter_write_indicator(emitter, []byte{'-'}, true, false, true) {
749 return false
750 }
751 emitter.states = append(emitter.states, yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE)
752 if !yaml_emitter_emit_node(emitter, event, false, true, false, false) {
753 return false
754 }
755 if !yaml_emitter_process_line_comment(emitter) {
756 return false
757 }
758 if !yaml_emitter_process_foot_comment(emitter) {
759 return false
760 }
761 return true
762}
763
764// Expect a block key node.
765func yaml_emitter_emit_block_mapping_key(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool {

Callers 1

Tested by

no test coverage detected