public override SyntaxNode VisitInterpolation(InterpolationSyntax node) { var literalExpression = node.Expression as LiteralExpressionSyntax; if (literalExpression != null && literalExpression.IsKind(SyntaxKind.NumericLiteralExpression)) { var index = (int)literalExpression.Token.Value; if (index >= 0 && index < expandedArguments.Length) { return(node.WithExpression(expandedArguments[index])); } } return(base.VisitInterpolation(node)); }
public override SyntaxNode VisitInterpolation(InterpolationSyntax node) { ExpressionSyntax expression = node.Expression; if (expression?.Kind() == SyntaxKind.NumericLiteralExpression) { var literalExpression = (LiteralExpressionSyntax)expression; var index = (int)literalExpression.Token.Value; if (index >= 0 && index < _interpolationExpressions.Length) { return(node.WithExpression(_interpolationExpressions[index])); } } return(base.VisitInterpolation(node)); }
public override SyntaxNode VisitInterpolation(InterpolationSyntax node) { if (node == null) { throw new ArgumentNullException(nameof(node)); } var literalExpression = node.Expression as LiteralExpressionSyntax; if (literalExpression?.IsKind(SyntaxKind.NumericLiteralExpression) == true) { var index = (int)literalExpression.Token.Value; if (index >= 0 && index < _expandedArguments.Length) { return(node.WithExpression(_expandedArguments[index])); } } return(base.VisitInterpolation(node)); }
public override SyntaxNode VisitInterpolation(InterpolationSyntax node) { var literalExpression = node.Expression as LiteralExpressionSyntax; if (literalExpression != null && literalExpression.IsKind(SyntaxKind.NumericLiteralExpression)) { var index = (int)literalExpression.Token.Value; if (index >= 0 && index < expandedArguments.Length) { return node.WithExpression(expandedArguments[index]); } } return base.VisitInterpolation(node); }