| 1878 | */ |
| 1879 | |
| 1880 | static int |
| 1881 | yaml_parser_fetch_flow_scalar(yaml_parser_t *parser, int single) |
| 1882 | { |
| 1883 | yaml_token_t token; |
| 1884 | |
| 1885 | /* A plain scalar could be a simple key. */ |
| 1886 | |
| 1887 | if (!yaml_parser_save_simple_key(parser)) |
| 1888 | return 0; |
| 1889 | |
| 1890 | /* A simple key cannot follow a flow scalar. */ |
| 1891 | |
| 1892 | parser->simple_key_allowed = 0; |
| 1893 | |
| 1894 | /* Create the SCALAR token and append it to the queue. */ |
| 1895 | |
| 1896 | if (!yaml_parser_scan_flow_scalar(parser, &token, single)) |
| 1897 | return 0; |
| 1898 | |
| 1899 | if (!ENQUEUE(parser, parser->tokens, token)) { |
| 1900 | yaml_token_delete(&token); |
| 1901 | return 0; |
| 1902 | } |
| 1903 | |
| 1904 | return 1; |
| 1905 | } |
| 1906 | |
| 1907 | /* |
| 1908 | * Produce the SCALAR(...,plain) token. |
no test coverage detected