protected virtual BoundStatement RewriteVariableDeclaration(BoundVariableDeclaration node) { BoundExpression initializer = RewriteExpression(node.Initializer); if (initializer == node.Initializer) { return(node); } return(new BoundVariableDeclaration(node.Variable, initializer)); }
private static void WriteVariableDeclaration(BoundVariableDeclaration node, IndentedTextWriter writer) { writer.WriteKeyword(node.Variable.IsReadOnly ? SyntaxKind.LetKeyword : SyntaxKind.VarKeyword); writer.WriteWhiteSpace(); writer.WriteIdentifier(node.Variable.Name); writer.WriteWhiteSpace(); writer.WritePunctuation(SyntaxKind.EqualsToken); writer.WriteWhiteSpace(); node.Initializer.WriteTo(writer); writer.WriteLine(); }