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

Function op_args_end

src/pipeline/pass_operator.c:403–433  ·  view source on GitHub ↗

The end of the argument list opened at `open` ('('), balanced; parentheses * in `//` comments and literals do not count. */

Source from the content-addressed store, hash-verified

401/* The end of the argument list opened at `open` ('('), balanced; parentheses
402 * in `//` comments and literals do not count. */
403static const char *op_args_end(const char *open) {
404 int depth = 0;
405 char quote = 0;
406 for (const char *p = open; *p; p++) {
407 if (quote) {
408 if (*p == '\\' && quote != '`' && p[SKIP_ONE]) {
409 p++;
410 } else if (*p == quote || (*p == '\n' && quote != '`')) {
411 quote = 0;
412 }
413 continue;
414 }
415 if (op_is_quote(*p)) {
416 quote = *p;
417 continue;
418 }
419 if (*p == '/' && p[SKIP_ONE] == '/') {
420 p = strchr(p, '\n');
421 if (!p) {
422 break;
423 }
424 continue;
425 }
426 depth += *p == '(';
427 depth -= *p == ')';
428 if (depth == 0) {
429 return p;
430 }
431 }
432 return open + strlen(open);
433}
434
435static bool op_ident_char(char c) {
436 return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_';

Callers 1

op_controller_callsFunction · 0.85

Calls 1

op_is_quoteFunction · 0.85

Tested by

no test coverage detected