]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.graphviz: add block numbers to labels
authorAlex Vondrak <ajvondrak@csupomona.edu>
Mon, 27 Jun 2011 22:08:55 +0000 (15:08 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 12 Sep 2012 22:14:08 +0000 (15:14 -0700)
extra/compiler/cfg/graphviz/graphviz.factor

index 35be22db7a56bfe6beceea4150dad304bb4ee59c..129b5ab93d618ce606bfdb14f02fce20aa7fbc46 100644 (file)
@@ -26,10 +26,14 @@ IN: compiler.cfg.graphviz
 : left-justify ( str -- str' )
     string-lines "\\l" join ;
 
+: left-justified ( quot -- str )
+    with-string-writer left-justify ; inline
+
 : bb-label ( bb -- str )
+    [ number>> number>string ]
     [
-        instructions>> [ insn. ] each
-    ] with-string-writer left-justify ;
+        [ instructions>> [ insn. ] each ] left-justified
+    ] bi "\\n" glue ;
 
 : add-cfg-vertex ( graph bb -- graph' )
     [ number>> <node> ]