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

Function yaml_parser_fetch_plain_scalar

xs/tools/yaml/scanner.c:1911–1936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

yaml_token_deleteFunction · 0.85

Tested by

no test coverage detected