def parse_condition
condition = nil
case statement.condition.type
when :int
condition = statement.condition[0] != "0"
when :defined
name = statement.condition[0].source
obj = YARD::Registry.resolve(namespace, name, true)
begin
condition = true if obj || Object.instance_eval("defined? #{name}")
rescue SyntaxError, NameError
condition = false
end
when :var_ref
var = statement.condition[0]
if var == s(:kw, "true")
condition = true
elsif var == s(:kw, "false")
condition = false
end
end
if statement.type == :unless || statement.type == :unless_mod
condition = !condition if condition != nil
end
condition
end