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

Function yaml_parser_fetch_directive

scannerc.go:1142–1163  ·  view source on GitHub ↗

Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

1140
1141// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token.
1142func yaml_parser_fetch_directive(parser *yaml_parser_t) bool {
1143 // Reset the indentation level.
1144 if !yaml_parser_unroll_indent(parser, -1, parser.mark) {
1145 return false
1146 }
1147
1148 // Reset simple keys.
1149 if !yaml_parser_remove_simple_key(parser) {
1150 return false
1151 }
1152
1153 parser.simple_key_allowed = false
1154
1155 // Create the YAML-DIRECTIVE or TAG-DIRECTIVE token.
1156 token := yaml_token_t{}
1157 if !yaml_parser_scan_directive(parser, &token) {
1158 return false
1159 }
1160 // Append the token to the queue.
1161 yaml_insert_token(parser, -1, &token)
1162 return true
1163}
1164
1165// Produce the DOCUMENT-START or DOCUMENT-END token.
1166func yaml_parser_fetch_document_indicator(parser *yaml_parser_t, typ yaml_token_type_t) bool {

Callers 1

Calls 4

yaml_insert_tokenFunction · 0.85

Tested by

no test coverage detected