class Rufo::Formatter
def visit_binary(node)
def visit_binary(node) # [:binary, left, op, right] _, left, op, right = node # If this binary is not at the beginning of a line, if there's # a newline following the op we want to align it with the left # value. So for example: # # var = left_exp || # right_exp # # But: # # def foo # left_exp || # right_exp # end needed_indent = @column == @indent ? next_indent : @column base_column = @column token_column = current_token_column visit left needs_space = space? has_backslash, first_space = skip_space_backslash if has_backslash needs_space = true write " \\" write_line write_indent(next_indent) else write_space end consume_op_or_keyword op first_space = skip_space if newline? || comment? indent_after_space right, want_space: needs_space, needed_indent: needed_indent, token_column: token_column, base_column: base_column else write_space visit right end end