Get the next token.
(parser *yaml_parser_t, token *yaml_token_t)
| 600 | |
| 601 | // Get the next token. |
| 602 | func yaml_parser_scan(parser *yaml_parser_t, token *yaml_token_t) bool { |
| 603 | // Erase the token object. |
| 604 | *token = yaml_token_t{} // [Go] Is this necessary? |
| 605 | |
| 606 | // No tokens after STREAM-END or error. |
| 607 | if parser.stream_end_produced || parser.error != yaml_NO_ERROR { |
| 608 | return true |
| 609 | } |
| 610 | |
| 611 | // Ensure that the tokens queue contains enough tokens. |
| 612 | if !parser.token_available { |
| 613 | if !yaml_parser_fetch_more_tokens(parser) { |
| 614 | return false |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | // Fetch the next token from the queue. |
| 619 | *token = parser.tokens[parser.tokens_head] |
| 620 | parser.tokens_head++ |
| 621 | parser.tokens_parsed++ |
| 622 | parser.token_available = false |
| 623 | |
| 624 | if token.typ == yaml_STREAM_END_TOKEN { |
| 625 | parser.stream_end_produced = true |
| 626 | } |
| 627 | return true |
| 628 | } |
| 629 | |
| 630 | // Set the scanner error and return false. |
| 631 | func yaml_parser_set_scanner_error(parser *yaml_parser_t, context string, context_mark yaml_mark_t, problem string) bool { |
nothing calls this directly
no test coverage detected