MCPcopy Create free account
hub / github.com/microsoft/typescript-go / VisitModifiers

Method VisitModifiers

internal/ast/visitor.go:116–128  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
116func (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//

Calls 2

VisitSliceMethod · 0.95
NewModifierListMethod · 0.80

Tested by

no test coverage detected