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

Function yaml_emitter_process_head_comment

emitterc.go:1118–1144  ·  view source on GitHub ↗

Write a head comment.

(emitter *yaml_emitter_t)

Source from the content-addressed store, hash-verified

1116
1117// Write a head comment.
1118func yaml_emitter_process_head_comment(emitter *yaml_emitter_t) bool {
1119 if len(emitter.tail_comment) > 0 {
1120 if !yaml_emitter_write_indent(emitter) {
1121 return false
1122 }
1123 if !yaml_emitter_write_comment(emitter, emitter.tail_comment) {
1124 return false
1125 }
1126 emitter.tail_comment = emitter.tail_comment[:0]
1127 emitter.foot_indent = emitter.indent
1128 if emitter.foot_indent < 0 {
1129 emitter.foot_indent = 0
1130 }
1131 }
1132
1133 if len(emitter.head_comment) == 0 {
1134 return true
1135 }
1136 if !yaml_emitter_write_indent(emitter) {
1137 return false
1138 }
1139 if !yaml_emitter_write_comment(emitter, emitter.head_comment) {
1140 return false
1141 }
1142 emitter.head_comment = emitter.head_comment[:0]
1143 return true
1144}
1145
1146// Write an line comment.
1147func yaml_emitter_process_line_comment(emitter *yaml_emitter_t) bool {

Calls 2

Tested by

no test coverage detected