class Rufo::Formatter
def visit_bodystmt(node)
def visit_bodystmt(node) # [:bodystmt, body, rescue_body, else_body, ensure_body] _, body, rescue_body, else_body, ensure_body = node inside_type_body = @inside_type_body current_type = @current_type @inside_type_body = false line = @line indent_body body, want_multiline: inside_type_body && @double_newline_inside_type == :dynamic while rescue_body # [:rescue, type, name, body, more_rescue] _, type, name, body, more_rescue = rescue_body write_indent consume_keyword "rescue" if type skip_space write_space indent(@column) do visit_rescue_types(type) end end if name skip_space write_space consume_op "=>" skip_space write_space visit name end indent_body body rescue_body = more_rescue end if else_body # [:else, body] write_indent consume_keyword "else" indent_body else_body[1] end if ensure_body # [:ensure, body] write_indent consume_keyword "ensure" indent_body ensure_body[1] end if inside_type_body && current_type && @visibility_indent_in_action[current_type] @indent -= @indent_size @visibility_indent_in_action.delete current_type end write_indent if @line != line consume_keyword "end" end