class Rufo::Formatter

def visit_brace_block(node)

def visit_brace_block(node)
  # [:brace_block, args, body]
  _, args, body = node
  # This is for the empty `{ }` block
  if void_exps?(body)
    consume_token :on_lbrace
    consume_block_args args
    consume_space
    consume_token :on_rbrace
    return
  end
  closing_brace_token, index = find_closing_brace_token
  # If the whole block fits into a single line, use braces
  if current_token[0][0] == closing_brace_token[0][0]
    consume_token :on_lbrace
    consume_block_args args
    consume_space
    visit_exps body, false, false
    consume_space
    consume_token :on_rbrace
    return
  end
  # Otherwise it's multiline
  consume_token :on_lbrace
  consume_block_args args
  indent_body body
  write_indent
  consume_token :on_rbrace
end