class Rufo::Formatter
def visit_comma_separated_list(nodes)
def visit_comma_separated_list(nodes) # When there's *x inside a left hand side assignment # or a case when, it comes as [:op, ...] if nodes[0].is_a?(Symbol) visit nodes return end needs_indent = false if newline? || comment? needs_indent = true base_column = next_indent consume_end_of_line write_indent(base_column) else base_column = @column end nodes.each_with_index do |exp, i| maybe_indent(needs_indent, base_column) do if block_given? yield exp else visit exp end end next if last?(i, nodes) skip_space check :on_comma write "," next_token first_space = current_token if space? skip_space if newline? || comment? indent(base_column || @indent) do consume_end_of_line(want_multiline: false) write_indent end elsif first_space && @preserve_whitespace write_space first_space[2] skip_space_or_newline else write_space skip_space_or_newline end end end