Visits a ModifierList, possibly returning a new ModifierList in its place. - If the input ModifierList is nil, the output is nil. - If v.Visit is nil, then the output is the input. - If v.Visit returns nil, the visited Node will be absent in the output. - If v.Visit returns a different Node than th
(nodes *ModifierList)
| 114 | // - If v.Visit returns a SyntaxList Node, then the children of that node will be merged into the output and a new NodeList will be returned. |
| 115 | // - If this method returns a new NodeList for any reason, it will have the same Loc as the input NodeList. |
| 116 | func (v *NodeVisitor) VisitModifiers(nodes *ModifierList) *ModifierList { |
| 117 | if nodes == nil || v.Visit == nil { |
| 118 | return nodes |
| 119 | } |
| 120 | |
| 121 | if result, changed := v.VisitSlice(nodes.Nodes); changed { |
| 122 | list := v.Factory.NewModifierList(result) |
| 123 | list.Loc = nodes.Loc |
| 124 | return list |
| 125 | } |
| 126 | |
| 127 | return nodes |
| 128 | } |
| 129 | |
| 130 | // Visits a slice of Nodes, returning the resulting slice and a value indicating whether the slice was changed. |
| 131 | // |
no test coverage detected