(identifier *ast.Node, pos int, phaseModifier ast.Kind, skipJSDocLeadingAsterisks bool)
| 2347 | } |
| 2348 | |
| 2349 | func (p *Parser) parseImportClause(identifier *ast.Node, pos int, phaseModifier ast.Kind, skipJSDocLeadingAsterisks bool) *ast.Node { |
| 2350 | // ImportClause: |
| 2351 | // ImportedDefaultBinding |
| 2352 | // NameSpaceImport |
| 2353 | // NamedImports |
| 2354 | // ImportedDefaultBinding, NameSpaceImport |
| 2355 | // ImportedDefaultBinding, NamedImports |
| 2356 | // If there was no default import or if there is comma token after default import |
| 2357 | // parse namespace or named imports |
| 2358 | var namedBindings *ast.Node |
| 2359 | saveHasAwaitIdentifier := p.statementHasAwaitIdentifier |
| 2360 | if identifier == nil || p.parseOptional(ast.KindCommaToken) { |
| 2361 | if skipJSDocLeadingAsterisks { |
| 2362 | p.scanner.SetSkipJSDocLeadingAsterisks(true) |
| 2363 | } |
| 2364 | if p.token == ast.KindAsteriskToken { |
| 2365 | namedBindings = p.parseNamespaceImport() |
| 2366 | } else { |
| 2367 | namedBindings = p.parseNamedImports() |
| 2368 | } |
| 2369 | if skipJSDocLeadingAsterisks { |
| 2370 | p.scanner.SetSkipJSDocLeadingAsterisks(false) |
| 2371 | } |
| 2372 | } |
| 2373 | result := p.finishNode(p.factory.NewImportClause(phaseModifier, identifier, namedBindings), pos) |
| 2374 | p.statementHasAwaitIdentifier = saveHasAwaitIdentifier |
| 2375 | return result |
| 2376 | } |
| 2377 | |
| 2378 | func (p *Parser) parseNamespaceImport() *ast.Node { |
| 2379 | // NameSpaceImport: |
no test coverage detected