| 1233 | } |
| 1234 | |
| 1235 | static int yaml_find_comment(const char *data, size_t start, size_t end, size_t *out_comment) { |
| 1236 | char quote = '\0'; |
| 1237 | for (size_t i = start; i < end; i++) { |
| 1238 | bool is_plain = false; |
| 1239 | if (yaml_scan_quote(data, end, &i, "e, &is_plain) != 0) { |
| 1240 | return YAML_ERROR; |
| 1241 | } |
| 1242 | if (!is_plain) { |
| 1243 | continue; |
| 1244 | } |
| 1245 | if (data[i] == '#' && (i == start || data[i - YAML_UNIT] == ' ')) { |
| 1246 | *out_comment = i; |
| 1247 | return 0; |
| 1248 | } |
| 1249 | } |
| 1250 | if (quote != '\0') { |
| 1251 | return YAML_ERROR; |
| 1252 | } |
| 1253 | *out_comment = end; |
| 1254 | return 0; |
| 1255 | } |
| 1256 | |
| 1257 | static int yaml_range_has_unsupported(const char *data, size_t start, size_t end) { |
| 1258 | char quote = '\0'; |
no test coverage detected