36011568d5
This ensures mutant all the time creates semantically valid asts.
32 lines
570 B
Ruby
32 lines
570 B
Ruby
module Mutant
|
|
class Mutator
|
|
class Node
|
|
# Emitter for mutations on 19 blocks
|
|
class Block < self
|
|
|
|
handle(:block)
|
|
|
|
children :send, :arguments, :body
|
|
|
|
private
|
|
|
|
# Emit mutants
|
|
#
|
|
# @return [undefined]
|
|
#
|
|
# @api private
|
|
#
|
|
def dispatch
|
|
emit(send)
|
|
emit_arguments_mutations
|
|
if body
|
|
emit_body_mutations
|
|
end
|
|
emit_body(nil)
|
|
emit_body(RAISE)
|
|
end
|
|
|
|
end # Block
|
|
end # Node
|
|
end # Mutator
|
|
end # Mutant
|