(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, nested bool, keyword ast.Kind)
| 2207 | } |
| 2208 | |
| 2209 | func (p *Parser) parseModuleOrNamespaceDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, nested bool, keyword ast.Kind) *ast.Node { |
| 2210 | saveHasAwaitIdentifier := p.statementHasAwaitIdentifier |
| 2211 | var name *ast.Node |
| 2212 | if nested { |
| 2213 | name = p.parseIdentifierName() |
| 2214 | } else { |
| 2215 | name = p.parseIdentifier() |
| 2216 | } |
| 2217 | var body *ast.Node |
| 2218 | if p.parseOptional(ast.KindDotToken) { |
| 2219 | implicitExport := p.factory.NewModifier(ast.KindExportKeyword) |
| 2220 | implicitExport.Loc = core.NewTextRange(p.nodePos(), p.nodePos()) |
| 2221 | implicitExport.Flags = ast.NodeFlagsReparsed |
| 2222 | implicitModifiers := p.newModifierList(implicitExport.Loc, p.nodeSliceArena.NewSlice1(implicitExport)) |
| 2223 | body = p.parseModuleOrNamespaceDeclaration(p.nodePos(), 0 /*jsdoc*/, implicitModifiers, true /*nested*/, keyword) |
| 2224 | } else { |
| 2225 | body = p.parseModuleBlock() |
| 2226 | } |
| 2227 | result := p.finishNode(p.factory.NewModuleDeclaration(modifiers, keyword, name, body), pos) |
| 2228 | p.withJSDoc(result, jsdoc) |
| 2229 | p.checkJSSyntax(result) |
| 2230 | p.statementHasAwaitIdentifier = saveHasAwaitIdentifier |
| 2231 | return result |
| 2232 | } |
| 2233 | |
| 2234 | func (p *Parser) parseImportDeclarationOrImportEqualsDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList) *ast.Statement { |
| 2235 | p.parseExpected(ast.KindImportKeyword) |
no test coverage detected