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

Function yaml_parser_fetch_block_scalar

scannerc.go:1478–1494  ·  view source on GitHub ↗

Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.

(parser *yaml_parser_t, literal bool)

Source from the content-addressed store, hash-verified

1476
1477// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens.
1478func yaml_parser_fetch_block_scalar(parser *yaml_parser_t, literal bool) bool {
1479 // Remove any potential simple keys.
1480 if !yaml_parser_remove_simple_key(parser) {
1481 return false
1482 }
1483
1484 // A simple key may follow a block scalar.
1485 parser.simple_key_allowed = true
1486
1487 // Create the SCALAR token and append it to the queue.
1488 var token yaml_token_t
1489 if !yaml_parser_scan_block_scalar(parser, &token, literal) {
1490 return false
1491 }
1492 yaml_insert_token(parser, -1, &token)
1493 return true
1494}
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 {

Callers 1

Calls 3

yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected