astinternal

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendDebug added in v0.11.0

func AppendDebug(dst []byte, node ast.Node, config DebugConfig) []byte

AppendDebug writes a multi-line Go-like representation of a syntax tree node, including node position information and any relevant Go types.

func DebugStr

func DebugStr(x interface{}) (out string)

Types

type DebugConfig added in v0.11.0

type DebugConfig struct {
	// Filter is called before each value in a syntax tree.
	// Values for which the function returns false are omitted.
	Filter func(reflect.Value) bool

	// OmitEmpty causes empty strings, empty structs, empty lists,
	// nil pointers, invalid positions, and missing tokens to be omitted.
	OmitEmpty bool
}

DebugConfig configures the behavior of AppendDebug.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL