(pos, expression)
| 35569 | return finishNode(tagExpression, pos); |
| 35570 | } |
| 35571 | function parseCallExpressionRest(pos, expression) { |
| 35572 | while (true) { |
| 35573 | expression = parseMemberExpressionRest(pos, expression, /*allowOptionalChain*/ true); |
| 35574 | var typeArguments = void 0; |
| 35575 | var questionDotToken = parseOptionalToken(28 /* SyntaxKind.QuestionDotToken */); |
| 35576 | if (questionDotToken) { |
| 35577 | typeArguments = tryParse(parseTypeArgumentsInExpression); |
| 35578 | if (isTemplateStartOfTaggedTemplate()) { |
| 35579 | expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments); |
| 35580 | continue; |
| 35581 | } |
| 35582 | } |
| 35583 | if (typeArguments || token() === 20 /* SyntaxKind.OpenParenToken */) { |
| 35584 | // Absorb type arguments into CallExpression when preceding expression is ExpressionWithTypeArguments |
| 35585 | if (!questionDotToken && expression.kind === 228 /* SyntaxKind.ExpressionWithTypeArguments */) { |
| 35586 | typeArguments = expression.typeArguments; |
| 35587 | expression = expression.expression; |
| 35588 | } |
| 35589 | var argumentList = parseArgumentList(); |
| 35590 | var callExpr = questionDotToken || tryReparseOptionalChain(expression) ? |
| 35591 | factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) : |
| 35592 | factory.createCallExpression(expression, typeArguments, argumentList); |
| 35593 | expression = finishNode(callExpr, pos); |
| 35594 | continue; |
| 35595 | } |
| 35596 | if (questionDotToken) { |
| 35597 | // We parsed `?.` but then failed to parse anything, so report a missing identifier here. |
| 35598 | var name = createMissingNode(79 /* SyntaxKind.Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Identifier_expected); |
| 35599 | expression = finishNode(factory.createPropertyAccessChain(expression, questionDotToken, name), pos); |
| 35600 | } |
| 35601 | break; |
| 35602 | } |
| 35603 | return expression; |
| 35604 | } |
| 35605 | function parseArgumentList() { |
| 35606 | parseExpected(20 /* SyntaxKind.OpenParenToken */); |
| 35607 | var result = parseDelimitedList(11 /* ParsingContext.ArgumentExpressions */, parseArgumentExpression); |
no test coverage detected
searching dependent graphs…