Class: Mutant::Mutator::Node::Regexp::CaptureGroup Private

Inherits:
Mutant::Mutator::Node show all
Defined in:
lib/mutant/mutator/node/regexp/capture_group.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Mutator for regexp capture groups, such as ‘/(foo)/`

Constant Summary

Constants inherited from Mutant::Mutator::Node

TAUTOLOGY

Constants included from AST::Nodes

AST::Nodes::N_EMPTY, AST::Nodes::N_EMPTY_SUPER, AST::Nodes::N_FALSE, AST::Nodes::N_INFINITY, AST::Nodes::N_NAN, AST::Nodes::N_NEGATIVE_INFINITY, AST::Nodes::N_NIL, AST::Nodes::N_RAISE, AST::Nodes::N_SELF, AST::Nodes::N_TRUE, AST::Nodes::N_ZSUPER

Constants inherited from Mutant::Mutator

REGISTRY

Instance Attribute Summary

Attributes inherited from Mutant::Mutator

#output

Instance Method Summary collapse

Methods included from AST::NamedChildren

included

Methods inherited from Mutant::Mutator

mutate

Instance Method Details

#dispatchundefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Emit mutations

Replace ‘(captured_group)` with `(?:non_captured_group)`

Returns:

  • (undefined)


16
17
18
19
20
21
# File 'lib/mutant/mutator/node/regexp/capture_group.rb', line 16

def dispatch
  return unless group

  emit(s(:regexp_passive_group, group))
  emit_group_mutations
end