(allowReservedWords bool, diagnosticMessage *diagnostics.Message)
| 2904 | } |
| 2905 | |
| 2906 | func (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 | |
| 2925 | func (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. |
no test coverage detected