MCPcopy Index your code
hub / github.com/microsoft/typescript-go / parseEntityName

Method parseEntityName

internal/parser/parser.go:2906–2923  ·  view source on GitHub ↗
(allowReservedWords bool, diagnosticMessage *diagnostics.Message)

Source from the content-addressed store, hash-verified

2904}
2905
2906func (p *Parser) parseEntityName(allowReservedWords bool, diagnosticMessage *diagnostics.Message) *ast.Node {
2907 pos := p.nodePos()
2908 var entity *ast.Node
2909 if allowReservedWords {
2910 entity = p.parseIdentifierNameWithDiagnostic(diagnosticMessage)
2911 } else {
2912 entity = p.parseIdentifierWithDiagnostic(diagnosticMessage, nil)
2913 }
2914 for p.parseOptional(ast.KindDotToken) {
2915 if p.token == ast.KindLessThanToken {
2916 // The entity is part of a JSDoc-style generic. We will use the gap between `typeName` and
2917 // `typeArguments` to report it as a grammar error in the checker.
2918 break
2919 }
2920 entity = p.finishNode(p.factory.NewQualifiedName(entity, p.parseRightSideOfDot(allowReservedWords, false /*allowPrivateIdentifiers*/, true /*allowUnicodeEscapeSequenceInIdentifierName*/)), pos)
2921 }
2922 return entity
2923}
2924
2925func (p *Parser) parseRightSideOfDot(allowIdentifierNames bool, allowPrivateIdentifiers bool, allowUnicodeEscapeSequenceInIdentifierName bool) *ast.Node {
2926 // Technically a keyword is valid here as all identifiers and keywords are identifier names.

Callers 4

parseModuleReferenceMethod · 0.95
parseTypeQueryMethod · 0.95
ParseIsolatedEntityNameFunction · 0.80

Calls 7

nodePosMethod · 0.95
parseOptionalMethod · 0.95
finishNodeMethod · 0.95
parseRightSideOfDotMethod · 0.95
NewQualifiedNameMethod · 0.80

Tested by

no test coverage detected