free_mutant/lib/mutant/mutator/node/rescue.rb
Markus Schirp e93960ca35 Fix invalid AST emit
* Mutant prevents double emits via guarding on source representation of
  partial AST nodes. Not all AST nodes are valid as roots, so this
  change creates a valid root around an leave.

* Over the time multiple of these situartions must be solved, we'll end
  up in a more deduplicated solution.

* Closes: #165
2014-03-23 00:42:38 +00:00

26 lines
464 B
Ruby

# encoding: utf-8
module Mutant
class Mutator
class Node
# Mutator for rescue nodes
class Rescue < Generic
handle :rescue
# Return identity
#
# @param [Parser::AST::Node] node
#
# @return [String]
#
# @api private
#
def self.identity(node)
super(NodeHelpers.s(:kwbegin, node))
end
end # Rescue
end # Node
end # Mutator
end # Mutant