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

Function yaml_parser_remove_simple_key

scannerc.go:939–953  ·  view source on GitHub ↗

Remove a potential simple key at the current flow level.

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

937
938// Remove a potential simple key at the current flow level.
939func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
940 i := len(parser.simple_keys) - 1
941 if parser.simple_keys[i].possible {
942 // If the key is required, it is an error.
943 if parser.simple_keys[i].required {
944 return yaml_parser_set_scanner_error(parser,
945 "while scanning a simple key", parser.simple_keys[i].mark,
946 "could not find expected ':'")
947 }
948 // Remove the key from the stack.
949 parser.simple_keys[i].possible = false
950 delete(parser.simple_keys_by_tok, parser.simple_keys[i].token_number)
951 }
952 return true
953}
954
955// max_flow_level limits the flow_level
956const max_flow_level = 10000

Calls 1

Tested by

no test coverage detected