aboutsummaryrefslogtreecommitdiffstats
path: root/src/viz.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2022-04-18 16:27:21 -0300
committerBad Diode <bd@badd10de.dev>2022-04-18 16:27:21 -0300
commit3da041f2e17fdeb69bf345aadf89c5fcc1814260 (patch)
treec1979ffee13f45f757712a61304a3edba89a80f5 /src/viz.c
parentdcd3192e50d7b4ea333ecf57a7e8b325af145547 (diff)
downloadbdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.tar.gz
bdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.zip
Move semantic analysis to separate file
Diffstat (limited to 'src/viz.c')
-rw-r--r--src/viz.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/viz.c b/src/viz.c
index 81cc1ff..d519d2c 100644
--- a/src/viz.c
+++ b/src/viz.c
@@ -152,8 +152,8 @@ viz_node(Node *node) {
152} 152}
153 153
154void 154void
155viz_ast(ParseTree *parse_tree) { 155viz_ast(Root *roots) {
156 if (parse_tree == NULL) { 156 if (roots == NULL) {
157 return; 157 return;
158 } 158 }
159 printf("digraph ast {\n"); 159 printf("digraph ast {\n");
@@ -161,9 +161,9 @@ viz_ast(ParseTree *parse_tree) {
161 printf("ranksep=\"0.95 equally\";\n"); 161 printf("ranksep=\"0.95 equally\";\n");
162 printf("nodesep=\"0.5 equally\";\n"); 162 printf("nodesep=\"0.5 equally\";\n");
163 printf("overlap=scale;\n"); 163 printf("overlap=scale;\n");
164 for (size_t i = 0; i < array_size(parse_tree->roots); ++i) { 164 for (size_t i = 0; i < array_size(roots); ++i) {
165 printf("subgraph %zu {\n", i); 165 printf("subgraph %zu {\n", i);
166 Node *root = parse_tree->roots[array_size(parse_tree->roots) - 1 - i]; 166 Node *root = roots[array_size(roots) - 1 - i];
167 viz_node(root); 167 viz_node(root);
168 printf("}\n"); 168 printf("}\n");
169 } 169 }