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

Function parseJSDocLink

test/fixtures/snapshot/typescript.js:37849–37877  ·  view source on GitHub ↗
(start)

Source from the content-addressed store, hash-verified

37847 return next === 5 /* SyntaxKind.WhitespaceTrivia */ || next === 4 /* SyntaxKind.NewLineTrivia */;
37848 }
37849 function parseJSDocLink(start) {
37850 var linkType = tryParse(parseJSDocLinkPrefix);
37851 if (!linkType) {
37852 return undefined;
37853 }
37854 nextTokenJSDoc(); // start at token after link, then skip any whitespace
37855 skipWhitespace();
37856 // parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error
37857 var p2 = getNodePos();
37858 var name = ts.tokenIsIdentifierOrKeyword(token())
37859 ? parseEntityName(/*allowReservedWords*/ true)
37860 : undefined;
37861 if (name) {
37862 while (token() === 80 /* SyntaxKind.PrivateIdentifier */) {
37863 reScanHashToken(); // rescan #id as # id
37864 nextTokenJSDoc(); // then skip the #
37865 name = finishNode(factory.createJSDocMemberName(name, parseIdentifier()), p2);
37866 }
37867 }
37868 var text = [];
37869 while (token() !== 19 /* SyntaxKind.CloseBraceToken */ && token() !== 4 /* SyntaxKind.NewLineTrivia */ && token() !== 1 /* SyntaxKind.EndOfFileToken */) {
37870 text.push(scanner.getTokenText());
37871 nextTokenJSDoc();
37872 }
37873 var create = linkType === "link" ? factory.createJSDocLink
37874 : linkType === "linkcode" ? factory.createJSDocLinkCode
37875 : factory.createJSDocLinkPlain;
37876 return finishNode(create(name, text.join("")), start, scanner.getTextPos());
37877 }
37878 function parseJSDocLinkPrefix() {
37879 skipWhitespaceOrAsterisk();
37880 if (token() === 18 /* SyntaxKind.OpenBraceToken */

Callers 2

parseJSDocCommentWorkerFunction · 0.85
parseTagCommentsFunction · 0.85

Calls 12

tryParseFunction · 0.85
nextTokenJSDocFunction · 0.85
skipWhitespaceFunction · 0.85
getNodePosFunction · 0.85
parseEntityNameFunction · 0.85
reScanHashTokenFunction · 0.85
finishNodeFunction · 0.85
parseIdentifierFunction · 0.85
tokenFunction · 0.70
createFunction · 0.70
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…