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

Function getCombinedFlags

internal/ast/utilities.go:1161–1175  ·  view source on GitHub ↗
(node *Node, getFlags func(*Node) T)

Source from the content-addressed store, hash-verified

1159}
1160
1161func getCombinedFlags[T ~uint32](node *Node, getFlags func(*Node) T) T {
1162 node = GetRootDeclaration(node)
1163 flags := getFlags(node)
1164 if node.Kind == KindVariableDeclaration {
1165 node = node.Parent
1166 }
1167 if node != nil && node.Kind == KindVariableDeclarationList {
1168 flags |= getFlags(node)
1169 node = node.Parent
1170 }
1171 if node != nil && node.Kind == KindVariableStatement {
1172 flags |= getFlags(node)
1173 }
1174 return flags
1175}
1176
1177func GetCombinedModifierFlags(node *Node) ModifierFlags {
1178 return getCombinedFlags(node, (*Node).ModifierFlags)

Callers 2

GetCombinedModifierFlagsFunction · 0.85
GetCombinedNodeFlagsFunction · 0.85

Calls 1

GetRootDeclarationFunction · 0.85

Tested by

no test coverage detected