Documentation
¶
Overview ¶
Package transform implements AST source-to-source transformation that automatically threads cleat.HostCalls through the cleat closure.
Developers declare a package-level var h *cleat.HostCalls. Functions in the closure that reference this global get h inserted as a first parameter; call sites are updated to pass h through.
Key types:
- Config — transformation inputs (analysis, call graph, closure result)
- Result — transformed files and metadata
Key functions:
- Run — applies the transformation to the analyzed packages
Package transform implements AST source-to-source transformation that automatically threads cleat.HostCalls through the cleat closure.
Developers declare a package-level var h *cleat.HostCalls (the "context object" pattern). Functions in the cleat closure that reference this global get h inserted as a first parameter. Call sites are updated to pass h through. The global is removed when no longer referenced.
Entry points still declare h as a first parameter — the transform primarily helps with internal helper functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Result *analyzer.AnalysisResult
CallGraph *callgraph.Graph
Closure *closure.Result
}
Config holds the inputs for the transformation.