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

Function yaml_parser_parse_flow_mapping_value

external/libyaml/src/parser.c:1181–1211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179 */
1180
1181static int
1182yaml_parser_parse_flow_mapping_value(yaml_parser_t *parser,
1183 yaml_event_t *event, int empty)
1184{
1185 yaml_token_t *token;
1186
1187 token = PEEK_TOKEN(parser);
1188 if (!token) return 0;
1189
1190 if (empty) {
1191 parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
1192 return yaml_parser_process_empty_scalar(parser, event,
1193 token->start_mark);
1194 }
1195
1196 if (token->type == YAML_VALUE_TOKEN) {
1197 SKIP_TOKEN(parser);
1198 token = PEEK_TOKEN(parser);
1199 if (!token) return 0;
1200 if (token->type != YAML_FLOW_ENTRY_TOKEN
1201 && token->type != YAML_FLOW_MAPPING_END_TOKEN) {
1202 if (!PUSH(parser, parser->states,
1203 YAML_PARSE_FLOW_MAPPING_KEY_STATE))
1204 return 0;
1205 return yaml_parser_parse_node(parser, event, 0, 0);
1206 }
1207 }
1208
1209 parser->state = YAML_PARSE_FLOW_MAPPING_KEY_STATE;
1210 return yaml_parser_process_empty_scalar(parser, event, token->start_mark);
1211}
1212
1213/*
1214 * Generate an empty scalar event.

Callers 1

Calls 2

yaml_parser_parse_nodeFunction · 0.85

Tested by

no test coverage detected