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

Function cpp_view_keeps

internal/cbm/cpp_branch_views.c:147–158  ·  view source on GitHub ↗

The current line belongs to the view: every enclosing group sits in the branch the view keeps.

Source from the content-addressed store, hash-verified

145// The current line belongs to the view: every enclosing group sits in the
146// branch the view keeps.
147static bool cpp_view_keeps(const cpp_nest_t *n, const int *branches, int view) {
148 if (n->depth == 0) {
149 return true;
150 }
151 const cpp_frame_t *top = &n->frames[n->depth - 1];
152 int nb = branches[top->group];
153 int kept = 0;
154 if (nb >= 2) {
155 kept = view < nb - 1 ? view : nb - 1;
156 }
157 return top->outer && top->branch == kept;
158}
159
160char *cbm_cpp_branch_view(CBMArena *a, const char *src, int len, int view) {
161 int *branches = NULL;

Callers 1

cbm_cpp_branch_viewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected