Move nil body mutation to parent nodes

This ensures mutant all the time creates semantically valid asts.
This commit is contained in:
Markus Schirp 2013-07-05 03:02:45 +02:00
parent 065a73a2e2
commit 36011568d5
3 changed files with 2 additions and 1 deletions

View file

@ -24,7 +24,6 @@ module Mutant
children.each do |child|
emit(child)
end
emit(nil) unless parent_send?
end
# Test if parent input is a send

View file

@ -22,6 +22,7 @@ module Mutant
if body
emit_body_mutations
end
emit_body(nil)
emit_body(RAISE)
end

View file

@ -15,6 +15,7 @@ module Mutant
def dispatch
emit_arguments_mutations
emit_body(RAISE)
emit_body(nil)
emit_body_mutations if body
end