class Rufo::Formatter
def visit_array(node)
def visit_array(node) # [:array, elements] # Check if it's `%w(...)` or `%i(...)` case current_token_kind when :on_qwords_beg, :on_qsymbols_beg, :on_words_beg, :on_symbols_beg visit_q_or_i_array(node) return end _, elements = node check :on_lbracket write "[" next_token if elements if elements[0].is_a?(Symbol) visit elements skip_space_or_newline else visit_literal_elements elements end else skip_space_or_newline end check :on_rbracket write "]" next_token end