MCPcopy Create free account
hub / github.com/nodejs/node / nextTokenCanFollowModifier

Function nextTokenCanFollowModifier

test/fixtures/snapshot/typescript.js:32462–32486  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32460 return canFollowModifier();
32461 }
32462 function nextTokenCanFollowModifier() {
32463 switch (token()) {
32464 case 85 /* SyntaxKind.ConstKeyword */:
32465 // 'const' is only a modifier if followed by 'enum'.
32466 return nextToken() === 92 /* SyntaxKind.EnumKeyword */;
32467 case 93 /* SyntaxKind.ExportKeyword */:
32468 nextToken();
32469 if (token() === 88 /* SyntaxKind.DefaultKeyword */) {
32470 return lookAhead(nextTokenCanFollowDefaultKeyword);
32471 }
32472 if (token() === 152 /* SyntaxKind.TypeKeyword */) {
32473 return lookAhead(nextTokenCanFollowExportModifier);
32474 }
32475 return canFollowExportModifier();
32476 case 88 /* SyntaxKind.DefaultKeyword */:
32477 return nextTokenCanFollowDefaultKeyword();
32478 case 124 /* SyntaxKind.StaticKeyword */:
32479 case 136 /* SyntaxKind.GetKeyword */:
32480 case 149 /* SyntaxKind.SetKeyword */:
32481 nextToken();
32482 return canFollowModifier();
32483 default:
32484 return nextTokenIsOnSameLineAndCanFollowModifier();
32485 }
32486 }
32487 function canFollowExportModifier() {
32488 return token() !== 41 /* SyntaxKind.AsteriskToken */
32489 && token() !== 127 /* SyntaxKind.AsKeyword */

Callers

nothing calls this directly

Calls 7

nextTokenFunction · 0.85
lookAheadFunction · 0.85
canFollowExportModifierFunction · 0.85
canFollowModifierFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected