MCPcopy
hub / github.com/go-yaml/yaml / yaml_parser_fetch_plain_scalar

Function yaml_parser_fetch_plain_scalar

scannerc.go:1516–1532  ·  view source on GitHub ↗

Produce the SCALAR(...,plain) token.

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

1514
1515// Produce the SCALAR(...,plain) token.
1516func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {
1517 // A plain scalar could be a simple key.
1518 if !yaml_parser_save_simple_key(parser) {
1519 return false
1520 }
1521
1522 // A simple key cannot follow a flow scalar.
1523 parser.simple_key_allowed = false
1524
1525 // Create the SCALAR token and append it to the queue.
1526 var token yaml_token_t
1527 if !yaml_parser_scan_plain_scalar(parser, &token) {
1528 return false
1529 }
1530 yaml_insert_token(parser, -1, &token)
1531 return true
1532}
1533
1534// Eat whitespaces and comments until the next token is found.
1535func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool {

Callers 1

Calls 3

yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected