Documentation ¶
Overview ¶
Package visualize contains a Visualize function that may be used to generate a printable tree representation of a nested set of Node instances. This may be used to visualize an abstract syntax tree, as generated by the parser, but may also be used to visualize other tree-like structures, as long as the elements of those structures implement the parser.Node interface. Different profiles exist that may be used to alter the visual appearance of the visualized tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ASCII = Profile{ Start: '-', Last: '`', Branch: '+', Skip: '|', Into: '-', } Rounded = Profile{ Start: '\u2500', Last: '\u2570', Branch: '\u251c', Skip: '\u2502', Into: '\u2500', } Square = Profile{ Start: '\u2500', Last: '\u2514', Branch: '\u251c', Skip: '\u2502', Into: '\u2500', } )
Pre-configured visual profiles for trees.
Functions ¶
Types ¶
type Profile ¶
type Profile struct { Start rune // Joiner character to start a tree at the root Last rune // Joiner character for last child Branch rune // Joiner character for a branch Skip rune // Joiner character indicating a node is not a branch Into rune // Joiner character leading into a node }
Profile represents a visual profile for visualizing the tree.
Click to show internal directories.
Click to hide internal directories.