Exemplo n.º 1
0
        public static bool HasLambdasWithClosedVariables(StatementSyntax statement)
        {
            var checker = new LambdaChecker();

            statement.Accept(checker);
            return(checker.hasLambdasWithClosedVariables);
        }
Exemplo n.º 2
0
        public static bool HasSpecialStatement(StatementSyntax statement)
        {
            var yieldChecker = new YieldChecker(false);

            statement.Accept(yieldChecker);
            return(yieldChecker.isSpecial);
        }
Exemplo n.º 3
0
        protected virtual void AppendStatementWithOptionalIndent(StatementSyntax node)
        {
            var optionalIndent = default(IDisposable);

            if (!(node is BlockSyntax))
            {
                optionalIndent = Indented();
            }

            using (optionalIndent)
            {
                node.Accept(this);
            }
        }
Exemplo n.º 4
0
 protected void AcceptStatement(StatementSyntax statement, State breakState = null, State continueState = null)
 {
     if (breakState != null)
     {
         breakStates.Push(breakState);
     }
     if (continueState != null)
     {
         continueStates.Push(continueState);
     }
     statement.Accept(this);
     if (breakState != null)
     {
         breakStates.Pop();
     }
     if (continueState != null)
     {
         continueStates.Pop();
     }
 }
Exemplo n.º 5
0
 public static bool HasSpecialStatement(StatementSyntax statement)
 {
     var yieldChecker = new YieldChecker(false);
     statement.Accept(yieldChecker);
     return yieldChecker.isSpecial;
 }
Exemplo n.º 6
0
        private void VisitBlockStatement(StatementSyntax statement)
        {
            if (statement is BlockSyntax)
            {
                statement.Accept(this);
            }
            else
            {
                _writer.WriteLine();
                _writer.PushIndent();

                statement.Accept(this);

                _writer.PopIndent();
            }
        }
Exemplo n.º 7
0
 internal static void Visit(IVisitorContext context, string ilVar, StatementSyntax node)
 {
     _ilVar = ilVar;
     node.Accept(new StatementVisitor(context));
 }