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

Function yaml_parser_process_empty_scalar

xs/tools/yaml/parser.c:1231–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1229 */
1230
1231static int
1232yaml_parser_process_empty_scalar(yaml_parser_t *parser, yaml_event_t *event,
1233 yaml_mark_t mark)
1234{
1235 yaml_char_t *value;
1236
1237 value = yaml_malloc(1);
1238 if (!value) {
1239 parser->error = YAML_MEMORY_ERROR;
1240 return 0;
1241 }
1242 value[0] = '\0';
1243
1244 SCALAR_EVENT_INIT(*event, NULL, NULL, value, 0,
1245 1, 0, YAML_PLAIN_SCALAR_STYLE, mark, mark);
1246
1247 return 1;
1248}
1249
1250/*
1251 * Parse directives.

Calls 1

yaml_mallocFunction · 0.85

Tested by

no test coverage detected