Skip to content

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Jun 28, 2024

Useful when you want to embed a CFG in a PR description, e.g.

flowchart TD
1["enter M4"]
10["[b (line 46): true] access to parameter x"]
11["access to parameter x"]
12["...--"]
13["[b (line 46): false] ...--"]
14["[b (line 46): true] ...--"]
15["... > ..."]
16["[b (line 46): false] ... > ..."]
17["[b (line 46): true] ... > ..."]
18["0"]
19["[b (line 46): false] 0"]
2["exit M4"]
20["[b (line 46): true] 0"]
21["[b (line 46): false] {...}"]
22["[b (line 46): true] {...}"]
23["{...}"]
24["[b (line 46): false] if (...) ..."]
25["[b (line 46): true] if (...) ..."]
26["if (...) ..."]
27["[b (line 46): false] access to parameter b"]
28["[b (line 46): true] access to parameter b"]
29["access to parameter b"]
3["exit M4 (normal)"]
30["[b (line 46): true] access to local variable y"]
31["[b (line 46): true] ...++"]
32["[b (line 46): true] ...;"]
33["return ...;"]
34["access to local variable y"]
4["{...}"]
5["... ...;"]
6["Int32 y = ..."]
7["0"]
8["while (...) ..."]
9["[b (line 46): false] access to parameter x"]

1 --> 4
10 --> 14
11 --> 12
12 --> 18
13 --> 19
14 --> 20
15 -- true --> 23
16 -- true --> 21
17 -- true --> 22
18 --> 15
19 --> 16
20 --> 17
21 --> 24
22 --> 25
23 --> 26
24 --> 27
25 --> 28
26 --> 29
27 -- false --> 9
28 -- true --> 32
29 -- false --> 9
3 --> 2
30 --> 31
31 --> 10
32 --> 30
33 -- return --> 3
34 --> 33
4 --> 5
5 --> 7
6 --> 8
7 --> 6
8 --> 11
9 --> 13
15 -- false --> 34
16 -- false --> 34
17 -- false --> 34
29 -- true --> 32
Loading

@hvitved hvitved marked this pull request as ready for review June 28, 2024 07:50
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jun 28, 2024
@hvitved hvitved requested a review from MathiasVP June 28, 2024 08:53
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 definitely going to use this in the future!

@MathiasVP MathiasVP merged commit 72caadb into github:main Jun 28, 2024
@hvitved hvitved deleted the shared/cfg/mermaid-output branch June 28, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants