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

Function strip_inline_comment

src/foundation/yaml.c:162–175  ·  view source on GitHub ↗

Strip inline comments from a value string (not inside quotes). * Returns the adjusted length. */

Source from the content-addressed store, hash-verified

160/* Strip inline comments from a value string (not inside quotes).
161 * Returns the adjusted length. */
162static int strip_inline_comment(const char *after, int after_len) {
163 if (after_len > 0 && after[0] != '"' && after[0] != '\'') {
164 for (int i = 0; i < after_len; i++) {
165 if (after[i] == '#' && i > 0 && after[i - SKIP_ONE] == ' ') {
166 after_len = i;
167 while (after_len > 0 && isspace((unsigned char)after[after_len - SKIP_ONE])) {
168 after_len--;
169 }
170 break;
171 }
172 }
173 }
174 return after_len;
175}
176
177/* Peek ahead to check if next content line is a list item. */
178static bool peek_is_list(const char *eol, const char *end) {

Callers 1

parse_key_lineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected