private static IEnumerable <StatementSyntax> FunctionInjectionStatements(BlockSyntax block, SyntaxNode toReplace, IEnumerable <StatementSyntax> toReplaceWith) { foreach (var statement in block.Statements) { if (Roslyn.SameNode(statement, toReplace)) { foreach (var newStatement in toReplaceWith) { yield return(newStatement); } } else { yield return(statement); } } }