MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / yaml_parser_parse_document_content

Function yaml_parser_parse_document_content

xs/tools/yaml/parser.c:461–481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459 */
460
461static int
462yaml_parser_parse_document_content(yaml_parser_t *parser, yaml_event_t *event)
463{
464 yaml_token_t *token;
465
466 token = PEEK_TOKEN(parser);
467 if (!token) return 0;
468
469 if (token->type == YAML_VERSION_DIRECTIVE_TOKEN ||
470 token->type == YAML_TAG_DIRECTIVE_TOKEN ||
471 token->type == YAML_DOCUMENT_START_TOKEN ||
472 token->type == YAML_DOCUMENT_END_TOKEN ||
473 token->type == YAML_STREAM_END_TOKEN) {
474 parser->state = POP(parser, parser->states);
475 return yaml_parser_process_empty_scalar(parser, event,
476 token->start_mark);
477 }
478 else {
479 return yaml_parser_parse_node(parser, event, 1, 0);
480 }
481}
482
483/*
484 * Parse the productions:

Callers 1

Calls 2

yaml_parser_parse_nodeFunction · 0.85

Tested by

no test coverage detected