fixes/def.rb
# Looks if there is local variable var_name assignment between the nodes
Looks if there is local variable var_name assignment between the nodes
Looks if there is local variable var_name assignment between the nodes
def real_local_variable?(nodes, var_name)
    for node in nodes
      if node.is_a? AssignLocalVarNode and var_name == node.name
        return true
      elsif node.is_a? ArgumentListNode and node.argument_names.include? var_name
        return true
      elsif !node.is_a? DefNode
        if real_local_variable? node.children, var_name
          return true
        end
      end
    end
    return false
  end
def real_local_variable? ( nodes , var_name ) for node in nodes if node . is_a? AssignLocalVarNode and var_name == node . name return true elsif node . is_a? ArgumentListNode and node . argument_names . include? var_name return true elsif ! node . is_a? DefNode if real_local_variable? node . children , var_name return true end end end return false end
Looks if there is local variable var_name assignment between the nodes
Looks if there is local variable var_name assignment between the nodes
# Standard local variables created by an assignment # Arguments create also local variables
nodes
<not_specific>
var_name
<not_specific>