Visits an embedded Statement (i.e., the single statement body of a loop, `if..else` branch, etc.), possibly returning a new Statement in its place. - If the input node is nil, then the output is nil. - If v.Visit is nil, then the output is the input. - If v.Visit returns nil, then the output is nil
(node *Statement)
| 72 | // - If v.Visit returns nil, then the output is nil. |
| 73 | // - If v.Visit returns a SyntaxList Node, then the output is either the only child of the SyntaxList Node, or a Block containing the nodes in the list. |
| 74 | func (v *NodeVisitor) VisitEmbeddedStatement(node *Statement) *Statement { |
| 75 | if node == nil || v.Visit == nil { |
| 76 | return node |
| 77 | } |
| 78 | |
| 79 | visited := v.Visit(node) |
| 80 | if visited == nil { |
| 81 | return nil |
| 82 | } |
| 83 | return v.liftToBlock(visited) |
| 84 | } |
| 85 | |
| 86 | // Visits a NodeList, possibly returning a new NodeList in its place. |
| 87 | // |
no test coverage detected