Exemplo n.º 1
0
 void ISyntaxVisitor.VisitParenthesizedExpressionSyntax(ParenthesizedExpressionSyntax syntax) => ReplaceCurrent(syntax, ReplaceParenthesizedExpressionSyntax);
Exemplo n.º 2
0
 public virtual void VisitParenthesizedExpressionSyntax(ParenthesizedExpressionSyntax syntax)
 {
     this.Visit(syntax.OpenParen);
     this.Visit(syntax.Expression);
     this.Visit(syntax.CloseParen);
 }
Exemplo n.º 3
0
        protected virtual ParenthesizedExpressionSyntax ReplaceParenthesizedExpressionSyntax(ParenthesizedExpressionSyntax syntax)
        {
            var hasChanges = Rewrite(syntax.OpenParen, out var openParen);

            hasChanges |= Rewrite(syntax.Expression, out var expression);
            hasChanges |= Rewrite(syntax.CloseParen, out var closeParen);

            if (!hasChanges)
            {
                return(syntax);
            }

            return(new ParenthesizedExpressionSyntax(openParen, expression, closeParen));
        }