Add N_TRUE and N_FALSE node helpers
This commit is contained in:
parent
0919e116d8
commit
ecfd388ad3
2 changed files with 4 additions and 2 deletions
|
@ -31,8 +31,8 @@ module Mutant
|
||||||
def mutate_condition
|
def mutate_condition
|
||||||
emit_condition_mutations
|
emit_condition_mutations
|
||||||
emit_self(s(:send, condition, :!), if_branch, else_branch)
|
emit_self(s(:send, condition, :!), if_branch, else_branch)
|
||||||
emit_self(s(:true), if_branch, else_branch)
|
emit_self(N_TRUE, if_branch, else_branch)
|
||||||
emit_self(s(:false), if_branch, else_branch)
|
emit_self(N_FALSE, if_branch, else_branch)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Emit if branch mutations
|
# Emit if branch mutations
|
||||||
|
|
|
@ -24,6 +24,8 @@ module Mutant
|
||||||
RAISE = s(:send, nil, :raise)
|
RAISE = s(:send, nil, :raise)
|
||||||
|
|
||||||
N_NIL = s(:nil)
|
N_NIL = s(:nil)
|
||||||
|
N_TRUE = s(:true)
|
||||||
|
N_FALSE = s(:false)
|
||||||
N_EMPTY = s(:empty)
|
N_EMPTY = s(:empty)
|
||||||
|
|
||||||
end # NodeHelpers
|
end # NodeHelpers
|
||||||
|
|
Loading…
Reference in a new issue