diff options
author | Bad Diode <bd@badd10de.dev> | 2022-04-18 16:27:21 -0300 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2022-04-18 16:27:21 -0300 |
commit | 3da041f2e17fdeb69bf345aadf89c5fcc1814260 (patch) | |
tree | c1979ffee13f45f757712a61304a3edba89a80f5 /src/viz.c | |
parent | dcd3192e50d7b4ea333ecf57a7e8b325af145547 (diff) | |
download | bdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.tar.gz bdl-3da041f2e17fdeb69bf345aadf89c5fcc1814260.zip |
Move semantic analysis to separate file
Diffstat (limited to 'src/viz.c')
-rw-r--r-- | src/viz.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -152,8 +152,8 @@ viz_node(Node *node) { | |||
152 | } | 152 | } |
153 | 153 | ||
154 | void | 154 | void |
155 | viz_ast(ParseTree *parse_tree) { | 155 | viz_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 | } |