Skip to content

Commit 81f0609

Browse files
committed
improve appearance of visualized nodes
1 parent 1e752a2 commit 81f0609

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/flow/visualize.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { TBlockInstruction, TBlockEndInstruction } from "./instructions";
99
* representation during compilation as a directed graph in DOT notation.
1010
*/
1111
export function generateGraphVizDOTString(c: ICompilerContext, entry: Block) {
12-
let result = "digraph mlogjs_cfg {\n";
12+
let result = "digraph mlogjs_cfg {\n" + "node [shape=rectangle];\n";
1313
const ids = new Map<Block, string>();
1414

1515
traverse(entry, block => {
@@ -71,14 +71,14 @@ export function generateGraphVizDOTString(c: ICompilerContext, entry: Block) {
7171

7272
traverse(entry, block => {
7373
const id = ids.get(block)!;
74-
result += `${id} [label="${id}\n\n${[
74+
result += `${id} [label="${id}\\l\\l${[
7575
...block.instructions,
7676
block.endInstruction,
7777
]
7878
.filter((value): value is NonNullable<typeof value> => !!value)
7979
.map(instToString)
80-
.join("\n")
81-
.replace(/"/g, "'")}"];\n`;
80+
.join("\\l")
81+
.replace(/"/g, "'")}\\l"];\n`;
8282

8383
for (const edge of block.childEdges) {
8484
result += `${id} -> ${ids.get(edge.block)};\n`;

0 commit comments

Comments
 (0)