| 1781 | */ |
| 1782 | |
| 1783 | static int |
| 1784 | yaml_parser_fetch_anchor(yaml_parser_t *parser, yaml_token_type_t type) |
| 1785 | { |
| 1786 | yaml_token_t token; |
| 1787 | |
| 1788 | /* An anchor or an alias could be a simple key. */ |
| 1789 | |
| 1790 | if (!yaml_parser_save_simple_key(parser)) |
| 1791 | return 0; |
| 1792 | |
| 1793 | /* A simple key cannot follow an anchor or an alias. */ |
| 1794 | |
| 1795 | parser->simple_key_allowed = 0; |
| 1796 | |
| 1797 | /* Create the ALIAS or ANCHOR token and append it to the queue. */ |
| 1798 | |
| 1799 | if (!yaml_parser_scan_anchor(parser, &token, type)) |
| 1800 | return 0; |
| 1801 | |
| 1802 | if (!ENQUEUE(parser, parser->tokens, token)) { |
| 1803 | yaml_token_delete(&token); |
| 1804 | return 0; |
| 1805 | } |
| 1806 | return 1; |
| 1807 | } |
| 1808 | |
| 1809 | /* |
| 1810 | * Produce the TAG token. |
no test coverage detected