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

Function yaml_emitter_emit_mapping_start

emitterc.go:930–944  ·  view source on GitHub ↗

Expect MAPPING-START.

(emitter *yaml_emitter_t, event *yaml_event_t)

Source from the content-addressed store, hash-verified

928
929// Expect MAPPING-START.
930func yaml_emitter_emit_mapping_start(emitter *yaml_emitter_t, event *yaml_event_t) bool {
931 if !yaml_emitter_process_anchor(emitter) {
932 return false
933 }
934 if !yaml_emitter_process_tag(emitter) {
935 return false
936 }
937 if emitter.flow_level > 0 || emitter.canonical || event.mapping_style() == yaml_FLOW_MAPPING_STYLE ||
938 yaml_emitter_check_empty_mapping(emitter) {
939 emitter.state = yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE
940 } else {
941 emitter.state = yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE
942 }
943 return true
944}
945
946// Check if the document content is an empty scalar.
947func yaml_emitter_check_empty_document(emitter *yaml_emitter_t) bool {

Callers 1

yaml_emitter_emit_nodeFunction · 0.85

Calls 4

yaml_emitter_process_tagFunction · 0.85
mapping_styleMethod · 0.80

Tested by

no test coverage detected