class Rufo::Formatter
def visit_unary(node)
def visit_unary(node) # [:unary, :-@, [:vcall, [:@ident, "x", [1, 2]]]] _, op, exp = node consume_op_or_keyword op setting = op == :not ? @spaces_in_commands : @spaces_around_unary first_space = space? consume_space = first_space && setting == :dynamic if consume_space consume_space(want_preserve_whitespace: true) else skip_space_or_newline end if op == :not has_paren = current_token_kind == :on_lparen if has_paren && !first_space write "(" next_token skip_space_or_newline elsif !has_paren && !consume_space write_space end visit exp if has_paren && !first_space skip_space_or_newline check :on_rparen write ")" next_token end else visit exp end end