class Rufo::Formatter

def find_closing_brace_token

def find_closing_brace_token
  count = 0
  @tokens.reverse_each do |token|
    (line, column), kind = token
    case kind
    when :on_lbrace, :on_tlambeg
      count += 1
    when :on_rbrace
      count -= 1
      return token if count == 0
    end
  end
  nil
end