(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList)
| 2155 | } |
| 2156 | |
| 2157 | func (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 | |
| 2173 | func (p *Parser) parseAmbientExternalModuleDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList) *ast.Node { |
| 2174 | var name *ast.Node |
no test coverage detected