Sha256: 295bf5ad59007eab0b3ddb5f838dde0bc8be9329ea18dd02d645c576812279e3

Contents?: true

Size: 782 Bytes

Versions: 6

Compression:

Stored size: 782 Bytes

Contents

module Mutant
  class Mutator
    class Node
      # Mutator for resbody nodes
      class Resbody < self

        handle(:resbody)

        children :captures, :assignment, :body

      private

        # Emit mutations
        #
        # @return [undefined]
        def dispatch
          emit_assignment(nil)
          emit_body_mutations if body
          mutate_captures
        end

        # Mutate captures
        #
        # @return [undefined]
        def mutate_captures
          return unless captures
          Util::Array::Element.call(captures.children).each do |matchers|
            next if matchers.any?(&method(:n_nil?))
            emit_captures(s(:array, *matchers))
          end
        end

      end # Resbody
    end # Node
  end # Mutator
end # Mutant

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.8.16 lib/mutant/mutator/node/resbody.rb
mutant-0.8.15 lib/mutant/mutator/node/resbody.rb
mutant-0.8.14 lib/mutant/mutator/node/resbody.rb
mutant-0.8.13 lib/mutant/mutator/node/resbody.rb
mutant-0.8.12 lib/mutant/mutator/node/resbody.rb
mutant-0.8.11 lib/mutant/mutator/node/resbody.rb