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

Function yaml_parser_parse_block_mapping_value

external/libyaml/src/parser.c:905–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

903 */
904
905static int
906yaml_parser_parse_block_mapping_value(yaml_parser_t *parser,
907 yaml_event_t *event)
908{
909 yaml_token_t *token;
910
911 token = PEEK_TOKEN(parser);
912 if (!token) return 0;
913
914 if (token->type == YAML_VALUE_TOKEN)
915 {
916 yaml_mark_t mark = token->end_mark;
917 SKIP_TOKEN(parser);
918 token = PEEK_TOKEN(parser);
919 if (!token) return 0;
920 if (token->type != YAML_KEY_TOKEN &&
921 token->type != YAML_VALUE_TOKEN &&
922 token->type != YAML_BLOCK_END_TOKEN) {
923 if (!PUSH(parser, parser->states,
924 YAML_PARSE_BLOCK_MAPPING_KEY_STATE))
925 return 0;
926 return yaml_parser_parse_node(parser, event, 1, 1);
927 }
928 else {
929 parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
930 return yaml_parser_process_empty_scalar(parser, event, mark);
931 }
932 }
933
934 else
935 {
936 parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE;
937 return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
938 }
939}
940
941/*
942 * Parse the productions:

Callers 1

Calls 2

yaml_parser_parse_nodeFunction · 0.85

Tested by

no test coverage detected