Sha256: c96b4e54241cd16a6f456cd7671924e7bfb769808a2536b245e7caf40971ec0d

Contents?: true

Size: 813 Bytes

Versions: 17

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

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

17 entries across 17 versions & 1 rubygems

Version Path
mutant-0.9.8 lib/mutant/mutator/node/resbody.rb
mutant-0.9.7 lib/mutant/mutator/node/resbody.rb
mutant-0.9.6 lib/mutant/mutator/node/resbody.rb
mutant-0.9.5 lib/mutant/mutator/node/resbody.rb
mutant-0.9.4 lib/mutant/mutator/node/resbody.rb
mutant-0.9.3 lib/mutant/mutator/node/resbody.rb
mutant-0.9.2 lib/mutant/mutator/node/resbody.rb
mutant-0.9.1 lib/mutant/mutator/node/resbody.rb
mutant-0.9.0 lib/mutant/mutator/node/resbody.rb
mutant-0.8.24 lib/mutant/mutator/node/resbody.rb
mutant-0.8.23 lib/mutant/mutator/node/resbody.rb
mutant-0.8.22 lib/mutant/mutator/node/resbody.rb
mutant-0.8.21 lib/mutant/mutator/node/resbody.rb
mutant-0.8.20 lib/mutant/mutator/node/resbody.rb
mutant-0.8.19 lib/mutant/mutator/node/resbody.rb
mutant-0.8.18 lib/mutant/mutator/node/resbody.rb
mutant-0.8.17 lib/mutant/mutator/node/resbody.rb