| 1019 | } |
| 1020 | |
| 1021 | static size_t yaml_count_lines(const yaml_doc_t *doc) { |
| 1022 | if (doc->len == 0U) { |
| 1023 | return 0U; |
| 1024 | } |
| 1025 | size_t count = YAML_UNIT; |
| 1026 | for (size_t i = 0; i + YAML_UNIT < doc->len; i++) { |
| 1027 | if (doc->data[i] == '\n') { |
| 1028 | count++; |
| 1029 | } |
| 1030 | } |
| 1031 | return count; |
| 1032 | } |
| 1033 | |
| 1034 | static size_t yaml_parse_line(const yaml_doc_t *doc, size_t start, yaml_line_t *line) { |
| 1035 | size_t end = start; |