MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / yaml_parse_line

Function yaml_parse_line

src/cli/config_yaml_edit.c:1085–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083}
1084
1085static size_t yaml_parse_line(const yaml_doc_t *doc, size_t start, yaml_line_t *line) {
1086 size_t end = start;
1087 while (end < doc->len && doc->data[end] != '\n') {
1088 end++;
1089 }
1090 size_t full_end = end < doc->len ? end + YAML_UNIT : end;
1091 size_t text_end = end;
1092 if (text_end > start && doc->data[text_end - YAML_UNIT] == '\r') {
1093 text_end--;
1094 }
1095 size_t indent = start;
1096 while (indent < text_end && doc->data[indent] == ' ') {
1097 indent++;
1098 }
1099 line->start = start;
1100 line->text_end = text_end;
1101 line->end = full_end;
1102 line->indent = indent - start;
1103 line->blank = indent == text_end;
1104 line->comment = !line->blank && doc->data[indent] == '#';
1105 return full_end;
1106}
1107
1108static void yaml_detect_eol(yaml_doc_t *doc) {
1109 doc->eol = "\n";

Callers 1

yaml_build_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected