class SyntaxTree::Defined


defined?(variable)
and without parentheses.
Defined represents the use of the defined? operator. It can be used with

def ===(other)

def ===(other)
  other.is_a?(Defined) && value === other.value
end

def accept(visitor)

def accept(visitor)
  visitor.visit_defined(self)
end

def child_nodes

def child_nodes
  [value]
end

def copy(value: nil, location: nil)

def copy(value: nil, location: nil)
  node =
    Defined.new(
      value: value || self.value,
      location: location || self.location
    )
  node.comments.concat(comments.map(&:copy))
  node
end

def deconstruct_keys(_keys)

def deconstruct_keys(_keys)
  { value: value, location: location, comments: comments }
end

def format(q)

def format(q)
  q.text("defined?(")
  q.group do
    q.indent do
      q.breakable_empty
      q.format(value)
    end
    q.breakable_empty
  end
  q.text(")")
end

def initialize(value:, location:)

def initialize(value:, location:)
  @value = value
  @location = location
  @comments = []
end