Replace replaces the current Node with n. The replacement node is not walked by Apply.
(n ast.Node)
| 104 | // Replace replaces the current Node with n. |
| 105 | // The replacement node is not walked by Apply. |
| 106 | func (c *Cursor) Replace(n ast.Node) { |
| 107 | v := c.field() |
| 108 | if i := c.Index(); i >= 0 { |
| 109 | v = v.Index(i) |
| 110 | } |
| 111 | v.Set(reflect.ValueOf(n)) |
| 112 | } |
| 113 | |
| 114 | // D// application carries all the shared data so we can pass it around cheaply. |
| 115 | type application struct { |
no test coverage detected