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

Function yaml_parser_load_nodes

external/libyaml/src/loader.c:216–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 */
215
216static int
217yaml_parser_load_nodes(yaml_parser_t *parser, struct loader_ctx *ctx)
218{
219 yaml_event_t event;
220
221 do {
222 if (!yaml_parser_parse(parser, &event)) return 0;
223
224 switch (event.type) {
225 case YAML_ALIAS_EVENT:
226 if (!yaml_parser_load_alias(parser, &event, ctx)) return 0;
227 break;
228 case YAML_SCALAR_EVENT:
229 if (!yaml_parser_load_scalar(parser, &event, ctx)) return 0;
230 break;
231 case YAML_SEQUENCE_START_EVENT:
232 if (!yaml_parser_load_sequence(parser, &event, ctx)) return 0;
233 break;
234 case YAML_SEQUENCE_END_EVENT:
235 if (!yaml_parser_load_sequence_end(parser, &event, ctx))
236 return 0;
237 break;
238 case YAML_MAPPING_START_EVENT:
239 if (!yaml_parser_load_mapping(parser, &event, ctx)) return 0;
240 break;
241 case YAML_MAPPING_END_EVENT:
242 if (!yaml_parser_load_mapping_end(parser, &event, ctx))
243 return 0;
244 break;
245 default:
246 assert(0); /* Could not happen. */
247 return 0;
248 case YAML_DOCUMENT_END_EVENT:
249 break;
250 }
251 } while (event.type != YAML_DOCUMENT_END_EVENT);
252
253 parser->document->end_implicit = event.data.document_end.implicit;
254 parser->document->end_mark = event.end_mark;
255
256 return 1;
257}
258
259/*
260 * Add an anchor.

Callers 1

Calls 7

yaml_parser_parseFunction · 0.85
yaml_parser_load_aliasFunction · 0.85
yaml_parser_load_scalarFunction · 0.85
yaml_parser_load_mappingFunction · 0.85

Tested by

no test coverage detected