MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / yaml_parser_fetch_document_indicator

Function yaml_parser_fetch_document_indicator

external/libyaml/src/scanner.c:1421–1460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419 */
1420
1421static int
1422yaml_parser_fetch_document_indicator(yaml_parser_t *parser,
1423 yaml_token_type_t type)
1424{
1425 yaml_mark_t start_mark, end_mark;
1426 yaml_token_t token;
1427
1428 /* Reset the indentation level. */
1429
1430 if (!yaml_parser_unroll_indent(parser, -1))
1431 return 0;
1432
1433 /* Reset simple keys. */
1434
1435 if (!yaml_parser_remove_simple_key(parser))
1436 return 0;
1437
1438 parser->simple_key_allowed = 0;
1439
1440 /* Consume the token. */
1441
1442 start_mark = parser->mark;
1443
1444 SKIP(parser);
1445 SKIP(parser);
1446 SKIP(parser);
1447
1448 end_mark = parser->mark;
1449
1450 /* Create the DOCUMENT-START or DOCUMENT-END token. */
1451
1452 TOKEN_INIT(token, type, start_mark, end_mark);
1453
1454 /* Append the token to the queue. */
1455
1456 if (!ENQUEUE(parser, parser->tokens, token))
1457 return 0;
1458
1459 return 1;
1460}
1461
1462/*
1463 * Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.

Callers 1

Calls 2

Tested by

no test coverage detected