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

Function dg_class_decl

internal/cbm/diagram.c:777–790  ·  view source on GitHub ↗

The name of `class Name~T~["Label"] {`, its label in *label. */

Source from the content-addressed store, hash-verified

775
776/* The name of `class Name~T~["Label"] {`, its label in *label. */
777static dg_str_t dg_class_decl(dg_str_t rest, dg_str_t *label) {
778 size_t j = 0;
779 while (j < rest.n && (dg_id_char(rest.p[j]) || rest.p[j] == '.')) {
780 j++;
781 }
782 dg_str_t name = dg_s(rest.p, j);
783 *label = dg_s(NULL, 0);
784 const char *lb = memchr(rest.p + j, '[', rest.n - j);
785 const char *rb = lb ? memchr(lb, ']', (size_t)(rest.p + rest.n - lb)) : NULL;
786 if (lb && rb) {
787 *label = dg_s(lb + SKIP_ONE, (size_t)(rb - lb) - SKIP_ONE);
788 }
789 return name;
790}
791
792static void dg_classdiagram(dg_t *dg, dg_lines_t *it) {
793 dg_str_t ln;

Callers 1

dg_classdiagramFunction · 0.85

Calls 2

dg_id_charFunction · 0.85
dg_sFunction · 0.85

Tested by

no test coverage detected