| 1847 | */ |
| 1848 | |
| 1849 | static int |
| 1850 | yaml_parser_fetch_block_scalar(yaml_parser_t *parser, int literal) |
| 1851 | { |
| 1852 | yaml_token_t token; |
| 1853 | |
| 1854 | /* Remove any potential simple keys. */ |
| 1855 | |
| 1856 | if (!yaml_parser_remove_simple_key(parser)) |
| 1857 | return 0; |
| 1858 | |
| 1859 | /* A simple key may follow a block scalar. */ |
| 1860 | |
| 1861 | parser->simple_key_allowed = 1; |
| 1862 | |
| 1863 | /* Create the SCALAR token and append it to the queue. */ |
| 1864 | |
| 1865 | if (!yaml_parser_scan_block_scalar(parser, &token, literal)) |
| 1866 | return 0; |
| 1867 | |
| 1868 | if (!ENQUEUE(parser, parser->tokens, token)) { |
| 1869 | yaml_token_delete(&token); |
| 1870 | return 0; |
| 1871 | } |
| 1872 | |
| 1873 | return 1; |
| 1874 | } |
| 1875 | |
| 1876 | /* |
| 1877 | * Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. |
no test coverage detected