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

Function yaml_parser_fetch_stream_end

scannerc.go:1111–1139  ·  view source on GitHub ↗

Produce the STREAM-END token and shut down the scanner.

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

1109
1110// Produce the STREAM-END token and shut down the scanner.
1111func yaml_parser_fetch_stream_end(parser *yaml_parser_t) bool {
1112
1113 // Force new line.
1114 if parser.mark.column != 0 {
1115 parser.mark.column = 0
1116 parser.mark.line++
1117 }
1118
1119 // Reset the indentation level.
1120 if !yaml_parser_unroll_indent(parser, -1, parser.mark) {
1121 return false
1122 }
1123
1124 // Reset simple keys.
1125 if !yaml_parser_remove_simple_key(parser) {
1126 return false
1127 }
1128
1129 parser.simple_key_allowed = false
1130
1131 // Create the STREAM-END token and append it to the queue.
1132 token := yaml_token_t{
1133 typ: yaml_STREAM_END_TOKEN,
1134 start_mark: parser.mark,
1135 end_mark: parser.mark,
1136 }
1137 yaml_insert_token(parser, -1, &token)
1138 return true
1139}
1140
1141// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.
1142func yaml_parser_fetch_directive(parser *yaml_parser_t) bool {

Callers 1

Calls 3

yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected