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

Method nextTokenCanFollowModifier

internal/parser/parser.go:3966–3991  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3964}
3965
3966func (p *Parser) nextTokenCanFollowModifier() bool {
3967 switch p.token {
3968 case ast.KindConstKeyword:
3969 // 'const' is only a modifier if followed by 'enum'.
3970 return p.nextToken() == ast.KindEnumKeyword
3971 case ast.KindExportKeyword:
3972 p.nextToken()
3973 if p.token == ast.KindDefaultKeyword {
3974 return p.lookAhead((*Parser).nextTokenCanFollowDefaultKeyword)
3975 }
3976 if p.token == ast.KindTypeKeyword {
3977 return p.lookAhead((*Parser).nextTokenCanFollowExportModifier)
3978 }
3979 return p.canFollowExportModifier()
3980 case ast.KindDefaultKeyword:
3981 return p.nextTokenCanFollowDefaultKeyword()
3982 case ast.KindStaticKeyword:
3983 p.nextToken()
3984 return p.canFollowModifier()
3985 case ast.KindGetKeyword, ast.KindSetKeyword:
3986 p.nextToken()
3987 return p.canFollowGetOrSetKeyword()
3988 default:
3989 return p.nextTokenIsOnSameLineAndCanFollowModifier()
3990 }
3991}
3992
3993func (p *Parser) nextTokenCanFollowDefaultKeyword() bool {
3994 switch p.nextToken() {

Callers 2

Calls 7

nextTokenMethod · 0.95
lookAheadMethod · 0.95
canFollowModifierMethod · 0.95

Tested by

no test coverage detected