Patch replaces the node with a new one. Location information is preserved. Type information is lost.
(node *Node, newNode Node)
| 26 | // Location information is preserved. |
| 27 | // Type information is lost. |
| 28 | func Patch(node *Node, newNode Node) { |
| 29 | newNode.SetLocation((*node).Location()) |
| 30 | *node = newNode |
| 31 | } |
| 32 | |
| 33 | // base is a base struct for all nodes. |
| 34 | type base struct { |
searching dependent graphs…