class Rufo::Formatter

def visit_begin_or_end(node, keyword)

def visit_begin_or_end(node, keyword)
  # [:BEGIN, body]
  _, body = node
  consume_keyword(keyword)
  consume_space
  closing_brace_token, _index = find_closing_brace_token
  # If the whole block fits into a single line, format
  # in a single line
  if current_token_line == closing_brace_token[0][0]
    consume_token :on_lbrace
    consume_space
    visit_exps body, with_lines: false
    consume_space
    consume_token :on_rbrace
  else
    consume_token :on_lbrace
    indent_body body
    write_indent
    consume_token :on_rbrace
  end
end