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

Function yaml_emitter_state_machine

emitterc.go:251–315  ·  view source on GitHub ↗

State dispatcher.

(emitter *yaml_emitter_t, event *yaml_event_t)

Source from the content-addressed store, hash-verified

249
250// State dispatcher.
251func yaml_emitter_state_machine(emitter *yaml_emitter_t, event *yaml_event_t) bool {
252 switch emitter.state {
253 default:
254 case yaml_EMIT_STREAM_START_STATE:
255 return yaml_emitter_emit_stream_start(emitter, event)
256
257 case yaml_EMIT_FIRST_DOCUMENT_START_STATE:
258 return yaml_emitter_emit_document_start(emitter, event, true)
259
260 case yaml_EMIT_DOCUMENT_START_STATE:
261 return yaml_emitter_emit_document_start(emitter, event, false)
262
263 case yaml_EMIT_DOCUMENT_CONTENT_STATE:
264 return yaml_emitter_emit_document_content(emitter, event)
265
266 case yaml_EMIT_DOCUMENT_END_STATE:
267 return yaml_emitter_emit_document_end(emitter, event)
268
269 case yaml_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE:
270 return yaml_emitter_emit_flow_sequence_item(emitter, event, true, false)
271
272 case yaml_EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE:
273 return yaml_emitter_emit_flow_sequence_item(emitter, event, false, true)
274
275 case yaml_EMIT_FLOW_SEQUENCE_ITEM_STATE:
276 return yaml_emitter_emit_flow_sequence_item(emitter, event, false, false)
277
278 case yaml_EMIT_FLOW_MAPPING_FIRST_KEY_STATE:
279 return yaml_emitter_emit_flow_mapping_key(emitter, event, true, false)
280
281 case yaml_EMIT_FLOW_MAPPING_TRAIL_KEY_STATE:
282 return yaml_emitter_emit_flow_mapping_key(emitter, event, false, true)
283
284 case yaml_EMIT_FLOW_MAPPING_KEY_STATE:
285 return yaml_emitter_emit_flow_mapping_key(emitter, event, false, false)
286
287 case yaml_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE:
288 return yaml_emitter_emit_flow_mapping_value(emitter, event, true)
289
290 case yaml_EMIT_FLOW_MAPPING_VALUE_STATE:
291 return yaml_emitter_emit_flow_mapping_value(emitter, event, false)
292
293 case yaml_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE:
294 return yaml_emitter_emit_block_sequence_item(emitter, event, true)
295
296 case yaml_EMIT_BLOCK_SEQUENCE_ITEM_STATE:
297 return yaml_emitter_emit_block_sequence_item(emitter, event, false)
298
299 case yaml_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE:
300 return yaml_emitter_emit_block_mapping_key(emitter, event, true)
301
302 case yaml_EMIT_BLOCK_MAPPING_KEY_STATE:
303 return yaml_emitter_emit_block_mapping_key(emitter, event, false)
304
305 case yaml_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE:
306 return yaml_emitter_emit_block_mapping_value(emitter, event, true)
307
308 case yaml_EMIT_BLOCK_MAPPING_VALUE_STATE:

Callers 1

yaml_emitter_emitFunction · 0.85

Tested by

no test coverage detected