Tool help updates

darcs
slava 2006-09-19 06:53:14 +00:00
parent 6c8bcc6307
commit 4148a106e3
8 changed files with 38 additions and 14 deletions

View File

@ -26,6 +26,7 @@
- doc sweep
- tool help
- keyboard help: hide commands whose gestures are shadowed
- how do we refer to command shortcuts in the docs?
+ ui:

View File

@ -22,11 +22,21 @@ ARTICLE: "ui-help" "UI documentation browser"
;
ARTICLE: "ui-walker" "UI walker"
"The walker single-steps through quotations. To use the walker, enter a piece of code in the listener's input area and press " { $snippet "C+A+w" } "."
$terpri
"The walker can travel backwards through time, and restore stacks. This does not undo side effects and therefore can only be used reliably on referentially transparent code."
$terpri
"Walkers are instances of " { $link walker-gadget } "."
{ $commands walker-gadget }
;
ARTICLE: "ui-dataflow" "UI dataflow tool"
"The dataflow viewer displays the stack effect of a quotation in a graphical way. To use it, enter a piece of code in the listener's input area and press " { $snippet "C+A+d" } ", or click the " { $strong "Dataflow" } " button in a definition tile shown by the UI browser."
$terpri
"Only quotations and words for which a stack effect can be inferred can be viewed. See " { $link "inference" } "."
$terpri
"The dataflow viewer displays the dataflow intermediate representation output by the compiler's optimizer. Therefore inlining and various other optimizations will have already been performed, and the visual representation may not resemble your original code in many ways. An upside of this arrangement is that the dataflow viewer can be used to predict how fast the code will run, because you will see which layers of generic dispatch have been optimized out at compile time."
$terpri
"Dataflow viewers are instances of " { $link dataflow-gadget } "."
{ $commands dataflow-gadget }
;

View File

@ -1,6 +1,7 @@
IN: optimizer
IN: print-dataflow
USING: generic hashtables inference io kernel kernel-internals
math namespaces prettyprint sequences styles vectors words ;
math namespaces prettyprint sequences styles vectors words
test optimizer ;
! A simple tool for turning dataflow IR into quotations, for
! debugging purposes.
@ -82,3 +83,11 @@ M: object node>quot dup class word-name comment, ;
#! Print dataflow IR for a quotation. Flag indicates if
#! annotations should be printed or not.
>r dataflow optimize r> dataflow>quot . ;
[ ] [ [ 2 ] t dataflow. ] unit-test
[ ] [ [ 3 + ] t dataflow. ] unit-test
[ ] [ [ drop ] t dataflow. ] unit-test
[ ] [ [ [ sq ] [ abs ] if ] t dataflow. ] unit-test
[ ] [ [ { [ sq ] [ abs ] } dispatch ] t dataflow. ] unit-test
[ ] [ \ unify-values word-def t dataflow. ] unit-test
[ ] [ [ 0 0 / ] t dataflow. ] unit-test

View File

@ -1,9 +0,0 @@
USING: inference kernel kernel-internals math test words ;
[ ] [ [ 2 ] t dataflow. ] unit-test
[ ] [ [ 3 + ] t dataflow. ] unit-test
[ ] [ [ drop ] t dataflow. ] unit-test
[ ] [ [ [ sq ] [ abs ] if ] t dataflow. ] unit-test
[ ] [ [ { [ sq ] [ abs ] } dispatch ] t dataflow. ] unit-test
[ ] [ \ unify-values word-def t dataflow. ] unit-test
[ ] [ [ 0 0 / ] t dataflow. ] unit-test

View File

@ -70,6 +70,8 @@ M: f print-element drop ;
: $emphasis [ emphasis-style print-element* ] ($span) ;
: $strong [ strong-style print-element* ] ($span) ;
: $url [ url-style print-element* ] ($span) ;
: $terpri terpri terpri drop ;

View File

@ -20,6 +20,9 @@ USING: styles ;
: emphasis-style
H{ { font-style italic } } ;
: strong-style
H{ { font-style bold } } ;
: title-style
H{
{ font "sans-serif" }

View File

@ -29,3 +29,6 @@ C: help-gadget ( -- gadget )
M: help-gadget focusable-child* help-gadget-search ;
M: help-gadget call-tool* show-help ;
: help-action ( help-gadget -- link )
help-gadget-history model-value <link> ;

View File

@ -114,6 +114,11 @@ M: operation invoke-command ( target operation -- )
{ +quot+ [ edit ] }
} define-operation
[ link? ] H{
{ +name+ "Reload" }
{ +quot+ [ reload ] }
} define-operation
[ word-link? ] H{
{ +button+ 3 }
{ +name+ "Definition" }
@ -178,7 +183,7 @@ M: operation invoke-command ( target operation -- )
! Dataflow nodes
[ word? ] H{
{ +group+ "Word commands" }
{ +name+ "Word dataflow" }
{ +name+ "Dataflow" }
{ +gesture+ T{ key-down f { A+ } "d" } }
{ +quot+ [ word-def show-dataflow ] }
} define-operation
@ -235,8 +240,8 @@ help-gadget [
{ "Back" T{ key-down f { C+ } "b" } [ help-gadget-history go-back ] }
{ "Forward" T{ key-down f { C+ } "f" } [ help-gadget-history go-forward ] }
{ "Home" T{ key-down f { C+ } "h" } [ go-home ] }
}
} <commands> %
[ help-gadget-history model-value ] link class-operations modify-listener-operations
[ help-action ] link class-operations modify-listener-operations
[ command-name "Follow" = not ] subset %
] { } make define-commands*