Sha256: cf35e044b8f5c2404382bcc16cab5f7cb6e8822da037eeacf7b437fb8895d7c5

Contents?: true

Size: 907 Bytes

Versions: 11

Compression:

Stored size: 907 Bytes

Contents

module Mutant
  class Mutator
    class Node

      # Mutator for begin nodes
      class Begin < self

        handle(:begin)

      private

        # Emit mutants
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          Util::Array.each(children, self) do |children|
            emit_child_subset(children)
          end
          children.each_with_index do |child, index|
            mutate_child(index)
            emit(child) unless children.eql?([child])
          end
        end

        # Emit child subset
        #
        # @param [Array<Parser::AST::Node>] children
        #
        # @return [undefined]
        #
        # @api private
        #
        def emit_child_subset(children)
          return if children.length < 2
          emit_type(*children)
        end

      end # Block
    end # Node
  end # Mutator
end # Mutant

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mutant-0.7.4 lib/mutant/mutator/node/begin.rb
mutant-0.7.3 lib/mutant/mutator/node/begin.rb
mutant-0.7.2 lib/mutant/mutator/node/begin.rb
mutant-0.7.1 lib/mutant/mutator/node/begin.rb
mutant-0.6.7 lib/mutant/mutator/node/begin.rb
mutant-0.6.6 lib/mutant/mutator/node/begin.rb
mutant-0.6.5 lib/mutant/mutator/node/begin.rb
mutant-0.6.4 lib/mutant/mutator/node/begin.rb
mutant-0.6.3 lib/mutant/mutator/node/begin.rb
mutant-0.6.2 lib/mutant/mutator/node/begin.rb
mutant-0.6.0 lib/mutant/mutator/node/begin.rb