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

Function yaml_parser_fetch_directive

xs/tools/yaml/scanner.c:1390–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 4

yaml_token_deleteFunction · 0.85

Tested by

no test coverage detected