Documentation
¶
Overview ¶
Package hook breaks the lisp/codewalk import cycle. Only lisp injects these adapters, and internal/codewalk consumes them after lisp initializes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Forms any
Forms holds the form-only runtime visitor adapter.
var Occurrences any
Occurrences holds func(*lisp.CodeWalker, int, *lisp.LVal) bool.
var PackageForms any
PackageForms holds func([]*lisp.LVal) []*lisp.LVal.
var SyntaxCall any
SyntaxCall holds the raw operator classifier with its registry call policy.
var SyntaxOp any
SyntaxOp holds the raw-syntax operator classifier. Visitors stay on the codewalk side of the bridge so their callbacks do not escape through any.
var Walk any
Walk holds the source adapter accepting a walker, Options, and a form. Its typed signature is recovered by internal/codewalk.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
Binding describes application-defined binding syntax. The caller validates both indices; a negative NameIndex means the form declares no name.
type CallPolicy ¶ added in v1.74.0
type CallPolicy struct {
FormalsIndex int
CallsStart int
BindingStart int
Role FormalsRole
BindingFormals bool
Clauses bool
}
CallPolicy selects executable children and literal signatures in raw syntax.
type FormalsRole ¶ added in v1.74.0
type FormalsRole uint8
FormalsRole describes the use of a literal formals list.
const ( Parameters FormalsRole = iota Constructor Benchmark )
type Node ¶
type Node[V, E any] struct { Node *V Owner *V Formals *V Binding *V Init *V Op string Depth int Head bool Bound bool Function bool Outer bool Template bool Event E Scope ScopeCategory Role FormalsRole }
Node carries source-only metadata without depending on lisp. Both sides instantiate exactly this type, so the bridge does not copy each event.
type Options ¶
type Options[V, E any] struct { Visit func(*Node[V, E]) bool BindingForm func(*V) *Binding Reference func(*V) Form func(*V, string, int) bool Formals func(*Node[V, E]) End func(int) EndDepth *int SkipLiterals bool DeclarationsOnly bool SyntacticCalls bool }
Options carries source visitor policy across the import-cycle bridge.
type ScopeCategory ¶ added in v1.74.0
type ScopeCategory uint8
ScopeCategory describes the scope an internal source event opens.
const ( ScopeFunction ScopeCategory = iota ScopeAnonymous ScopeLocal ScopeFunctions ScopeMacros ScopeLoop ScopeTest )