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

Function yaml_parser_load_document

external/libyaml/src/loader.c:184–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 */
183
184static int
185yaml_parser_load_document(yaml_parser_t *parser, yaml_event_t *event)
186{
187 struct loader_ctx ctx = { NULL, NULL, NULL };
188
189 assert(event->type == YAML_DOCUMENT_START_EVENT);
190 /* DOCUMENT-START is expected. */
191
192 parser->document->version_directive
193 = event->data.document_start.version_directive;
194 parser->document->tag_directives.start
195 = event->data.document_start.tag_directives.start;
196 parser->document->tag_directives.end
197 = event->data.document_start.tag_directives.end;
198 parser->document->start_implicit
199 = event->data.document_start.implicit;
200 parser->document->start_mark = event->start_mark;
201
202 if (!STACK_INIT(parser, ctx, int*)) return 0;
203 if (!yaml_parser_load_nodes(parser, &ctx)) {
204 STACK_DEL(parser, ctx);
205 return 0;
206 }
207 STACK_DEL(parser, ctx);
208
209 return 1;
210}
211
212/*
213 * Compose a node tree.

Callers 1

yaml_parser_loadFunction · 0.85

Calls 1

yaml_parser_load_nodesFunction · 0.85

Tested by

no test coverage detected