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
  token_column = current_token_column
  check :on_lbracket
  write "["
  next_token
  if elements
    visit_literal_elements to_ary(elements), inside_array: true, token_column: token_column
  else
    skip_space_or_newline
  end
  check :on_rbracket
  write "]"
  next_token
end