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

Method parseModuleDeclaration

internal/parser/parser.go:2157–2171  ·  view source on GitHub ↗
(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList)

Source from the content-addressed store, hash-verified

2155}
2156
2157func (p *Parser) parseModuleDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList) *ast.Statement {
2158 keyword := ast.KindModuleKeyword
2159 if p.token == ast.KindGlobalKeyword {
2160 // global augmentation
2161 return p.parseAmbientExternalModuleDeclaration(pos, jsdoc, modifiers)
2162 } else if p.parseOptional(ast.KindNamespaceKeyword) {
2163 keyword = ast.KindNamespaceKeyword
2164 } else {
2165 p.parseExpected(ast.KindModuleKeyword)
2166 if p.token == ast.KindStringLiteral {
2167 return p.parseAmbientExternalModuleDeclaration(pos, jsdoc, modifiers)
2168 }
2169 }
2170 return p.parseModuleOrNamespaceDeclaration(pos, jsdoc, modifiers, false /*nested*/, keyword)
2171}
2172
2173func (p *Parser) parseAmbientExternalModuleDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList) *ast.Node {
2174 var name *ast.Node

Callers 1

Tested by

no test coverage detected