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

Method parseImportEqualsDeclaration

internal/parser/parser.go:2298–2305  ·  view source on GitHub ↗
(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, identifier *ast.Node, isTypeOnly bool)

Source from the content-addressed store, hash-verified

2296}
2297
2298func (p *Parser) parseImportEqualsDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, identifier *ast.Node, isTypeOnly bool) *ast.Node {
2299 p.parseExpected(ast.KindEqualsToken)
2300 moduleReference := p.parseModuleReference()
2301 p.parseSemicolon()
2302 result := p.finishNode(p.factory.NewImportEqualsDeclaration(modifiers, isTypeOnly, identifier, moduleReference), pos)
2303 p.withJSDoc(result, jsdoc)
2304 return result
2305}
2306
2307func (p *Parser) parseModuleReference() *ast.Node {
2308 if p.token == ast.KindRequireKeyword && p.lookAhead((*Parser).nextTokenIsOpenParen) {

Calls 6

parseExpectedMethod · 0.95
parseModuleReferenceMethod · 0.95
parseSemicolonMethod · 0.95
finishNodeMethod · 0.95
withJSDocMethod · 0.95

Tested by

no test coverage detected