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

Function yaml_find_comment

src/cli/config_yaml_edit.c:1235–1255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233}
1234
1235static 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, &quote, &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
1257static int yaml_range_has_unsupported(const char *data, size_t start, size_t end) {
1258 char quote = '\0';

Calls 1

yaml_scan_quoteFunction · 0.85

Tested by

no test coverage detected