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

Function yaml_parser_parse_indentless_sequence_entry

parserc.go:744–778  ·  parserc.go::yaml_parser_parse_indentless_sequence_entry

Parse the productions: indentless_sequence ::= (BLOCK-ENTRY block_node?)+ *********** *

(parser *yaml_parser_t, event *yaml_event_t)

Source from the content-addressed store, hash-verified

742// indentless_sequence ::= (BLOCK-ENTRY block_node?)+
743// *********** *
744func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool {
745 token := peek_token(parser)
746 if token == nil {
747 return false
748 }
749
750 if token.typ == yaml_BLOCK_ENTRY_TOKEN {
751 mark := token.end_mark
752 prior_head_len := len(parser.head_comment)
753 skip_token(parser)
754 yaml_parser_split_stem_comment(parser, prior_head_len)
755 token = peek_token(parser)
756 if token == nil {
757 return false
758 }
759 if token.typ != yaml_BLOCK_ENTRY_TOKEN &&
760 token.typ != yaml_KEY_TOKEN &&
761 token.typ != yaml_VALUE_TOKEN &&
762 token.typ != yaml_BLOCK_END_TOKEN {
763 parser.states = append(parser.states, yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE)
764 return yaml_parser_parse_node(parser, event, true, false)
765 }
766 parser.state = yaml_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE
767 return yaml_parser_process_empty_scalar(parser, event, mark)
768 }
769 parser.state = parser.states[len(parser.states)-1]
770 parser.states = parser.states[:len(parser.states)-1]
771
772 *event = yaml_event_t{
773 typ: yaml_SEQUENCE_END_EVENT,
774 start_mark: token.start_mark,
775 end_mark: token.start_mark, // [Go] Shouldn't this be token.end_mark?
776 }
777 return true
778}
779
780// Split stem comment from head comment.
781//

Callers 1

Calls 5

peek_tokenFunction · 0.85
skip_tokenFunction · 0.85
yaml_parser_parse_nodeFunction · 0.85

Tested by

no test coverage detected