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

Function dg_flowchart

internal/cbm/diagram.c:622–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

620}
621
622static void dg_flowchart(dg_t *dg, dg_lines_t *it) {
623 dg_str_t ln;
624 uint32_t line = 0;
625 while (dg_next_line(it, &ln, &line)) {
626 ln = dg_mermaid_strip(ln);
627 size_t start = 0;
628 bool quoted = false;
629 int depth = 0;
630 for (size_t i = 0; i <= ln.n; i++) {
631 char c = i < ln.n ? ln.p[i] : ';';
632 quoted = c == '"' ? !quoted : quoted;
633 depth += !quoted && (c == '[' || c == '(' || c == '{');
634 depth -= !quoted && (c == ']' || c == ')' || c == '}') && depth > 0;
635 if (c == ';' && !quoted && depth == 0) {
636 dg_str_t st = dg_trim(dg_s(ln.p + start, i - start));
637 if (st.n) {
638 dg_flow_statement(dg, st, line);
639 }
640 start = i + SKIP_ONE;
641 }
642 }
643 }
644}
645
646/* ── Mermaid: sequence ───────────────────────────────────────────── */
647

Callers

nothing calls this directly

Calls 5

dg_next_lineFunction · 0.85
dg_mermaid_stripFunction · 0.85
dg_trimFunction · 0.85
dg_sFunction · 0.85
dg_flow_statementFunction · 0.85

Tested by

no test coverage detected