Sha256: 6a6f1690aca8611f4eacefdc01e8bb8407e0f4dc2bc6af98c24645feab8663d9

Contents?: true

Size: 841 Bytes

Versions: 28

Compression:

Stored size: 841 Bytes

Contents

# frozen_string_literal: true

module Mutant
  class Mutator
    class Node
      module Regexp
        # Character type mutator
        class CharacterType < Node
          map = {
            regexp_digit_type:           :regexp_nondigit_type,
            regexp_hex_type:             :regexp_nonhex_type,
            regexp_space_type:           :regexp_nonspace_type,
            regexp_word_boundary_anchor: :regexp_nonword_boundary_anchor,
            regexp_word_type:            :regexp_nonword_type,
            regexp_xgrapheme_type:       :regexp_linebreak_type
          }

          MAP = map.merge(map.invert)

          handle(*MAP.keys)

        private

          def dispatch
            emit(s(MAP.fetch(node.type)))
          end
        end # CharacterType
      end # Regexp
    end # Node
  end # Mutator
end # Mutant

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
mutant-0.11.17 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.16 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.15 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.14 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.13 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.12 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.11 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.10 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.9 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.8 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.7 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.6 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.5 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.4 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.3 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.2 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.1 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.11.0 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.10.35 lib/mutant/mutator/node/regexp/character_type.rb
mutant-0.10.34 lib/mutant/mutator/node/regexp/character_type.rb