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

Function yaml_parser_remove_simple_key

xs/tools/yaml/scanner.c:1155–1176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1153 */
1154
1155static int
1156yaml_parser_remove_simple_key(yaml_parser_t *parser)
1157{
1158 yaml_simple_key_t *simple_key = parser->simple_keys.top-1;
1159
1160 if (simple_key->possible)
1161 {
1162 /* If the key is required, it is an error. */
1163
1164 if (simple_key->required) {
1165 return yaml_parser_set_scanner_error(parser,
1166 "while scanning a simple key", simple_key->mark,
1167 "could not find expected ':'");
1168 }
1169 }
1170
1171 /* Remove the key from the stack. */
1172
1173 simple_key->possible = 0;
1174
1175 return 1;
1176}
1177
1178/*
1179 * Increase the flow level and resize the simple key list if needed.

Calls 1

Tested by

no test coverage detected