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

Function dg_dot

internal/cbm/diagram.c:1837–1855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1835}
1836
1837static void dg_dot(dg_t *dg, dg_lines_t *it, dg_str_t *title) {
1838 dt_lex_t lx = {it->p, it->end, it->line, {DT_END, {NULL, 0}, 0}};
1839 dt_next(&lx);
1840 if (lx.tok.k == DT_ID && dg_eq(lx.tok.s, "strict")) {
1841 dt_next(&lx);
1842 }
1843 bool directed = lx.tok.k == DT_ID && dg_eq(lx.tok.s, "digraph");
1844 snprintf(dg->kind, sizeof(dg->kind), "%s", directed ? "digraph" : "graph");
1845 dg->element_kind = "node";
1846 while (lx.tok.k != DT_LBRACE && lx.tok.k != DT_END) {
1847 dt_next(&lx);
1848 }
1849 if (lx.tok.k == DT_END) {
1850 return;
1851 }
1852 dt_next(&lx);
1853 dt_set_t all = {.n = 0};
1854 dt_stmts(dg, &lx, directed, &all, 0, title);
1855}
1856
1857/* ── D2 ──────────────────────────────────────────────────────────── */
1858

Callers 1

dg_buildFunction · 0.85

Calls 3

dt_nextFunction · 0.85
dg_eqFunction · 0.85
dt_stmtsFunction · 0.85

Tested by

no test coverage detected