Add N_TRUE and N_FALSE node helpers

This commit is contained in:
Dan Kubb 2013-07-23 22:58:20 -07:00
parent 0919e116d8
commit ecfd388ad3
2 changed files with 4 additions and 2 deletions

View file

@ -31,8 +31,8 @@ module Mutant
def mutate_condition
emit_condition_mutations
emit_self(s(:send, condition, :!), if_branch, else_branch)
emit_self(s(:true), if_branch, else_branch)
emit_self(s(:false), if_branch, else_branch)
emit_self(N_TRUE, if_branch, else_branch)
emit_self(N_FALSE, if_branch, else_branch)
end
# Emit if branch mutations

View file

@ -24,6 +24,8 @@ module Mutant
RAISE = s(:send, nil, :raise)
N_NIL = s(:nil)
N_TRUE = s(:true)
N_FALSE = s(:false)
N_EMPTY = s(:empty)
end # NodeHelpers