MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / yaml_parser_fetch_flow_scalar

Function yaml_parser_fetch_flow_scalar

xs/tools/yaml/scanner.c:1880–1905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1878 */
1879
1880static int
1881yaml_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.

Callers 1

Calls 3

yaml_token_deleteFunction · 0.85

Tested by

no test coverage detected