Sha256: 912751b5e2275779a487777ee22e0d6e468c1e63b43d9f644ad1de1b7964a3e8

Contents?: true

Size: 873 Bytes

Versions: 8

Compression:

Stored size: 873 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Mutator
    class Node
      module Regexp
        # Mutator for root expression regexp wrapper
        class RootExpression < Node
          handle(:regexp_root_expression)

          # Emit mutations for children of root node
          #
          # @return [undefined]
          def dispatch
            children.each_index(&method(:mutate_child))
          end
        end # RootExpression

        # Mutator for beginning of line anchor `^`
        class BeginningOfLineAnchor < Node
          handle(:regexp_bol_anchor)

          # Emit mutations
          #
          # Replace `^` with `\A`
          #
          # @return [undefined]
          def dispatch
            emit(s(:regexp_bos_anchor))
          end
        end # BeginningOfLineAnchor
      end # Regexp
    end # Node
  end # Mutator
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.24 lib/mutant/mutator/node/regexp.rb
mutant-0.8.23 lib/mutant/mutator/node/regexp.rb
mutant-0.8.22 lib/mutant/mutator/node/regexp.rb
mutant-0.8.21 lib/mutant/mutator/node/regexp.rb
mutant-0.8.20 lib/mutant/mutator/node/regexp.rb
mutant-0.8.19 lib/mutant/mutator/node/regexp.rb
mutant-0.8.18 lib/mutant/mutator/node/regexp.rb
mutant-0.8.17 lib/mutant/mutator/node/regexp.rb