2013-07-28 19:03:06 -04:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2013-01-01 17:28:21 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
|
2013-07-23 03:58:16 -04:00
|
|
|
# Mutator for super with parentheses
|
2013-01-01 17:28:21 -05:00
|
|
|
class Super < self
|
2013-06-04 04:25:13 -04:00
|
|
|
|
|
|
|
handle(:super)
|
2013-01-01 17:28:21 -05:00
|
|
|
|
2013-06-14 13:55:44 -04:00
|
|
|
Z_SUPER = NodeHelpers.s(:zsuper)
|
|
|
|
EMPTY_SUPER = NodeHelpers.s(:super)
|
|
|
|
|
2013-01-01 17:28:21 -05:00
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
2013-06-14 13:55:44 -04:00
|
|
|
emit(Z_SUPER)
|
|
|
|
emit(EMPTY_SUPER)
|
|
|
|
children.each_index do |index|
|
|
|
|
mutate_child(index)
|
|
|
|
delete_child(index)
|
|
|
|
end
|
2013-01-01 17:28:21 -05:00
|
|
|
end
|
2013-06-04 04:25:13 -04:00
|
|
|
|
|
|
|
end # Super
|
|
|
|
end # Node
|
|
|
|
end # Mutator
|
|
|
|
end # Mutant
|