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

Function yaml_emitter_emit_document_end

emitterc.go:501–529  ·  emitterc.go::yaml_emitter_emit_document_end

Expect DOCUMENT-END.

(emitter *yaml_emitter_t, event *yaml_event_t)

Source from the content-addressed store, hash-verified

499
500// Expect DOCUMENT-END.
501func yaml_emitter_emit_document_end(emitter *yaml_emitter_t, event *yaml_event_t) bool {
502 if event.typ != yaml_DOCUMENT_END_EVENT {
503 return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-END")
504 }
505 // [Go] Force document foot separation.
506 emitter.foot_indent = 0
507 if !yaml_emitter_process_foot_comment(emitter) {
508 return false
509 }
510 emitter.foot_indent = -1
511 if !yaml_emitter_write_indent(emitter) {
512 return false
513 }
514 if !event.implicit {
515 // [Go] Allocate the slice elsewhere.
516 if !yaml_emitter_write_indicator(emitter, []byte("..."), true, false, false) {
517 return false
518 }
519 if !yaml_emitter_write_indent(emitter) {
520 return false
521 }
522 }
523 if !yaml_emitter_flush(emitter) {
524 return false
525 }
526 emitter.state = yaml_EMIT_DOCUMENT_START_STATE
527 emitter.tag_directives = emitter.tag_directives[:0]
528 return true
529}
530
531// Expect a flow item node.
532func yaml_emitter_emit_flow_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first, trail bool) bool {

Callers 1

Tested by

no test coverage detected