2013-01-01 23:28:21 +01:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
|
2013-01-04 22:16:03 +01:00
|
|
|
# Mutator for super with parantheses
|
2013-01-01 23:28:21 +01:00
|
|
|
class Super < self
|
2013-06-04 10:25:13 +02:00
|
|
|
|
|
|
|
handle(:super)
|
2013-01-01 23:28:21 +01:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
2013-06-04 10:25:13 +02:00
|
|
|
emit_node(:zsuper)
|
2013-01-02 01:04:16 +01:00
|
|
|
emit_without_block
|
|
|
|
emit_attribute_mutations(:block) if node.block
|
2013-04-17 20:31:21 -07:00
|
|
|
emit_attribute_mutations(:arguments)
|
2013-01-02 01:04:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
# Emit without block mutation
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def emit_without_block
|
|
|
|
dup = dup_node
|
|
|
|
dup.block = nil
|
|
|
|
emit(dup)
|
2013-01-01 23:28:21 +01:00
|
|
|
end
|
2013-06-04 10:25:13 +02:00
|
|
|
|
|
|
|
end # Super
|
|
|
|
end # Node
|
|
|
|
end # Mutator
|
|
|
|
end # Mutant
|