private static bool AreEquivalent(StatementSyntax statement1, StatementSyntax statement2) { return(statement1.Kind() == statement2.Kind() && CSharpFactory.AreEquivalent(statement1, statement2) && statement1.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()) && statement2.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia())); }
public static bool AreEquivalent(this StatementSyntax statement, StatementSyntax other) { return(statement.Kind() == other.Kind() && statement.IsEquivalentTo(other, topLevel: false) && statement.DescendantTrivia().All(x => x.IsWhitespaceOrEndOfLineTrivia()) && other.DescendantTrivia().All(x => x.IsWhitespaceOrEndOfLineTrivia())); }
private static bool AreEquivalent(StatementSyntax statement, StatementSyntax statement2) { return(statement.Kind() == statement2.Kind() && statement.IsEquivalentTo(statement2, topLevel: false) && statement.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()) && statement2.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia())); }
private static bool AreEquivalent(StatementSyntax statement, StatementSyntax statement2) { return(statement.Kind() == statement2.Kind() && SyntaxComparer.AreEquivalent(statement, statement2) && statement.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()) && statement2.DescendantTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia())); }
public static void WriteStatementAsBlock(OutputWriter writer, StatementSyntax statement, bool writeBraces = true) { if (statement is BlockSyntax) { WriteBlock(writer, statement.As <BlockSyntax>(), writeBraces); } else { if (writeBraces) { writer.OpenBrace(); } Write(writer, statement); TriviaProcessor.ProcessTrivias(writer, statement.DescendantTrivia()); if (writeBraces) { writer.CloseBrace(); } } }
public static void WriteStatementAsBlock(OutputWriter writer, StatementSyntax statement, bool writeBraces = true) { if (statement is BlockSyntax) WriteBlock(writer, statement.As<BlockSyntax>(), writeBraces); else { if (writeBraces) writer.OpenBrace(); Write(writer, statement); TriviaProcessor.ProcessTrivias(writer, statement.DescendantTrivia()); if (writeBraces) writer.CloseBrace(); } }