MCPcopy Create free account
hub / github.com/microsoft/typescript-go / tryParseImportAttributes

Method tryParseImportAttributes

internal/parser/parser.go:2501–2509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2499}
2500
2501func (p *Parser) tryParseImportAttributes() *ast.Node {
2502 if p.token == ast.KindWithKeyword || (p.token == ast.KindAssertKeyword && !p.hasPrecedingLineBreak()) {
2503 if p.token == ast.KindAssertKeyword {
2504 p.parseErrorAtCurrentToken(diagnostics.Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert)
2505 }
2506 return p.parseImportAttributes(p.token, false /*skipKeyword*/)
2507 }
2508 return nil
2509}
2510
2511func (p *Parser) parseExportAssignment(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList) *ast.Node {
2512 saveContextFlags := p.contextFlags

Calls 3

hasPrecedingLineBreakMethod · 0.95
parseImportAttributesMethod · 0.95

Tested by

no test coverage detected