Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpLispExpression ¶
func DumpLispExpression(expr pm.Expression, w io.Writer, opts LispOptions) error
DumpLispExpression pretty-prints a pm.Expression as a Lisp S-expression.
Types ¶
type Dumper ¶
type Dumper interface {
Dump(tree *sitter.Tree, source []byte, w io.Writer, options Options) error
}
Dumper is the interface that all tree dumpers must implement
type LispOptions ¶
type NodeJSON ¶
type NodeJSON struct {
Type string `json:"type"`
Position string `json:"pos"` // Format: "startLine,startCol-endLine,endCol"
Bytes string `json:"bytes,omitempty"` // Optional
IsNamed bool `json:"is_named,omitempty"`
IsMissing bool `json:"is_missing,omitempty"`
IsExtra bool `json:"is_extra,omitempty"`
HasError bool `json:"has_error,omitempty"`
Content string `json:"content,omitempty"`
Fields map[string][]*NodeJSON `json:"fields,omitempty"`
Children []*NodeJSON `json:"children,omitempty"`
}
NodeJSON represents a tree node in JSON format
type NodeYAML ¶
type NodeYAML struct {
Type string `yaml:"type"`
Position string `yaml:"pos"` // Format: "startLine,startCol-endLine,endCol"
Bytes string `yaml:"bytes,omitempty"` // Format: "startByte-endByte" (optional)
Named bool `yaml:"named,omitempty"`
Missing bool `yaml:"missing,omitempty"`
Extra bool `yaml:"extra,omitempty"`
HasError bool `yaml:"has_error,omitempty"`
Content string `yaml:"content,omitempty"`
Fields map[string][]*NodeYAML `yaml:"fields,omitempty"`
Children []*NodeYAML `yaml:"children,omitempty"`
}
NodeYAML represents a tree node in YAML format
Click to show internal directories.
Click to hide internal directories.