| 1070 | } |
| 1071 | |
| 1072 | static size_t yaml_count_lines(const yaml_doc_t *doc) { |
| 1073 | if (doc->len == 0U) { |
| 1074 | return 0U; |
| 1075 | } |
| 1076 | size_t count = YAML_UNIT; |
| 1077 | for (size_t i = 0; i + YAML_UNIT < doc->len; i++) { |
| 1078 | if (doc->data[i] == '\n') { |
| 1079 | count++; |
| 1080 | } |
| 1081 | } |
| 1082 | return count; |
| 1083 | } |
| 1084 | |
| 1085 | static size_t yaml_parse_line(const yaml_doc_t *doc, size_t start, yaml_line_t *line) { |
| 1086 | size_t end = start; |