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

Function yaml_parser_fetch_flow_scalar

scannerc.go:1497–1513  ·  view source on GitHub ↗

Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.

(parser *yaml_parser_t, single bool)

Source from the content-addressed store, hash-verified

1495
1496// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens.
1497func yaml_parser_fetch_flow_scalar(parser *yaml_parser_t, single bool) bool {
1498 // A plain scalar could be a simple key.
1499 if !yaml_parser_save_simple_key(parser) {
1500 return false
1501 }
1502
1503 // A simple key cannot follow a flow scalar.
1504 parser.simple_key_allowed = false
1505
1506 // Create the SCALAR token and append it to the queue.
1507 var token yaml_token_t
1508 if !yaml_parser_scan_flow_scalar(parser, &token, single) {
1509 return false
1510 }
1511 yaml_insert_token(parser, -1, &token)
1512 return true
1513}
1514
1515// Produce the SCALAR(...,plain) token.
1516func yaml_parser_fetch_plain_scalar(parser *yaml_parser_t) bool {

Callers 1

Calls 3

yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected