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

Function yaml_parser_fetch_block_scalar

xs/tools/yaml/scanner.c:1849–1874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1847 */
1848
1849static int
1850yaml_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.

Callers 1

Calls 3

yaml_token_deleteFunction · 0.85

Tested by

no test coverage detected