package astinternal
import "cuelang.org/go/internal/astinternal"
Index ¶
- func AppendDebug(dst []byte, node ast.Node, config DebugConfig) []byte
- func DebugStr(x interface{}) (out string)
- type DebugConfig
Functions ¶
func AppendDebug ¶
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 ¶
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
// IncludeNodeRefs causes a Node reference in an identifier
// to indicate which (if any) ast.Node it refers to.
IncludeNodeRefs bool
// IncludePointers causes all nodes to be printed with their pointer
// values; setting this also implies [DebugConfig.IncludeNodeRefs]
// and references will be printed as pointers.
IncludePointers bool
}
DebugConfig configures the behavior of AppendDebug.
Source Files ¶
debug.go
- Version
- v0.15.1 (latest)
- Published
- Nov 21, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 months ago –
Tools for package owners.