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

Function yaml_parser_fetch_flow_collection_start

scannerc.go:1200–1229  ·  scannerc.go::yaml_parser_fetch_flow_collection_start

Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.

(parser *yaml_parser_t, typ yaml_token_type_t)

Source from the content-addressed store, hash-verified

1198
1199// Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token.
1200func yaml_parser_fetch_flow_collection_start(parser *yaml_parser_t, typ yaml_token_type_t) bool {
1201
1202 // The indicators '[' and '{' may start a simple key.
1203 if !yaml_parser_save_simple_key(parser) {
1204 return false
1205 }
1206
1207 // Increase the flow level.
1208 if !yaml_parser_increase_flow_level(parser) {
1209 return false
1210 }
1211
1212 // A simple key may follow the indicators '[' and '{'.
1213 parser.simple_key_allowed = true
1214
1215 // Consume the token.
1216 start_mark := parser.mark
1217 skip(parser)
1218 end_mark := parser.mark
1219
1220 // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token.
1221 token := yaml_token_t{
1222 typ: typ,
1223 start_mark: start_mark,
1224 end_mark: end_mark,
1225 }
1226 // Append the token to the queue.
1227 yaml_insert_token(parser, -1, &token)
1228 return true
1229}
1230
1231// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token.
1232func yaml_parser_fetch_flow_collection_end(parser *yaml_parser_t, typ yaml_token_type_t) bool {

Callers 1

Calls 4

skipFunction · 0.85
yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected