Class: DeepCover::Node::Masgn

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

Overview

Some multiple assignments are the only cases where Ruby syntax rules won’t allow us to insert tracking code where we’d like it to be run.

For example:

method.a, b, method_2.c = [...]

We’d like to add a tracker after the call to ‘a=` and before the assignment to b and the call to `method_2`.

We can’t really do this with simple insertions, so we temporarily of strategy for BackwardsStrategy

Defined Under Namespace

Classes: BackwardsNode, ConstantAssignment, ConstantCbase, ConstantScopeWrapper, DynamicReceiverWrap, LeftSide, SelfReceiver, Setter, Splat, VariableAssignment

Constant Summary collapse

BASE_MAP =
{
  cvasgn: VariableAssignment, gvasgn: VariableAssignment,
  ivasgn: VariableAssignment, lvasgn: VariableAssignment,
  casgn: ConstantAssignment,
  send: Setter,
}.freeze

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 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

#children_nodes_in_flow_orderObject



195
196
197
# File 'lib/deep_cover/node/assignments.rb', line 195

def children_nodes_in_flow_order
  [value, left]
end

#execution_countObject



191
192
193
# File 'lib/deep_cover/node/assignments.rb', line 191

def execution_count
  value.flow_completion_count
end