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

Function doInContext

internal/parser/parser.go:6386–6392  ·  view source on GitHub ↗
(p *Parser, flags ast.NodeFlags, value bool, f func(p *Parser) T)

Source from the content-addressed store, hash-verified

6384}
6385
6386func doInContext[T any](p *Parser, flags ast.NodeFlags, value bool, f func(p *Parser) T) T {
6387 saveContextFlags := p.contextFlags
6388 p.setContextFlags(flags, value)
6389 result := f(p)
6390 p.contextFlags = saveContextFlags
6391 return result
6392}
6393
6394func (p *Parser) inYieldContext() bool {
6395 return p.contextFlags&ast.NodeFlagsYieldContext != 0

Callers 13

parseWithStatementMethod · 0.85
parseEnumMemberMethod · 0.85
parseTypeMethod · 0.85
parseReturnTypeMethod · 0.85
parseDecoratorMethod · 0.85

Calls 2

setContextFlagsMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected