| 1904 | */ |
| 1905 | |
| 1906 | static int |
| 1907 | yaml_parser_fetch_plain_scalar(yaml_parser_t *parser) |
| 1908 | { |
| 1909 | yaml_token_t token; |
| 1910 | |
| 1911 | /* A plain scalar could be a simple key. */ |
| 1912 | |
| 1913 | if (!yaml_parser_save_simple_key(parser)) |
| 1914 | return 0; |
| 1915 | |
| 1916 | /* A simple key cannot follow a flow scalar. */ |
| 1917 | |
| 1918 | parser->simple_key_allowed = 0; |
| 1919 | |
| 1920 | /* Create the SCALAR token and append it to the queue. */ |
| 1921 | |
| 1922 | if (!yaml_parser_scan_plain_scalar(parser, &token)) |
| 1923 | return 0; |
| 1924 | |
| 1925 | if (!ENQUEUE(parser, parser->tokens, token)) { |
| 1926 | yaml_token_delete(&token); |
| 1927 | return 0; |
| 1928 | } |
| 1929 | |
| 1930 | return 1; |
| 1931 | } |
| 1932 | |
| 1933 | /* |
| 1934 | * Eat whitespaces and comments until the next token is found. |
no test coverage detected