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

Method declareSymbolAndAddToSymbolTable

internal/binder/binder.go:433–452  ·  view source on GitHub ↗
(node *ast.Node, symbolFlags ast.SymbolFlags, symbolExcludes ast.SymbolFlags)

Source from the content-addressed store, hash-verified

431}
432
433func (b *Binder) declareSymbolAndAddToSymbolTable(node *ast.Node, symbolFlags ast.SymbolFlags, symbolExcludes ast.SymbolFlags) *ast.Symbol {
434 switch b.container.Kind {
435 case ast.KindModuleDeclaration:
436 return b.declareModuleMember(node, symbolFlags, symbolExcludes)
437 case ast.KindSourceFile:
438 return b.declareSourceFileMember(node, symbolFlags, symbolExcludes)
439 case ast.KindClassExpression, ast.KindClassDeclaration:
440 return b.declareClassMember(node, symbolFlags, symbolExcludes)
441 case ast.KindEnumDeclaration:
442 return b.declareSymbol(ast.GetExports(b.container.Symbol()), b.container.Symbol(), node, symbolFlags, symbolExcludes)
443 case ast.KindTypeLiteral, ast.KindObjectLiteralExpression, ast.KindInterfaceDeclaration, ast.KindJsxAttributes:
444 return b.declareSymbol(ast.GetMembers(b.container.Symbol()), b.container.Symbol(), node, symbolFlags, symbolExcludes)
445 case ast.KindFunctionType, ast.KindConstructorType, ast.KindCallSignature, ast.KindConstructSignature,
446 ast.KindIndexSignature, ast.KindMethodDeclaration, ast.KindMethodSignature, ast.KindConstructor, ast.KindGetAccessor,
447 ast.KindSetAccessor, ast.KindFunctionDeclaration, ast.KindFunctionExpression, ast.KindArrowFunction,
448 ast.KindClassStaticBlockDeclaration, ast.KindTypeAliasDeclaration, ast.KindJSTypeAliasDeclaration, ast.KindMappedType:
449 return b.declareSymbol(ast.GetLocals(b.container), nil /*parent*/, node, symbolFlags, symbolExcludes)
450 }
451 panic("Unhandled case in declareSymbolAndAddToSymbolTable")
452}
453
454func (b *Binder) newFlowNode(flags ast.FlowFlags) *ast.FlowNode {
455 result := b.flowNodeArena.New()

Callers 9

bindMethod · 0.95
bindModuleDeclarationMethod · 0.95
declareModuleSymbolMethod · 0.95
bindImportClauseMethod · 0.95
bindJsxAttributeMethod · 0.95
bindParameterMethod · 0.95
bindTypeParameterMethod · 0.95

Calls 9

declareModuleMemberMethod · 0.95
declareClassMemberMethod · 0.95
declareSymbolMethod · 0.95
GetExportsFunction · 0.92
GetMembersFunction · 0.92
GetLocalsFunction · 0.92
panicFunction · 0.85
SymbolMethod · 0.65

Tested by

no test coverage detected