| 1383 | */ |
| 1384 | |
| 1385 | static int |
| 1386 | yaml_parser_fetch_directive(yaml_parser_t *parser) |
| 1387 | { |
| 1388 | yaml_token_t token; |
| 1389 | |
| 1390 | /* Reset the indentation level. */ |
| 1391 | |
| 1392 | if (!yaml_parser_unroll_indent(parser, -1)) |
| 1393 | return 0; |
| 1394 | |
| 1395 | /* Reset simple keys. */ |
| 1396 | |
| 1397 | if (!yaml_parser_remove_simple_key(parser)) |
| 1398 | return 0; |
| 1399 | |
| 1400 | parser->simple_key_allowed = 0; |
| 1401 | |
| 1402 | /* Create the YAML-DIRECTIVE or TAG-DIRECTIVE token. */ |
| 1403 | |
| 1404 | if (!yaml_parser_scan_directive(parser, &token)) |
| 1405 | return 0; |
| 1406 | |
| 1407 | /* Append the token to the queue. */ |
| 1408 | |
| 1409 | if (!ENQUEUE(parser, parser->tokens, token)) { |
| 1410 | yaml_token_delete(&token); |
| 1411 | return 0; |
| 1412 | } |
| 1413 | |
| 1414 | return 1; |
| 1415 | } |
| 1416 | |
| 1417 | /* |
| 1418 | * Produce the DOCUMENT-START or DOCUMENT-END token. |
no test coverage detected