Move emit_values helper to correct subclass

This commit is contained in:
Markus Schirp 2012-12-29 16:34:39 +01:00
parent 22a5cda3f0
commit 913a3fdbf1
2 changed files with 17 additions and 17 deletions

View file

@ -17,7 +17,7 @@ module Mutant
ToSource.to_source(node) ToSource.to_source(node)
end end
private private
# Return mutated node # Return mutated node
# #
@ -89,20 +89,6 @@ module Mutant
emit(new_self(*arguments)) emit(new_self(*arguments))
end end
# Emit a new node with wrapping class for each entry in values
#
# @param [Array] values
#
# @return [undefined]
#
# @api private
#
def emit_values(values)
values.each do |value|
emit_self(value)
end
end
# Emit body mutations # Emit body mutations
# #
# @param [Symbol] name # @param [Symbol] name
@ -112,9 +98,9 @@ module Mutant
# @api private # @api private
# #
def emit_attribute_mutations(name) def emit_attribute_mutations(name)
body = node.public_send(name) value = node.public_send(name)
Mutator.each(body) do |mutation| Mutator.each(value) do |mutation|
dup = dup_node dup = dup_node
dup.public_send(:"#{name}=", mutation) dup.public_send(:"#{name}=", mutation)
yield dup if block_given? yield dup if block_given?

View file

@ -19,6 +19,20 @@ module Mutant
new(Rubinius::AST::FloatLiteral, value) new(Rubinius::AST::FloatLiteral, value)
end end
# Emit a new node with wrapping class for each entry in values
#
# @param [Array] values
#
# @return [undefined]
#
# @api private
#
def emit_values(values)
values.each do |value|
emit_self(value)
end
end
# Return AST representing NaN # Return AST representing NaN
# #
# @return [Rubinius::Node::AST] # @return [Rubinius::Node::AST]