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

Function yaml_parser_fetch_anchor

scannerc.go:1440–1456  ·  view source on GitHub ↗

Produce the ALIAS or ANCHOR token.

(parser *yaml_parser_t, typ yaml_token_type_t)

Source from the content-addressed store, hash-verified

1438
1439// Produce the ALIAS or ANCHOR token.
1440func yaml_parser_fetch_anchor(parser *yaml_parser_t, typ yaml_token_type_t) bool {
1441 // An anchor or an alias could be a simple key.
1442 if !yaml_parser_save_simple_key(parser) {
1443 return false
1444 }
1445
1446 // A simple key cannot follow an anchor or an alias.
1447 parser.simple_key_allowed = false
1448
1449 // Create the ALIAS or ANCHOR token and append it to the queue.
1450 var token yaml_token_t
1451 if !yaml_parser_scan_anchor(parser, &token, typ) {
1452 return false
1453 }
1454 yaml_insert_token(parser, -1, &token)
1455 return true
1456}
1457
1458// Produce the TAG token.
1459func yaml_parser_fetch_tag(parser *yaml_parser_t) bool {

Callers 1

Calls 3

yaml_parser_scan_anchorFunction · 0.85
yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected