diff --git a/extra/compiler/cfg/graphviz/graphviz.factor b/extra/compiler/cfg/graphviz/graphviz.factor index 288d9281c8..59ce890bb8 100644 --- a/extra/compiler/cfg/graphviz/graphviz.factor +++ b/extra/compiler/cfg/graphviz/graphviz.factor @@ -48,8 +48,8 @@ IN: compiler.cfg.graphviz : cfgviz ( cfg -- graph ) - graph[ "t" =labelloc ]; - node[ "box" =shape "Courier" =fontname 10 =fontsize ]; + [graph "t" =labelloc ]; + [node "box" =shape "Courier" =fontname 10 =fontsize ]; swap [ [ add-cfg-vertex ] [ add-cfg-edges ] bi ] each-basic-block ; diff --git a/extra/compiler/cfg/gvn/testing/testing.factor b/extra/compiler/cfg/gvn/testing/testing.factor index 721321a386..9592499d4b 100644 --- a/extra/compiler/cfg/gvn/testing/testing.factor +++ b/extra/compiler/cfg/gvn/testing/testing.factor @@ -48,12 +48,12 @@ M: object expr>str unparse ; basic-block get number>> ; : add-gvns ( graph -- graph' ) - "gvns" add-node[ + "gvns" [add-node congruence-classes =label "plaintext" =shape ]; - "gvns" 0 add-edge[ "invis" =style ]; - basic-block# add-node[ "bold" =style ]; + "gvns" 0 [add-edge "invis" =style ]; + basic-block# [add-node "bold" =style ]; ; SYMBOL: iteration diff --git a/extra/graphviz/graphviz-docs.factor b/extra/graphviz/graphviz-docs.factor index 9506f9c999..47761386c3 100644 --- a/extra/graphviz/graphviz-docs.factor +++ b/extra/graphviz/graphviz-docs.factor @@ -607,8 +607,8 @@ $nl "" ": K_n ( n -- )" " " -" node[ \"point\" =shape ]; " -" graph[ \"t\" =labelloc \"circo\" =layout ];" +" [node \"point\" =shape ]; " +" [graph \"t\" =labelloc \"circo\" =layout ];" "" " over number>string \"K \" prepend =label" "" @@ -636,15 +636,15 @@ $nl ":: partite-set ( n color -- cluster )" " color " " color =color" -" node[ color =color ];" +" [node color =color ];" " n iota [" " number>string color prepend add-node" " ] each ;" "" ":: K_n,m ( n m -- )" " " -" node[ \"point\" =shape ];" -" graph[ \"t\" =labelloc \"dot\" =layout \"LR\" =rankdir ];" +" [node \"point\" =shape ];" +" [graph \"t\" =labelloc \"dot\" =layout \"LR\" =rankdir ];" "" " n \"#FF0000\" partite-set" " m \"#0000FF\" partite-set" @@ -678,8 +678,8 @@ $nl "" ": C_n ( n -- )" " " -" graph[ \"t\" =labelloc \"circo\" =layout ];" -" node[ \"point\" =shape ];" +" [graph \"t\" =labelloc \"circo\" =layout ];" +" [node \"point\" =shape ];" " over number>string \"C \" prepend =label" " swap add-cycle" " preview ;" @@ -707,8 +707,8 @@ $nl "" ": W_n ( n -- )" " " -" graph[ \"t\" =labelloc \"twopi\" =layout ];" -" node[ \"point\" =shape ];" +" [graph \"t\" =labelloc \"twopi\" =layout ];" +" [node \"point\" =shape ];" " over number>string \"W \" prepend =label" " over add-node" " over 1 - add-cycle" @@ -736,13 +736,13 @@ $nl " 0 " " \"filled\" =style" " \"lightgrey\" =color" -" node[ \"filled\" =style \"white\" =color ];" +" [node \"filled\" =style \"white\" =color ];" " { \"a0\" \"a1\" \"a2\" \"a3\" } ~->" " \"process #1\" =label" " add" "" " 1 " -" node[ \"filled\" =style ];" +" [node \"filled\" =style ];" " { \"b0\" \"b1\" \"b2\" \"b3\" } ~->" " \"process #2\" =label" " \"blue\" =color" @@ -756,8 +756,8 @@ $nl " \"a3\" \"end\" ->" " \"b3\" \"end\" ->" "" -" \"start\" add-node[ \"Mdiamond\" =shape ];" -" \"end\" add-node[ \"Msquare\" =shape ];" +" \"start\" [add-node \"Mdiamond\" =shape ];" +" \"end\" [add-node \"Msquare\" =shape ];" "preview" } { $image "resource:extra/graphviz/gallery/cluster.png" } @@ -777,16 +777,16 @@ $nl " [ 16 * \"#%2x0000\" sprintf =fillcolor ] tri ;" "" "" -" graph[ \"3,3\" =size \"circo\" =layout ];" +" [graph \"3,3\" =size \"circo\" =layout ];" "" -" node[ \"filled\" =style" +" [node \"filled\" =style" " \"circle\" =shape" " \"true\" =fixedsize" " \"\" =label ];" "" -" edge[ \"invis\" =style ];" +" [edge \"invis\" =style ];" "" -" 0 add-node[ \"invis\" =style \"none\" =shape ];" +" 0 [add-node \"invis\" =style \"none\" =shape ];" "" " 16 iota [" " [ 0 -- ] [ colored-circle add ] bi" @@ -805,23 +805,23 @@ $nl "" " \"LR\" =rankdir" " \"8,5\" =size" -" node[ \"doublecircle\" =shape ];" +" [node \"doublecircle\" =shape ];" " { \"LR_0\" \"LR_3\" \"LR_4\" \"LR_8\" } add-nodes" -" node[ \"circle\" =shape ];" -" \"LR_0\" \"LR_2\" ->[ \"SS(B)\" =label ];" -" \"LR_0\" \"LR_1\" ->[ \"SS(S)\" =label ];" -" \"LR_1\" \"LR_3\" ->[ \"S($end)\" =label ];" -" \"LR_2\" \"LR_6\" ->[ \"SS(b)\" =label ];" -" \"LR_2\" \"LR_5\" ->[ \"SS(a)\" =label ];" -" \"LR_2\" \"LR_4\" ->[ \"S(A)\" =label ];" -" \"LR_5\" \"LR_7\" ->[ \"S(b)\" =label ];" -" \"LR_5\" \"LR_5\" ->[ \"S(a)\" =label ];" -" \"LR_6\" \"LR_6\" ->[ \"S(b)\" =label ];" -" \"LR_6\" \"LR_5\" ->[ \"S(a)\" =label ];" -" \"LR_7\" \"LR_8\" ->[ \"S(b)\" =label ];" -" \"LR_7\" \"LR_5\" ->[ \"S(a)\" =label ];" -" \"LR_8\" \"LR_6\" ->[ \"S(b)\" =label ];" -" \"LR_8\" \"LR_5\" ->[ \"S(a)\" =label ];" +" [node \"circle\" =shape ];" +" \"LR_0\" \"LR_2\" [-> \"SS(B)\" =label ];" +" \"LR_0\" \"LR_1\" [-> \"SS(S)\" =label ];" +" \"LR_1\" \"LR_3\" [-> \"S($end)\" =label ];" +" \"LR_2\" \"LR_6\" [-> \"SS(b)\" =label ];" +" \"LR_2\" \"LR_5\" [-> \"SS(a)\" =label ];" +" \"LR_2\" \"LR_4\" [-> \"S(A)\" =label ];" +" \"LR_5\" \"LR_7\" [-> \"S(b)\" =label ];" +" \"LR_5\" \"LR_5\" [-> \"S(a)\" =label ];" +" \"LR_6\" \"LR_6\" [-> \"S(b)\" =label ];" +" \"LR_6\" \"LR_5\" [-> \"S(a)\" =label ];" +" \"LR_7\" \"LR_8\" [-> \"S(b)\" =label ];" +" \"LR_7\" \"LR_5\" [-> \"S(a)\" =label ];" +" \"LR_8\" \"LR_6\" [-> \"S(b)\" =label ];" +" \"LR_8\" \"LR_5\" [-> \"S(a)\" =label ];" "preview" } { $image "resource:extra/graphviz/gallery/fsm.png" } @@ -836,66 +836,66 @@ $nl "USING: graphviz graphviz.notation graphviz.render ;" "" "" -" graph[ \"LR\" =rankdir \"8,8\" =size ];" -" node[ 8 =fontsize \"record\" =shape ];" +" [graph \"LR\" =rankdir \"8,8\" =size ];" +" [node 8 =fontsize \"record\" =shape ];" "" -" \"node0\" add-node[" +" \"node0\" [add-node" " \" 0x10ba8| \" =label" " ];" -" \"node1\" add-node[" +" \"node1\" [add-node" " \" 0xf7fc4380| | |-1\" =label" " ];" -" \"node2\" add-node[" +" \"node2\" [add-node" " \" 0xf7fc44b8| | |2\" =label" " ];" -" \"node3\" add-node[" +" \"node3\" [add-node" " \" 3.43322790286038071e-06|44.79998779296875|0\" =label" " ];" -" \"node4\" add-node[" +" \"node4\" [add-node" " \" 0xf7fc4380| | |2\" =label" " ];" -" \"node5\" add-node[" +" \"node5\" [add-node" " \" (nil)| | |-1\" =label" " ];" -" \"node6\" add-node[" +" \"node6\" [add-node" " \" 0xf7fc4380| | |1\" =label" " ];" -" \"node7\" add-node[" +" \"node7\" [add-node" " \" 0xf7fc4380| | |2\" =label" " ];" -" \"node8\" add-node[" +" \"node8\" [add-node" " \" (nil)| | |-1\" =label" " ];" -" \"node9\" add-node[" +" \"node9\" [add-node" " \" (nil)| | |-1\" =label" " ];" -" \"node10\" add-node[" +" \"node10\" [add-node" " \" (nil)| | |-1\" =label" " ];" -" \"node11\" add-node[" +" \"node11\" [add-node" " \" (nil)| | |-1\" =label" " ];" -" \"node12\" add-node[" +" \"node12\" [add-node" " \" 0xf7fc43e0| | |1\" =label" " ];" "" -" \"node0\" \"node1\" ->[ \"f0\" =tailport \"f0\" =headport ];" -" \"node0\" \"node2\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node1\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];" -" \"node1\" \"node4\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node1\" \"node5\" ->[ \"f2\" =tailport \"f0\" =headport ];" -" \"node4\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];" -" \"node4\" \"node6\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node4\" \"node10\" ->[ \"f2\" =tailport \"f0\" =headport ];" -" \"node6\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];" -" \"node6\" \"node7\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node6\" \"node9\" ->[ \"f2\" =tailport \"f0\" =headport ];" -" \"node7\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];" -" \"node7\" \"node1\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node7\" \"node8\" ->[ \"f2\" =tailport \"f0\" =headport ];" -" \"node10\" \"node11\" ->[ \"f1\" =tailport \"f0\" =headport ];" -" \"node10\" \"node12\" ->[ \"f2\" =tailport \"f0\" =headport ];" -" \"node11\" \"node1\" ->[ \"f2\" =tailport \"f0\" =headport ];" +" \"node0\" \"node1\" [-> \"f0\" =tailport \"f0\" =headport ];" +" \"node0\" \"node2\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node1\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];" +" \"node1\" \"node4\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node1\" \"node5\" [-> \"f2\" =tailport \"f0\" =headport ];" +" \"node4\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];" +" \"node4\" \"node6\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node4\" \"node10\" [-> \"f2\" =tailport \"f0\" =headport ];" +" \"node6\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];" +" \"node6\" \"node7\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node6\" \"node9\" [-> \"f2\" =tailport \"f0\" =headport ];" +" \"node7\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];" +" \"node7\" \"node1\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node7\" \"node8\" [-> \"f2\" =tailport \"f0\" =headport ];" +" \"node10\" \"node11\" [-> \"f1\" =tailport \"f0\" =headport ];" +" \"node10\" \"node12\" [-> \"f2\" =tailport \"f0\" =headport ];" +" \"node11\" \"node1\" [-> \"f2\" =tailport \"f0\" =headport ];" "preview" } { $image "resource:extra/graphviz/gallery/record.png" } diff --git a/extra/graphviz/graphviz-tests.factor b/extra/graphviz/graphviz-tests.factor index ea06245afa..0d1b24d5d2 100644 --- a/extra/graphviz/graphviz-tests.factor +++ b/extra/graphviz/graphviz-tests.factor @@ -69,23 +69,23 @@ SYMBOLS: supported-layouts supported-formats ; : K_n ( n -- graph ) - node[ "point" =shape ]; - graph[ "t" =labelloc "circo" =layout ]; + [node "point" =shape ]; + [graph "t" =labelloc "circo" =layout ]; over number>string "K " prepend =label swap iota 2 [ first2 add-edge ] each-combination ; :: partite-set ( n color -- cluster ) color color =color - node[ color =color ]; + [node color =color ]; n iota [ number>string color prepend add-node ] each ; :: K_n,m ( n m -- graph ) - node[ "point" =shape ]; - graph[ "t" =labelloc "dot" =layout "LR" =rankdir ]; + [node "point" =shape ]; + [graph "t" =labelloc "dot" =layout "LR" =rankdir ]; n "#FF0000" partite-set m "#0000FF" partite-set add-edge @@ -96,15 +96,15 @@ SYMBOLS: supported-layouts supported-formats ; : C_n ( n -- graph ) - graph[ "t" =labelloc "circo" =layout ]; - node[ "point" =shape ]; + [graph "t" =labelloc "circo" =layout ]; + [node "point" =shape ]; over number>string "C " prepend =label swap add-cycle ; : W_n ( n -- graph ) - graph[ "t" =labelloc "twopi" =layout ]; - node[ "point" =shape ]; + [graph "t" =labelloc "twopi" =layout ]; + [node "point" =shape ]; over number>string "W " prepend =label over add-node over 1 - add-cycle @@ -116,12 +116,12 @@ SYMBOLS: supported-layouts supported-formats ; 0 "filled" =style "lightgrey" =color - node[ "filled" =style "white" =color ]; + [node "filled" =style "white" =color ]; { "a0" "a1" "a2" "a3" } ~-> "process #1" =label add 1 - node[ "filled" =style ]; + [node "filled" =style ]; { "b0" "b1" "b2" "b3" } ~-> "process #2" =label "blue" =color @@ -133,8 +133,8 @@ SYMBOLS: supported-layouts supported-formats ; "a3" "a0" -> "a3" "end" -> "b3" "end" -> - "start" add-node[ "Mdiamond" =shape ]; - "end" add-node[ "Msquare" =shape ]; + "start" [add-node "Mdiamond" =shape ]; + "end" [add-node "Msquare" =shape ]; ; : colored-circle ( i -- node ) @@ -145,13 +145,13 @@ SYMBOLS: supported-layouts supported-formats ; : colored-circles-example ( -- graph ) - graph[ "3,3" =size "circo" =layout ]; - node[ "filled" =style + [graph "3,3" =size "circo" =layout ]; + [node "filled" =style "circle" =shape "true" =fixedsize "" =label ]; - edge[ "invis" =style ]; - 0 add-node[ "invis" =style "none" =shape ]; + [edge "invis" =style ]; + 0 [add-node "invis" =style "none" =shape ]; 16 iota [ [ 0 -- ] [ colored-circle add ] bi ] each ; @@ -160,87 +160,87 @@ SYMBOLS: supported-layouts supported-formats ; "LR" =rankdir "8,5" =size - node[ "doublecircle" =shape ]; + [node "doublecircle" =shape ]; { "LR_0" "LR_3" "LR_4" "LR_8" } add-nodes - node[ "circle" =shape ]; - "LR_0" "LR_2" ->[ "SS(B)" =label ]; - "LR_0" "LR_1" ->[ "SS(S)" =label ]; - "LR_1" "LR_3" ->[ "S($end)" =label ]; - "LR_2" "LR_6" ->[ "SS(b)" =label ]; - "LR_2" "LR_5" ->[ "SS(a)" =label ]; - "LR_2" "LR_4" ->[ "S(A)" =label ]; - "LR_5" "LR_7" ->[ "S(b)" =label ]; - "LR_5" "LR_5" ->[ "S(a)" =label ]; - "LR_6" "LR_6" ->[ "S(b)" =label ]; - "LR_6" "LR_5" ->[ "S(a)" =label ]; - "LR_7" "LR_8" ->[ "S(b)" =label ]; - "LR_7" "LR_5" ->[ "S(a)" =label ]; - "LR_8" "LR_6" ->[ "S(b)" =label ]; - "LR_8" "LR_5" ->[ "S(a)" =label ]; + [node "circle" =shape ]; + "LR_0" "LR_2" [-> "SS(B)" =label ]; + "LR_0" "LR_1" [-> "SS(S)" =label ]; + "LR_1" "LR_3" [-> "S($end)" =label ]; + "LR_2" "LR_6" [-> "SS(b)" =label ]; + "LR_2" "LR_5" [-> "SS(a)" =label ]; + "LR_2" "LR_4" [-> "S(A)" =label ]; + "LR_5" "LR_7" [-> "S(b)" =label ]; + "LR_5" "LR_5" [-> "S(a)" =label ]; + "LR_6" "LR_6" [-> "S(b)" =label ]; + "LR_6" "LR_5" [-> "S(a)" =label ]; + "LR_7" "LR_8" [-> "S(b)" =label ]; + "LR_7" "LR_5" [-> "S(a)" =label ]; + "LR_8" "LR_6" [-> "S(b)" =label ]; + "LR_8" "LR_5" [-> "S(a)" =label ]; ; : record-example ( -- graph ) - graph[ "LR" =rankdir "8,8" =size ]; - node[ 8 =fontsize "record" =shape ]; + [graph "LR" =rankdir "8,8" =size ]; + [node 8 =fontsize "record" =shape ]; - "node0" add-node[ + "node0" [add-node " 0x10ba8| " =label ]; - "node1" add-node[ + "node1" [add-node " 0xf7fc4380| | |-1" =label ]; - "node2" add-node[ + "node2" [add-node " 0xf7fc44b8| | |2" =label ]; - "node3" add-node[ + "node3" [add-node " 3.43322790286038071e-06|44.79998779296875|0" =label ]; - "node4" add-node[ + "node4" [add-node " 0xf7fc4380| | |2" =label ]; - "node5" add-node[ + "node5" [add-node " (nil)| | |-1" =label ]; - "node6" add-node[ + "node6" [add-node " 0xf7fc4380| | |1" =label ]; - "node7" add-node[ + "node7" [add-node " 0xf7fc4380| | |2" =label ]; - "node8" add-node[ + "node8" [add-node " (nil)| | |-1" =label ]; - "node9" add-node[ + "node9" [add-node " (nil)| | |-1" =label ]; - "node10" add-node[ + "node10" [add-node " (nil)| | |-1" =label ]; - "node11" add-node[ + "node11" [add-node " (nil)| | |-1" =label ]; - "node12" add-node[ + "node12" [add-node " 0xf7fc43e0| | |1" =label ]; - "node0" "node1" ->[ "f0" =tailport "f0" =headport ]; - "node0" "node2" ->[ "f1" =tailport "f0" =headport ]; - "node1" "node3" ->[ "f0" =tailport "f0" =headport ]; - "node1" "node4" ->[ "f1" =tailport "f0" =headport ]; - "node1" "node5" ->[ "f2" =tailport "f0" =headport ]; - "node4" "node3" ->[ "f0" =tailport "f0" =headport ]; - "node4" "node6" ->[ "f1" =tailport "f0" =headport ]; - "node4" "node10" ->[ "f2" =tailport "f0" =headport ]; - "node6" "node3" ->[ "f0" =tailport "f0" =headport ]; - "node6" "node7" ->[ "f1" =tailport "f0" =headport ]; - "node6" "node9" ->[ "f2" =tailport "f0" =headport ]; - "node7" "node3" ->[ "f0" =tailport "f0" =headport ]; - "node7" "node1" ->[ "f1" =tailport "f0" =headport ]; - "node7" "node8" ->[ "f2" =tailport "f0" =headport ]; - "node10" "node11" ->[ "f1" =tailport "f0" =headport ]; - "node10" "node12" ->[ "f2" =tailport "f0" =headport ]; - "node11" "node1" ->[ "f2" =tailport "f0" =headport ]; + "node0" "node1" [-> "f0" =tailport "f0" =headport ]; + "node0" "node2" [-> "f1" =tailport "f0" =headport ]; + "node1" "node3" [-> "f0" =tailport "f0" =headport ]; + "node1" "node4" [-> "f1" =tailport "f0" =headport ]; + "node1" "node5" [-> "f2" =tailport "f0" =headport ]; + "node4" "node3" [-> "f0" =tailport "f0" =headport ]; + "node4" "node6" [-> "f1" =tailport "f0" =headport ]; + "node4" "node10" [-> "f2" =tailport "f0" =headport ]; + "node6" "node3" [-> "f0" =tailport "f0" =headport ]; + "node6" "node7" [-> "f1" =tailport "f0" =headport ]; + "node6" "node9" [-> "f2" =tailport "f0" =headport ]; + "node7" "node3" [-> "f0" =tailport "f0" =headport ]; + "node7" "node1" [-> "f1" =tailport "f0" =headport ]; + "node7" "node8" [-> "f2" =tailport "f0" =headport ]; + "node10" "node11" [-> "f1" =tailport "f0" =headport ]; + "node10" "node12" [-> "f2" =tailport "f0" =headport ]; + "node11" "node1" [-> "f2" =tailport "f0" =headport ]; ; :: with-global-value ( value variable quot -- ) diff --git a/extra/graphviz/notation/notation-docs.factor b/extra/graphviz/notation/notation-docs.factor index 50dbb9d94f..368dea0bd5 100644 --- a/extra/graphviz/notation/notation-docs.factor +++ b/extra/graphviz/notation/notation-docs.factor @@ -4,10 +4,10 @@ USING: graphviz graphviz.attributes help.markup help.syntax kernel present sequences ; IN: graphviz.notation -{ add-edge add-edge[ -- ~-- --[ } related-words -{ add-edge add-edge[ -> ~-> ->[ } related-words +{ add-edge [add-edge -- ~-- [-- } related-words +{ add-edge [add-edge -> ~-> [-> } related-words { - add-node[ add-edge[ --[ ->[ node[ edge[ graph[ ]; + [add-node [add-edge [-- [-> [node [edge [graph ]; } related-words HELP: -- @@ -78,7 +78,7 @@ HELP: -> } ; -HELP: --[ +HELP: [-- { $values { "tail" object } { "head" object } @@ -94,7 +94,7 @@ HELP: --[ "it looks better to write" { $code "" - " 1 2 --[ \"red\" =color ];" + " 1 2 [-- \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code @@ -105,7 +105,7 @@ HELP: --[ } ; -HELP: ->[ +HELP: [-> { $values { "tail" object } { "head" object } @@ -121,7 +121,7 @@ HELP: ->[ "it looks better to write" { $code "" - " 1 2 ->[ \"red\" =color ];" + " 1 2 [-> \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code @@ -138,11 +138,11 @@ HELP: ]; { "statement" object } { "graph'" { $or graph subgraph } } } -{ $description "Synonym for " { $link add } " meant to be the \"other half\" of various " { $vocab-link "graphviz.notation" } " words like " { $links add-edge[ add-node[ graph[ } ", etc." } +{ $description "Synonym for " { $link add } " meant to be the \"other half\" of various " { $vocab-link "graphviz.notation" } " words like " { $links [add-edge [add-node [graph } ", etc." } { $examples "Refer to the documentation for the complementary words listed below." } ; -HELP: add-edge[ +HELP: [add-edge { $values { "tail" object } { "head" object } @@ -158,7 +158,7 @@ HELP: add-edge[ "it looks better to write" { $code "" - " 1 2 add-edge[ \"red\" =color ];" + " 1 2 [add-edge \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code @@ -167,11 +167,11 @@ HELP: add-edge[ "}" } $nl - "This has the advantage over " { $link --[ } " and " { $link ->[ } " of reading nicely for both directed " { $emphasis "and" } " undirected " { $link graph } "s." + "This has the advantage over " { $link [-- } " and " { $link [-> } " of reading nicely for both directed " { $emphasis "and" } " undirected " { $link graph } "s." } ; -HELP: add-node[ +HELP: [add-node { $values { "id" object } { "node" node } @@ -186,7 +186,7 @@ HELP: add-node[ "it looks better to write" { $code "" - " \"foo\" add-node[ \"red\" =color ];" + " \"foo\" [add-node \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code @@ -197,7 +197,7 @@ HELP: add-node[ } ; -HELP: edge[ +HELP: [edge { $values { "attrs" edge-attributes } } @@ -211,18 +211,18 @@ HELP: edge[ "it looks better to write" { $code "" - " edge[ \"red\" =color ];" + " [edge \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code "graph {" - " edge[ color=\"red\" ];" + " [edge color=\"red\" ];" "}" } } ; -HELP: graph[ +HELP: [graph { $values { "attrs" graph-attributes } } @@ -237,12 +237,12 @@ HELP: graph[ "it looks better to write" { $code "" - " graph[ \"LR\" =rankdir \"blah\" =label ];" + " [graph \"LR\" =rankdir \"blah\" =label ];" } "Compare this with the DOT language, where you'd write" { $code "graph {" - " graph[ rankdir=\"LR\" label=\"blah\" ];" + " [graph rankdir=\"LR\" label=\"blah\" ];" "}" } $nl @@ -262,7 +262,7 @@ HELP: graph[ } ; -HELP: node[ +HELP: [node { $values { "attrs" node-attributes } } @@ -276,12 +276,12 @@ HELP: node[ "it looks better to write" { $code "" - " node[ \"red\" =color ];" + " [node \"red\" =color ];" } "Compare this with the DOT language, where you'd write" { $code "graph {" - " node[ color=\"red\" ];" + " [node color=\"red\" ];" "}" } } @@ -425,16 +425,16 @@ $nl } "Notation for nodes/edges with local attributes:" { $subsections - add-node[ - add-edge[ - --[ - ->[ + [add-node + [add-edge + [-- + [-> } "Notation for global attributes:" { $subsections - node[ - edge[ - graph[ + [node + [edge + [graph } "Word to \"close off\" notation for attributes:" { $subsections diff --git a/extra/graphviz/notation/notation.factor b/extra/graphviz/notation/notation.factor index b568aeefdf..6361c519c5 100644 --- a/extra/graphviz/notation/notation.factor +++ b/extra/graphviz/notation/notation.factor @@ -74,14 +74,14 @@ ALIAS: -- add-edge ALIAS: ~-> add-path ALIAS: ~-- add-path -ALIAS: graph[ -ALIAS: node[ -ALIAS: edge[ +ALIAS: [graph +ALIAS: [node +ALIAS: [edge -ALIAS: add-node[ -ALIAS: add-edge[ -ALIAS: ->[ -ALIAS: --[ +ALIAS: [add-node +ALIAS: [add-edge +ALIAS: [-> +ALIAS: [-- ALIAS: ]; add