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

Function parseYieldExpression

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

Source from the content-addressed store, hash-verified

34473 return !scanner.hasPrecedingLineBreak() && isIdentifier();
34474 }
34475 function parseYieldExpression() {
34476 var pos = getNodePos();
34477 // YieldExpression[In] :
34478 // yield
34479 // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
34480 // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield]
34481 nextToken();
34482 if (!scanner.hasPrecedingLineBreak() &&
34483 (token() === 41 /* SyntaxKind.AsteriskToken */ || isStartOfExpression())) {
34484 return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* SyntaxKind.AsteriskToken */), parseAssignmentExpressionOrHigher()), pos);
34485 }
34486 else {
34487 // if the next token is not on the same line as yield. or we don't have an '*' or
34488 // the start of an expression, then this is just a simple "yield" expression.
34489 return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
34490 }
34491 }
34492 function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
34493 ts.Debug.assert(token() === 38 /* SyntaxKind.EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
34494 var parameter = factory.createParameterDeclaration(

Callers 1

Calls 7

getNodePosFunction · 0.85
nextTokenFunction · 0.85
isStartOfExpressionFunction · 0.85
finishNodeFunction · 0.85
parseOptionalTokenFunction · 0.85
tokenFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…