public static bool HasLambdasWithClosedVariables(StatementSyntax statement) { var checker = new LambdaChecker(); statement.Accept(checker); return(checker.hasLambdasWithClosedVariables); }
public static bool HasSpecialStatement(StatementSyntax statement) { var yieldChecker = new YieldChecker(false); statement.Accept(yieldChecker); return(yieldChecker.isSpecial); }
protected virtual void AppendStatementWithOptionalIndent(StatementSyntax node) { var optionalIndent = default(IDisposable); if (!(node is BlockSyntax)) { optionalIndent = Indented(); } using (optionalIndent) { node.Accept(this); } }
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(); } }
public static bool HasSpecialStatement(StatementSyntax statement) { var yieldChecker = new YieldChecker(false); statement.Accept(yieldChecker); return yieldChecker.isSpecial; }
private void VisitBlockStatement(StatementSyntax statement) { if (statement is BlockSyntax) { statement.Accept(this); } else { _writer.WriteLine(); _writer.PushIndent(); statement.Accept(this); _writer.PopIndent(); } }
internal static void Visit(IVisitorContext context, string ilVar, StatementSyntax node) { _ilVar = ilVar; node.Accept(new StatementVisitor(context)); }