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

Function dg_sequence

internal/cbm/diagram.c:676–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676static void dg_sequence(dg_t *dg, dg_lines_t *it) {
677 static const char participant[] = "participant ";
678 dg_str_t ln;
679 uint32_t line = 0;
680 while (dg_next_line(it, &ln, &line)) {
681 ln = dg_mermaid_strip(ln);
682 if (dg_starts(ln, "create ")) {
683 ln = dg_trim(dg_s(ln.p + CBM_SZ_7, ln.n - CBM_SZ_7));
684 }
685 bool actor = dg_starts(ln, "actor ");
686 if (actor || dg_starts(ln, participant)) {
687 size_t kl = actor ? CBM_SZ_6 : sizeof(participant) - SKIP_ONE;
688 dg_str_t rest = dg_trim(dg_s(ln.p + kl, ln.n - kl));
689 dg_str_t id = rest;
690 dg_str_t label = dg_s(NULL, 0);
691 for (size_t i = 0; i + CBM_SZ_4 <= rest.n; i++) {
692 if (memcmp(rest.p + i, " as ", CBM_SZ_4) == 0) {
693 id = dg_s(rest.p, i);
694 label = dg_s(rest.p + i + CBM_SZ_4, rest.n - i - CBM_SZ_4);
695 break;
696 }
697 }
698 dg_element(dg, id, label, actor ? "actor" : "participant", line);
699 continue;
700 }
701 (void)dg_sequence_message(dg, ln, line);
702 }
703}
704
705/* ── Mermaid: class and ER ───────────────────────────────────────── */
706

Callers

nothing calls this directly

Calls 7

dg_next_lineFunction · 0.85
dg_mermaid_stripFunction · 0.85
dg_startsFunction · 0.85
dg_trimFunction · 0.85
dg_sFunction · 0.85
dg_elementFunction · 0.85
dg_sequence_messageFunction · 0.85

Tested by

no test coverage detected