Exemple #1
0
        public override SyntaxNode VisitParenthesizedExpression(ParenthesizedExpressionSyntax node)
        {
            if (node.Expression.Kind() == SyntaxKind.ParenthesizedExpression)
            {
                return(VisitParenthesizedExpression(node.DescendantNodes().OfType <ParenthesizedExpressionSyntax>().First()));
            }

            if (node.Expression.Kind() == SyntaxKind.NumericLiteralExpression)
            {
                return(SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression)
                       .WithToken(node.Expression.GetFirstToken()));
            }

            return(base.VisitParenthesizedExpression(node));
        }