2012-12-06 15:30:28 -05:00
|
|
|
module Mutant
|
|
|
|
class Mutator
|
|
|
|
class Node
|
|
|
|
# Mutator that does not do mutations on ast
|
|
|
|
class Noop < self
|
|
|
|
|
|
|
|
# Literal references to self do not need to be mutated?
|
|
|
|
handle(Rubinius::AST::Self)
|
|
|
|
|
|
|
|
# Currently unhandled node classes. Feel free to contribute your mutator!
|
2013-01-15 18:57:12 -05:00
|
|
|
#
|
|
|
|
# FIXME: This list is mixed with some 1.8 only nodes that should be extracted
|
|
|
|
#
|
|
|
|
%w(
|
|
|
|
ZSuper
|
|
|
|
ElementAssignment
|
|
|
|
AttributeAssignment
|
|
|
|
Not
|
|
|
|
And
|
|
|
|
Or
|
|
|
|
Defined
|
|
|
|
Super
|
|
|
|
Next
|
|
|
|
Break
|
|
|
|
Match3
|
|
|
|
ZSuper
|
|
|
|
MultipleAssignment
|
|
|
|
ScopedConstant
|
|
|
|
LocalVariableAccess
|
|
|
|
InstanceVariableAccess
|
|
|
|
GlobalVariableAccess
|
|
|
|
ClassVariableAccess
|
|
|
|
ToplevelConstant
|
|
|
|
Ensure
|
|
|
|
Rescue
|
|
|
|
DynamicString
|
|
|
|
DynamicSymbol
|
|
|
|
DynamicRegex
|
|
|
|
File
|
|
|
|
OpAssignOr19
|
|
|
|
BlockPass19
|
|
|
|
OpAssign1
|
|
|
|
OpAssign2
|
|
|
|
SplatValue
|
|
|
|
ConstantAccess
|
|
|
|
Yield
|
|
|
|
Begin
|
|
|
|
Rescue
|
|
|
|
).each do |name|
|
|
|
|
handle(Rubinius::AST.const_get(name))
|
|
|
|
end
|
2012-12-06 15:30:28 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# Emit mutations
|
|
|
|
#
|
|
|
|
# @return [undefined]
|
|
|
|
#
|
|
|
|
# @api private
|
|
|
|
#
|
|
|
|
def dispatch
|
|
|
|
# noop
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|