MCPcopy Index your code
hub / github.com/nodejs/node / parseJSDocType

Function parseJSDocType

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

Source from the content-addressed store, hash-verified

33369 /*initializer*/ undefined), pos);
33370 }
33371 function parseJSDocType() {
33372 scanner.setInJSDocType(true);
33373 var pos = getNodePos();
33374 if (parseOptional(141 /* SyntaxKind.ModuleKeyword */)) {
33375 // TODO(rbuckton): We never set the type for a JSDocNamepathType. What should we put here?
33376 var moduleTag = factory.createJSDocNamepathType(/*type*/ undefined);
33377 terminate: while (true) {
33378 switch (token()) {
33379 case 19 /* SyntaxKind.CloseBraceToken */:
33380 case 1 /* SyntaxKind.EndOfFileToken */:
33381 case 27 /* SyntaxKind.CommaToken */:
33382 case 5 /* SyntaxKind.WhitespaceTrivia */:
33383 break terminate;
33384 default:
33385 nextTokenJSDoc();
33386 }
33387 }
33388 scanner.setInJSDocType(false);
33389 return finishNode(moduleTag, pos);
33390 }
33391 var hasDotDotDot = parseOptional(25 /* SyntaxKind.DotDotDotToken */);
33392 var type = parseTypeOrTypePredicate();
33393 scanner.setInJSDocType(false);
33394 if (hasDotDotDot) {
33395 type = finishNode(factory.createJSDocVariadicType(type), pos);
33396 }
33397 if (token() === 63 /* SyntaxKind.EqualsToken */) {
33398 nextToken();
33399 return finishNode(factory.createJSDocOptionalType(type), pos);
33400 }
33401 return type;
33402 }
33403 function parseTypeQuery() {
33404 var pos = getNodePos();
33405 parseExpected(112 /* SyntaxKind.TypeOfKeyword */);

Callers 1

parseJSDocParameterFunction · 0.85

Calls 7

getNodePosFunction · 0.85
parseOptionalFunction · 0.85
nextTokenJSDocFunction · 0.85
finishNodeFunction · 0.85
parseTypeOrTypePredicateFunction · 0.85
nextTokenFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…