Changes

Jump to navigation Jump to search
105 bytes removed ,  09:56, 26 August 2009
Move some text around
simply declaring the function with <code>visualizer</code> as the first
component of the name (or whatever you assigned the return value from
<code>newvisualizer</code> to). Each of the function headers in the hooklist below use this.
== Defining hooks ==For example, after registering the 'foo' prettyprinter as above, the<tt>flush_line</tt> hook should be defined as:  function visualizer.flush_line(str,nested) Each pretty printer should can define a number of hook functions. Each of
these will be called at specific times during the pretty printing and
are free to handle the input in any way. Each See below for when and how ahook is called. Defining a hook is optional, if it isnot defined, a default version will be called instead. == Hooks ==This section lists all hooks available to a pretty printer. Firstwe'll show how and when the hooks are called.
When pretty printing a file or buffer (named or anonymous using
Note that in this case, the <tt>line</tt> hook is not called!
 
Each hook should be defined as function named as follows:
<tt>visualizer.function_name''</tt>, where <tt>visualizer</tt> is the
dictionary returned by <tt>newvisualizer</tt> (see above).
 
For example, the <tt>flush_line</tt> function for the <tt>foo</tt>
pretty printer, above should be defined as:
 
function visualizer.flush_line(str,nested)
 
== Hooks ==
The following hooks are available to a pretty printer.
14

edits

Navigation menu