| 903 | */ |
| 904 | |
| 905 | static int |
| 906 | yaml_parser_parse_block_mapping_value(yaml_parser_t *parser, |
| 907 | yaml_event_t *event) |
| 908 | { |
| 909 | yaml_token_t *token; |
| 910 | |
| 911 | token = PEEK_TOKEN(parser); |
| 912 | if (!token) return 0; |
| 913 | |
| 914 | if (token->type == YAML_VALUE_TOKEN) |
| 915 | { |
| 916 | yaml_mark_t mark = token->end_mark; |
| 917 | SKIP_TOKEN(parser); |
| 918 | token = PEEK_TOKEN(parser); |
| 919 | if (!token) return 0; |
| 920 | if (token->type != YAML_KEY_TOKEN && |
| 921 | token->type != YAML_VALUE_TOKEN && |
| 922 | token->type != YAML_BLOCK_END_TOKEN) { |
| 923 | if (!PUSH(parser, parser->states, |
| 924 | YAML_PARSE_BLOCK_MAPPING_KEY_STATE)) |
| 925 | return 0; |
| 926 | return yaml_parser_parse_node(parser, event, 1, 1); |
| 927 | } |
| 928 | else { |
| 929 | parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE; |
| 930 | return yaml_parser_process_empty_scalar(parser, event, mark); |
| 931 | } |
| 932 | } |
| 933 | |
| 934 | else |
| 935 | { |
| 936 | parser->state = YAML_PARSE_BLOCK_MAPPING_KEY_STATE; |
| 937 | return yaml_parser_process_empty_scalar(parser, event, token->start_mark); |
| 938 | } |
| 939 | } |
| 940 | |
| 941 | /* |
| 942 | * Parse the productions: |
no test coverage detected