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

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

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

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

            using (optionalIndent)
            {
                node.Accept(this);
            }
        }
Esempio 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();
     }
 }
Esempio n. 5
0
 public static bool HasSpecialStatement(StatementSyntax statement)
 {
     var yieldChecker = new YieldChecker(false);
     statement.Accept(yieldChecker);
     return yieldChecker.isSpecial;
 }
Esempio 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();
            }
        }
Esempio n. 7
0
 internal static void Visit(IVisitorContext context, string ilVar, StatementSyntax node)
 {
     _ilVar = ilVar;
     node.Accept(new StatementVisitor(context));
 }