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

Function parseSuperExpression

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

Source from the content-addressed store, hash-verified

35182 return parseMemberExpressionRest(pos, expression, /*allowOptionalChain*/ true);
35183 }
35184 function parseSuperExpression() {
35185 var pos = getNodePos();
35186 var expression = parseTokenNode();
35187 if (token() === 29 /* SyntaxKind.LessThanToken */) {
35188 var startPos = getNodePos();
35189 var typeArguments = tryParse(parseTypeArgumentsInExpression);
35190 if (typeArguments !== undefined) {
35191 parseErrorAt(startPos, getNodePos(), ts.Diagnostics.super_may_not_use_type_arguments);
35192 }
35193 }
35194 if (token() === 20 /* SyntaxKind.OpenParenToken */ || token() === 24 /* SyntaxKind.DotToken */ || token() === 22 /* SyntaxKind.OpenBracketToken */) {
35195 return expression;
35196 }
35197 // If we have seen "super" it must be followed by '(' or '.'.
35198 // If it wasn't then just try to parse out a '.' and report an error.
35199 parseExpectedToken(24 /* SyntaxKind.DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access);
35200 // private names will never work with `super` (`super.#foo`), but that's a semantic error, not syntactic
35201 return finishNode(factory.createPropertyAccessExpression(expression, parseRightSideOfDot(/*allowIdentifierNames*/ true, /*allowPrivateIdentifiers*/ true)), pos);
35202 }
35203 function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext, topInvalidNodePosition, openingTag) {
35204 var pos = getNodePos();
35205 var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext);

Callers 1

Calls 8

getNodePosFunction · 0.85
parseTokenNodeFunction · 0.85
tryParseFunction · 0.85
parseErrorAtFunction · 0.85
parseExpectedTokenFunction · 0.85
finishNodeFunction · 0.85
parseRightSideOfDotFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…