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

Function yaml_emitter_emit_flow_mapping_value

emitterc.go:691–726  ·  view source on GitHub ↗

Expect a flow value node.

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

Source from the content-addressed store, hash-verified

689
690// Expect a flow value node.
691func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_event_t, simple bool) bool {
692 if simple {
693 if !yaml_emitter_write_indicator(emitter, []byte{':'}, false, false, false) {
694 return false
695 }
696 } else {
697 if emitter.canonical || emitter.column > emitter.best_width {
698 if !yaml_emitter_write_indent(emitter) {
699 return false
700 }
701 }
702 if !yaml_emitter_write_indicator(emitter, []byte{':'}, true, false, false) {
703 return false
704 }
705 }
706 if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 {
707 emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_TRAIL_KEY_STATE)
708 } else {
709 emitter.states = append(emitter.states, yaml_EMIT_FLOW_MAPPING_KEY_STATE)
710 }
711 if !yaml_emitter_emit_node(emitter, event, false, false, true, false) {
712 return false
713 }
714 if len(emitter.line_comment)+len(emitter.foot_comment)+len(emitter.tail_comment) > 0 {
715 if !yaml_emitter_write_indicator(emitter, []byte{','}, false, false, false) {
716 return false
717 }
718 }
719 if !yaml_emitter_process_line_comment(emitter) {
720 return false
721 }
722 if !yaml_emitter_process_foot_comment(emitter) {
723 return false
724 }
725 return true
726}
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 {

Callers 1

Tested by

no test coverage detected