예제 #1
0
        protected virtual IfConditionSyntax ReplaceIfExpressionSyntax(IfConditionSyntax syntax)
        {
            var hasChanges = Rewrite(syntax.Keyword, out var keyword);

            hasChanges |= Rewrite(syntax.ConditionExpression, out var conditionExpression);

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

            return(new IfConditionSyntax(keyword, conditionExpression));
        }
예제 #2
0
        protected virtual SyntaxBase ReplaceIfExpressionSyntax(IfConditionSyntax syntax)
        {
            var hasChanges = TryRewriteStrict(syntax.Keyword, out var keyword);

            hasChanges |= TryRewrite(syntax.ConditionExpression, out var conditionExpression);
            hasChanges |= TryRewrite(syntax.Body, out var body);

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

            return(new IfConditionSyntax(keyword, conditionExpression, body));
        }
예제 #3
0
 void ISyntaxVisitor.VisitIfConditionSyntax(IfConditionSyntax syntax) => ReplaceCurrent(syntax, ReplaceIfExpressionSyntax);
예제 #4
0
 public virtual void VisitIfConditionSyntax(IfConditionSyntax syntax)
 {
     this.Visit(syntax.Keyword);
     this.Visit(syntax.ConditionExpression);
     this.Visit(syntax.Body);
 }