예제 #1
0
 public virtual void VisitForVariableBlockSyntax(ForVariableBlockSyntax syntax)
 {
     this.Visit(syntax.OpenParen);
     this.Visit(syntax.ItemVariable);
     this.Visit(syntax.Comma);
     this.Visit(syntax.IndexVariable);
     this.Visit(syntax.CloseParen);
 }
예제 #2
0
        protected virtual SyntaxBase ReplaceForVariableBlockSyntax(ForVariableBlockSyntax syntax)
        {
            var hasChanges = TryRewriteStrict(syntax.OpenParen, out var openParen);

            hasChanges |= TryRewriteStrict(syntax.ItemVariable, out var itemVariable);
            hasChanges |= TryRewrite(syntax.Comma, out var comma);
            hasChanges |= TryRewriteStrict(syntax.IndexVariable, out var indexVariable);
            hasChanges |= TryRewrite(syntax.CloseParen, out var closeParen);

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

            return(new ForVariableBlockSyntax(openParen, itemVariable, comma, indexVariable, closeParen));
        }
예제 #3
0
 void ISyntaxVisitor.VisitForVariableBlockSyntax(ForVariableBlockSyntax syntax) => ReplaceCurrent(syntax, ReplaceForVariableBlockSyntax);