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

Method parseModuleBlock

internal/parser/parser.go:2197–2207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2195}
2196
2197func (p *Parser) parseModuleBlock() *ast.Node {
2198 pos := p.nodePos()
2199 var statements *ast.NodeList
2200 if p.parseExpected(ast.KindOpenBraceToken) {
2201 statements = p.parseList(PCBlockStatements, (*Parser).parseStatement)
2202 p.parseExpected(ast.KindCloseBraceToken)
2203 } else {
2204 statements = p.createMissingList()
2205 }
2206 return p.finishNode(p.factory.NewModuleBlock(statements), pos)
2207}
2208
2209func (p *Parser) parseModuleOrNamespaceDeclaration(pos int, jsdoc jsdocScannerInfo, modifiers *ast.ModifierList, nested bool, keyword ast.Kind) *ast.Node {
2210 saveHasAwaitIdentifier := p.statementHasAwaitIdentifier

Calls 6

nodePosMethod · 0.95
parseExpectedMethod · 0.95
parseListMethod · 0.95
createMissingListMethod · 0.95
finishNodeMethod · 0.95
NewModuleBlockMethod · 0.80

Tested by

no test coverage detected