2012-12-06 15:30:28 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
2013-06-04 17:43:36 -04:00
|
|
|
# Namespace for define mutations
|
2012-12-06 15:30:28 -05:00
|
|
|
class Define < self
|
|
|
|
|
2012-12-10 11:26:56 -05:00
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
2013-06-21 09:06:07 -04:00
|
|
|
emit_arguments_mutations
|
2014-06-16 06:56:27 -04:00
|
|
|
emit_body(N_RAISE)
|
2013-07-04 21:02:45 -04:00
|
|
|
emit_body(nil)
|
2013-07-02 14:42:09 -04:00
|
|
|
emit_body_mutations if body
|
2012-12-10 11:26:56 -05:00
|
|
|
end
|
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
# Mutator for instance method defines
|
2013-06-04 17:43:36 -04:00
|
|
|
class Instance < self
|
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
handle :def
|
2013-06-04 17:43:36 -04:00
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
children :name, :arguments, :body
|
2013-06-04 17:43:36 -04:00
|
|
|
|
|
|
|
end # Instance
|
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
# Mutator for singleton method defines
|
2013-06-04 17:43:36 -04:00
|
|
|
class Singleton < self
|
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
handle :defs
|
2013-06-04 17:43:36 -04:00
|
|
|
|
2013-06-21 09:06:07 -04:00
|
|
|
children :subject, :name, :arguments, :body
|
2013-06-04 17:43:36 -04:00
|
|
|
|
|
|
|
end # Singelton
|
2013-06-21 09:06:07 -04:00
|
|
|
|
2013-06-04 04:25:13 -04:00
|
|
|
end # Define
|
|
|
|
end # Node
|
|
|
|
end # Mutator
|
|
|
|
end # Mutant
|