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

Function peek_token

parserc.go:68–75  ·  parserc.go::peek_token

The parser implements the following grammar: stream ::= STREAM-START implicit_document? explicit_document* STREAM-END implicit_document ::= block_node DOCUMENT-END* explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* block_node_or_indentless_sequence ::=

(parser *yaml_parser_t)

Source from the content-addressed store, hash-verified

66
67// Peek the next token in the token queue.
68func peek_token(parser *yaml_parser_t) *yaml_token_t {
69 if parser.token_available || yaml_parser_fetch_more_tokens(parser) {
70 token := &parser.tokens[parser.tokens_head]
71 yaml_parser_unfold_comments(parser, token)
72 return token
73 }
74 return nil
75}
76
77// yaml_parser_unfold_comments walks through the comments queue and joins all
78// comments behind the position of the provided token into the respective

Calls 2

Tested by

no test coverage detected