| 279 | */ |
| 280 | |
| 281 | static int |
| 282 | yaml_parser_load_alias(yaml_parser_t *parser, yaml_event_t *first_event) |
| 283 | { |
| 284 | yaml_char_t *anchor = first_event->data.alias.anchor; |
| 285 | yaml_alias_data_t *alias_data; |
| 286 | |
| 287 | for (alias_data = parser->aliases.start; |
| 288 | alias_data != parser->aliases.top; alias_data ++) { |
| 289 | if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) { |
| 290 | yaml_free(anchor); |
| 291 | return alias_data->index; |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | yaml_free(anchor); |
| 296 | return yaml_parser_set_composer_error(parser, "found undefined alias", |
| 297 | first_event->start_mark); |
| 298 | } |
| 299 | |
| 300 | /* |
| 301 | * Compose a scalar node. |
no test coverage detected