Move nil body mutation to parent nodes
This ensures mutant all the time creates semantically valid asts.
This commit is contained in:
parent
065a73a2e2
commit
36011568d5
3 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -22,6 +22,7 @@ module Mutant
|
|||
if body
|
||||
emit_body_mutations
|
||||
end
|
||||
emit_body(nil)
|
||||
emit_body(RAISE)
|
||||
end
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ module Mutant
|
|||
def dispatch
|
||||
emit_arguments_mutations
|
||||
emit_body(RAISE)
|
||||
emit_body(nil)
|
||||
emit_body_mutations if body
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue