Parse the production: stream ::= STREAM-START implicit_document? explicit_document* STREAM-END ************
(parser *yaml_parser_t, event *yaml_event_t)
| 229 | // stream ::= STREAM-START implicit_document? explicit_document* STREAM-END |
| 230 | // ************ |
| 231 | func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { |
| 232 | token := peek_token(parser) |
| 233 | if token == nil { |
| 234 | return false |
| 235 | } |
| 236 | if token.typ != yaml_STREAM_START_TOKEN { |
| 237 | return yaml_parser_set_parser_error(parser, "did not find expected <stream-start>", token.start_mark) |
| 238 | } |
| 239 | parser.state = yaml_PARSE_IMPLICIT_DOCUMENT_START_STATE |
| 240 | *event = yaml_event_t{ |
| 241 | typ: yaml_STREAM_START_EVENT, |
| 242 | start_mark: token.start_mark, |
| 243 | end_mark: token.end_mark, |
| 244 | encoding: token.encoding, |
| 245 | } |
| 246 | skip_token(parser) |
| 247 | return true |
| 248 | } |
| 249 | |
| 250 | // Parse the productions: |
| 251 | // implicit_document ::= block_node DOCUMENT-END* |
no test coverage detected