Class: DeepCover::Node::Masgn::Setter

Inherits:
DeepCover::Node show all
Includes:
BackwardsStrategy
Defined in:
lib/deep_cover/node/assignments.rb

Constant Summary

Constants inherited from DeepCover::Node

CLASSES, Complex, Cvasgn, Dsym, Erange, Float, Int, Ivar, Kwarg, Kwoptarg, Kwrestarg, OrAsgn, Rational, Sym, True, Zsuper

Instance Attribute Summary

Attributes inherited from DeepCover::Node

#base_node, #children, #index, #next_sibling, #parent, #previous_sibling

Instance Method Summary collapse

Methods included from BackwardsStrategy

#flow_completion_count, #flow_entry_count

Methods inherited from DeepCover::Node

[], #[], atom, #children_nodes, #covered_code, define_module_class, #each_node, #fancy_type, #find_all, has_evaluated_segments, inherited, #initialize, #simple_literal?, #to_s, #type

Methods included from Memoize

#freeze, included

Constructor Details

This class inherits a constructor from DeepCover::Node

Instance Method Details

#execution_countObject



124
125
126
# File 'lib/deep_cover/node/assignments.rb', line 124

def execution_count
  receiver.flow_completion_count
end

#loc_hashObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/deep_cover/node/assignments.rb', line 104

def loc_hash
  base = super
  if method_name == :[]=
    selector = base[:selector]
    {
      expression: base[:expression],
      selector_begin: selector.resize(1),
      # The = is implicit, so only backtrack the end by one
      selector_end: Parser::Source::Range.new(selector.source_buffer, selector.end_pos - 1, selector.end_pos),
    }
  else
    {
      dot: base[:dot],
      expression: base[:expression],
      selector_begin: base[:selector],
      selector_end: nil, # ,
    }
  end
end