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

Function sig_callable_leaf_before

internal/cbm/callable_sig.c:1084–1104  ·  view source on GitHub ↗

Whether qn[0..end) ends in a leaf a suffix may follow: an identifier (but * not a make `$(VAR)` reference), the '>' closing template parameters, a C++ * `operator...` leaf, or operator symbols — alone (Swift/Scala `+`, `==`) or * after a Scala `_` (`unary_!`). A path such as `app/(auth)`, an anonymous * `(anon)` leaf or an empty leaf is never a callable followed by a suffix. */

Source from the content-addressed store, hash-verified

1082 * after a Scala `_` (`unary_!`). A path such as `app/(auth)`, an anonymous
1083 * `(anon)` leaf or an empty leaf is never a callable followed by a suffix. */
1084static bool sig_callable_leaf_before(const char *qn, size_t end) {
1085 size_t start = end;
1086 while (start > 0 && qn[start - 1] != '.') {
1087 start--;
1088 }
1089 if (start == end) {
1090 return false;
1091 }
1092 unsigned char last = (unsigned char)qn[end - 1];
1093 if (last == '>' || (sig_ident_char(last) && last != '$')) {
1094 return true;
1095 }
1096 if (end - start >= SIG_OPERATOR_LEN && memcmp(qn + start, "operator", SIG_OPERATOR_LEN) == 0) {
1097 return true;
1098 }
1099 size_t op = end;
1100 while (op > start && strchr(SIG_OPERATOR_CHARS, qn[op - 1]) != NULL) {
1101 op--;
1102 }
1103 return op < end && (op == start || qn[op - 1] == '_');
1104}
1105
1106size_t cbm_qn_callable_base_len_named(const char *qn, const char *name) {
1107 size_t base = cbm_qn_callable_base_len(qn);

Callers 1

cbm_qn_callable_base_lenFunction · 0.85

Calls 1

sig_ident_charFunction · 0.85

Tested by

no test coverage detected