Documentation
¶
Overview ¶
Package postprocess refines Chawathe AST edit scripts through structural move scoring, stationary normalization, subtree collapsing, and syntactic move grouping.
Index ¶
- func Collapse(es *actions.EditScript, ms *engine.Mapping, ...) *actions.EditScript
- func GroupMoves(es *actions.EditScript, ms *engine.Mapping) *actions.EditScript
- func KillChildren(parent *treesitter.ASTNode, actionMap map[*treesitter.ASTNode]*actions.Action, ...)
- func Run(es *actions.EditScript, ms *engine.Mapping, ...) *actions.EditScript
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collapse ¶
func Collapse( es *actions.EditScript, ms *engine.Mapping, srcRoot, dstRoot *treesitter.ASTNode, ) *actions.EditScript
Collapse cleans up fine-grained actions in the edit script by folding fully inserted or deleted children into subtree actions, and dropping redundant scaffolding and wrapper actions.
func GroupMoves ¶
func GroupMoves(es *actions.EditScript, ms *engine.Mapping) *actions.EditScript
GroupMoves groups Move actions that share the same source and destination parents. Swapped moves and parent-child moves get separate group IDs (and colors) instead of sharing one.
func KillChildren ¶
func KillChildren( parent *treesitter.ASTNode, actionMap map[*treesitter.ASTNode]*actions.Action, suppressed map[*actions.Action]bool, )
KillChildren marks all descendant actions as suppressed under a collapsed subtree.
func Run ¶
func Run( es *actions.EditScript, ms *engine.Mapping, srcRoot, dstRoot *treesitter.ASTNode, ) *actions.EditScript
Run applies postprocessing passes (collapsing subtrees and grouping moves) to the edit script.
Types ¶
This section is empty.