Skip to content

Commit 642bf41

Browse files
committed
Fix buffer edge
1 parent 5485f15 commit 642bf41

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

lib/laundromat/cfg.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def build_clause(clause: list[Directive | str], current: Node, condition: Condit
9494
# TODO: Actually handle justification
9595
build_clause(sum(directive.clauses, []), current, Condition(), closing, escape)
9696

97-
cfg.add_edge(current, current := escape, condition=Condition())
97+
cfg.add_edge(closing, current := escape, condition=Condition())
9898
condition = Condition()
9999

100100
case '^':
@@ -183,5 +183,15 @@ def draw_cfg(cfg: nx.DiGraph, *, size: int = 12):
183183
plt.show()
184184

185185

186-
CFG = program_to_cfg("""~{~a~^~?~}~a""")
187-
draw_cfg(CFG, size=12)
186+
CFG = program_to_cfg("""~:[█ ~%~;~]~:*~
187+
~{~<~#,#,101^~?~>█~@{~#,#,3^~
188+
~<~v,' ^~<~v,' ^~<~v,' ^ ~>~:*~>~:*~>~:*~
189+
~<~v,' ^~<~v,' ^~<~v,'█^█~>~:*~>~:*~>~:*~
190+
~<~v,' ^~<~v,'█^~<~v,' ^█~>~:*~>~:*~>~:*~
191+
~<~v,' ^~<~v,'█^~<~v,'█^█~>~:*~>~:*~>~:*~
192+
~<~v,'█^~<~v,' ^~<~v,' ^█~>~:*~>~:*~>~:*~
193+
~<~v,'█^~<~v,' ^~<~v,'█^█~>~:*~>~:*~>~:*~
194+
~<~v,'█^~<~v,'█^~<~v,' ^ ~>~:*~>~:*~>~:*~
195+
~<~v,'█^~<~v,'█^~<~v,'█^ ~>~:*~>~:*~>~
196+
~}█ ~%~0^~}""")
197+
draw_cfg(CFG, size=48)

0 commit comments

Comments
 (0)