MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / yaml_parser_parse_stream_start

Function yaml_parser_parse_stream_start

xs/tools/yaml/parser.c:334–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 */
333
334static int
335yaml_parser_parse_stream_start(yaml_parser_t *parser, yaml_event_t *event)
336{
337 yaml_token_t *token;
338
339 token = PEEK_TOKEN(parser);
340 if (!token) return 0;
341
342 if (token->type != YAML_STREAM_START_TOKEN) {
343 return yaml_parser_set_parser_error(parser,
344 "did not find expected <stream-start>", token->start_mark);
345 }
346
347 parser->state = YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE;
348 STREAM_START_EVENT_INIT(*event, token->data.stream_start.encoding,
349 token->start_mark, token->start_mark);
350 SKIP_TOKEN(parser);
351
352 return 1;
353}
354
355/*
356 * Parse the productions:

Callers 1

Calls 1

Tested by

no test coverage detected