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

Function op_comment_start

src/pipeline/pass_operator.c:354–370  ·  view source on GitHub ↗

Where a `//` comment starts in the line text [ls, le), outside string and * rune literals; le when there is none. */

Source from the content-addressed store, hash-verified

352/* Where a `//` comment starts in the line text [ls, le), outside string and
353 * rune literals; le when there is none. */
354static const char *op_comment_start(const char *ls, const char *le) {
355 char quote = 0;
356 for (const char *p = ls; p < le; p++) {
357 if (quote) {
358 if (*p == '\\' && quote != '`' && p + SKIP_ONE < le) {
359 p++;
360 } else if (*p == quote) {
361 quote = 0;
362 }
363 } else if (op_is_quote(*p)) {
364 quote = *p;
365 } else if (*p == '/' && p + SKIP_ONE < le && p[SKIP_ONE] == '/') {
366 return p;
367 }
368 }
369 return le;
370}
371
372static const char *op_line_start(const char *text, const char *p) {
373 while (p > text && p[-SKIP_ONE] != '\n') {

Callers 4

op_prev_codeFunction · 0.85
op_controller_callsFunction · 0.85
gc_const_lineFunction · 0.85
gc_localFunction · 0.85

Calls 1

op_is_quoteFunction · 0.85

Tested by

no test coverage detected