Documentation ¶
Overview ¶
Package astdiff provides a means of diffing Go AST nodes that may be mutated in-place by taking snapshots of their state between successive patch executions.
snap := astdiff.Before(node) modify(node) snap = snap.Diff(node, changelog) modify(node) snap = snap.Diff(node, changelog)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Changelog ¶
type Changelog interface { // Changed informs the changelog that the code in the range [pos, end) // has been modified. Changed(pos, end token.Pos) }
Changelog records the ranges of positions changed over the course of successive patches.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot maintains the current view of the ast.Node being altered over the course of patching.
Click to show internal directories.
Click to hide internal directories.