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

Function yaml_parser_parse_document_content

parserc.go:361–378  ·  view source on GitHub ↗

Parse the productions: explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* ***********

(parser *yaml_parser_t, event *yaml_event_t)

Source from the content-addressed store, hash-verified

359// ***********
360//
361func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool {
362 token := peek_token(parser)
363 if token == nil {
364 return false
365 }
366
367 if token.typ == yaml_VERSION_DIRECTIVE_TOKEN ||
368 token.typ == yaml_TAG_DIRECTIVE_TOKEN ||
369 token.typ == yaml_DOCUMENT_START_TOKEN ||
370 token.typ == yaml_DOCUMENT_END_TOKEN ||
371 token.typ == yaml_STREAM_END_TOKEN {
372 parser.state = parser.states[len(parser.states)-1]
373 parser.states = parser.states[:len(parser.states)-1]
374 return yaml_parser_process_empty_scalar(parser, event,
375 token.start_mark)
376 }
377 return yaml_parser_parse_node(parser, event, true, false)
378}
379
380// Parse the productions:
381// implicit_document ::= block_node DOCUMENT-END*

Callers 1

Calls 3

peek_tokenFunction · 0.85
yaml_parser_parse_nodeFunction · 0.85

Tested by

no test coverage detected