Graphviz: add return/statement functions

This commit is contained in:
Akemi Izuko 2023-11-14 14:57:54 -07:00
parent 8f707512e0
commit ac848b070d
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC
3 changed files with 56 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/target /target
*.svg *.svg
Cargo.lock

View file

@ -0,0 +1,22 @@
digraph fn_gen_return {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_return(return: GazType)";
fontname=lovebeat;
rankdir=LR;
newrank=true;
a [label="choice" rank=max];
b [label="gen_if_statement_with_return()" shape=diamond style=filled fillcolor=lightcoral];
c [label="gen_loop_with_return()" shape=diamond style=filled fillcolor=lightcoral];
d [label="return"];
e [label="gen_type()" shape=diamond style=filled fillcolor=lightcoral];
f [label="return" style=filled fillcolor=lightskyblue1];
a -> b -> f;
a -> c -> f;
a -> d -> e -> f;
}

View file

@ -0,0 +1,33 @@
digraph fn_gen_statement {
labelloc="t";
graph [fontname = "cc wild words"];
node [fontname = "cc wild words"];
edge [fontname = "cc wild words"];
label="fn_gen_statement(Vec<GazType>, return: GazType)";
fontname=lovebeat;
rankdir=LR;
newrank=true;
a [label="can declare" rank=max];
b [label="cannot declare" rank=min];
c [label="gen_decl()" shape=diamond style=filled fillcolor=lightcoral];
d [label="gen_if_statement()" shape=diamond style=filled fillcolor=lightcoral];
e [label="gen_std_output()" shape=diamond style=filled fillcolor=lightcoral];
f [label="gen_loop()" shape=diamond style=filled fillcolor=lightcoral];
g [label="gen_assignment()" shape=diamond style=filled fillcolor=lightcoral];
h [label="return" style=filled fillcolor=lightskyblue1];
a -> c -> a;
a -> d;
a -> e;
a -> f;
a -> g;
a -> h;
b -> d -> b;
b -> e -> b;
b -> f -> b;
b -> g -> b;
b -> h;
}