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

Function yaml_parser_increase_flow_level

scannerc.go:959–976  ·  scannerc.go::yaml_parser_increase_flow_level

Increase the flow level and resize the simple key list if needed.

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

957
958// Increase the flow level and resize the simple key list if needed.
959func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
960 // Reset the simple key on the next level.
961 parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{
962 possible: false,
963 required: false,
964 token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
965 mark: parser.mark,
966 })
967
968 // Increase the flow level.
969 parser.flow_level++
970 if parser.flow_level > max_flow_level {
971 return yaml_parser_set_scanner_error(parser,
972 "while increasing flow level", parser.simple_keys[len(parser.simple_keys)-1].mark,
973 fmt.Sprintf("exceeded max depth of %d", max_flow_level))
974 }
975 return true
976}
977
978// Decrease the flow level.
979func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {

Calls 1

Tested by

no test coverage detected