Sha256: 4ceba296b08b7830b83ddbab6c1cd37c8f72ea8b731febffe79524e0e9bcba4a

Contents?: true

Size: 982 Bytes

Versions: 29

Compression:

Stored size: 982 Bytes

Contents

# encoding: utf-8

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

        # Emit child subset
        #
        # @param [Array<Parser::AST::Node>] nodes
        #
        # @return [undefined]
        #
        # @api private
        #
        def emit_child_subset(children)
          case children.length
          when 0
          when 1
            emit(children.first)
          else
            emit_self(*children)
          end
        end

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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
mutant-0.5.17 lib/mutant/mutator/node/begin.rb
mutant-0.5.16 lib/mutant/mutator/node/begin.rb
mutant-0.5.15 lib/mutant/mutator/node/begin.rb
mutant-0.5.14 lib/mutant/mutator/node/begin.rb
mutant-0.5.13 lib/mutant/mutator/node/begin.rb
mutant-0.5.12 lib/mutant/mutator/node/begin.rb
mutant-0.5.11 lib/mutant/mutator/node/begin.rb
mutant-0.5.10 lib/mutant/mutator/node/begin.rb
mutant-0.5.9 lib/mutant/mutator/node/begin.rb
mutant-0.5.8 lib/mutant/mutator/node/begin.rb
mutant-0.5.7 lib/mutant/mutator/node/begin.rb
mutant-0.5.6 lib/mutant/mutator/node/begin.rb
mutant-0.5.5 lib/mutant/mutator/node/begin.rb
mutant-0.5.4 lib/mutant/mutator/node/begin.rb
mutant-0.5.3 lib/mutant/mutator/node/begin.rb
mutant-0.5.2 lib/mutant/mutator/node/begin.rb
mutant-0.5.1 lib/mutant/mutator/node/begin.rb
mutant-0.5.0 lib/mutant/mutator/node/begin.rb
mutant-0.3.6 lib/mutant/mutator/node/begin.rb
mutant-0.3.5 lib/mutant/mutator/node/begin.rb