@@ -402,8 +402,7 @@ func ExamplePatch() {
402402 /*
403403 type patcher struct{}
404404
405- func (p *patcher) Enter(_ *ast.Node) {}
406- func (p *patcher) Exit(node *ast.Node) {
405+ func (p *patcher) Visit(node *ast.Node) {
407406 switch n := (*node).(type) {
408407 case *ast.MemberNode:
409408 ast.Patch(node, &ast.CallNode{
@@ -1200,8 +1199,7 @@ var stringer = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
12001199
12011200type stringerPatcher struct {}
12021201
1203- func (p * stringerPatcher ) Enter (_ * ast.Node ) {}
1204- func (p * stringerPatcher ) Exit (node * ast.Node ) {
1202+ func (p * stringerPatcher ) Visit (node * ast.Node ) {
12051203 t := (* node ).Type ()
12061204 if t == nil {
12071205 return
@@ -1234,8 +1232,7 @@ func TestPatch(t *testing.T) {
12341232
12351233type lengthPatcher struct {}
12361234
1237- func (p * lengthPatcher ) Enter (_ * ast.Node ) {}
1238- func (p * lengthPatcher ) Exit (node * ast.Node ) {
1235+ func (p * lengthPatcher ) Visit (node * ast.Node ) {
12391236 switch n := (* node ).(type ) {
12401237 case * ast.MemberNode :
12411238 if prop , ok := n .Property .(* ast.StringNode ); ok && prop .Value == "length" {
@@ -1601,8 +1598,7 @@ func (is) Nil(a interface{}) bool {
16011598
16021599type patcher struct {}
16031600
1604- func (p * patcher ) Enter (_ * ast.Node ) {}
1605- func (p * patcher ) Exit (node * ast.Node ) {
1601+ func (p * patcher ) Visit (node * ast.Node ) {
16061602 switch n := (* node ).(type ) {
16071603 case * ast.MemberNode :
16081604 ast .Patch (node , & ast.CallNode {
0 commit comments