exprtrace

package
v0.113.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintTree

func PrintTree(trace *EvalTraceStore, env EvalEnv, node ast.Node, options ...TreePrinterOption) (treeprint.Tree, error)

Types

type ArrayNodeTraceInfo

type ArrayNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type BinaryNodeTraceInfo

type BinaryNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type BuiltinNodeTraceInfo

type BuiltinNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type CallNodeTraceInfo

type CallNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type ClosureNodeTraceInfo

type ClosureNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type ConditionalNodeTraceInfo

type ConditionalNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type EvalEnv

type EvalEnv map[string]any

type EvalResult

type EvalResult struct {
	Output             any
	Trace              *EvalTraceStore
	Source             string
	Env                EvalEnv
	TreePrinterOptions []TreePrinterOption
}

func (*EvalResult) FormatTraceTree

func (e *EvalResult) FormatTraceTree(opts ...TreePrinterOption) (string, error)

func (*EvalResult) OutputAsBool

func (e *EvalResult) OutputAsBool() bool

type EvalTraceStore

type EvalTraceStore struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *EvalTraceStore

func (*EvalTraceStore) AddTrace

func (ts *EvalTraceStore) AddTrace(tag EvalTraceTag, payload TraceEntry)

func (*EvalTraceStore) TraceEntryByTag

func (ts *EvalTraceStore) TraceEntryByTag(tag EvalTraceTag) (TraceEntry, bool)

type EvalTraceTag

type EvalTraceTag struct {
	NodeIndex int
}

func (*EvalTraceTag) TraceStoreKey

func (t *EvalTraceTag) TraceStoreKey() TraceStoreKey

type FloatNodeTraceInfo

type FloatNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type IdentifierNodeTraceInfo

type IdentifierNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type IntegerNodeTraceInfo

type IntegerNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type MapNodeTraceInfo

type MapNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type MemberNodeTraceInfo

type MemberNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type NodeEvalResult

type NodeEvalResult interface {
	Output() any
}

type PairNodeTraceInfo

type PairNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type PointerNodeTraceInfo

type PointerNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type SliceNodeTraceInfo

type SliceNodeTraceInfo struct {
	// contains filtered or unexported fields
}

type TagMapper

type TagMapper struct {
	// contains filtered or unexported fields
}

func (*TagMapper) Visit

func (m *TagMapper) Visit(node *ast.Node)

type TraceEntry

type TraceEntry interface {
	EvalResultByCallCount(callCount int) NodeEvalResult
}

type TraceStoreKey

type TraceStoreKey int

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(trace *EvalTraceStore, store EvalEnv) *Tracer

func (*Tracer) InstallTracerFunctions

func (t *Tracer) InstallTracerFunctions(store EvalEnv) EvalEnv

func (*Tracer) Patches

func (t *Tracer) Patches() []expr.Option

type TreePrinter

type TreePrinter interface {
	EvalEnv() EvalEnv
	PeekNodeEvalResultOutput(node ast.Node) any
}

type TreePrinterOption

type TreePrinterOption func(*treePrinterConfig) error

func WithOnCallNodeHook

func WithOnCallNodeHook(fn func(tp TreePrinter, tree treeprint.Tree, callNode *ast.CallNode, callOutput any)) TreePrinterOption

type VariableDeclaratorNodeTraceInfo

type VariableDeclaratorNodeTraceInfo struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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