| 459 | */ |
| 460 | |
| 461 | static int |
| 462 | yaml_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: |
no test coverage detected