Remove Regexp::Generic
This commit is contained in:
parent
18b6f453f6
commit
1037614d41
2 changed files with 37 additions and 19 deletions
|
@ -5,16 +5,45 @@ module Mutant
|
|||
# Generic mutator
|
||||
class Generic < self
|
||||
|
||||
unsupported_nodes = %i[
|
||||
ensure
|
||||
redo
|
||||
retry
|
||||
arg_expr
|
||||
blockarg
|
||||
kwrestarg
|
||||
undef
|
||||
module
|
||||
empty
|
||||
alias
|
||||
for
|
||||
xstr
|
||||
back_ref
|
||||
restarg
|
||||
sclass
|
||||
match_with_lvasgn
|
||||
while_post
|
||||
until_post
|
||||
preexe
|
||||
postexe
|
||||
iflipflop
|
||||
eflipflop
|
||||
kwsplat
|
||||
shadowarg
|
||||
rational
|
||||
complex
|
||||
__FILE__
|
||||
__LINE__
|
||||
]
|
||||
|
||||
unsupported_regexp_nodes = AST::Types::REGEXP.to_a - %i[
|
||||
regexp_root_expression
|
||||
regexp_bol_anchor
|
||||
]
|
||||
|
||||
# These nodes still need a dedicated mutator,
|
||||
# your contribution is that close!
|
||||
handle(
|
||||
:ensure, :redo, :retry, :arg_expr, :blockarg,
|
||||
:kwrestarg, :undef, :module, :empty,
|
||||
:alias, :for, :xstr, :back_ref, :restarg,
|
||||
:sclass, :match_with_lvasgn, :while_post,
|
||||
:until_post, :preexe, :postexe, :iflipflop, :eflipflop, :kwsplat,
|
||||
:shadowarg, :rational, :complex, :__FILE__, :__LINE__
|
||||
)
|
||||
handle(*(unsupported_nodes + unsupported_regexp_nodes))
|
||||
|
||||
private
|
||||
|
||||
|
|
|
@ -2,17 +2,6 @@ module Mutant
|
|||
class Mutator
|
||||
class Node
|
||||
module Regexp
|
||||
# Generic regexp mutator
|
||||
class Generic < Node
|
||||
handle(*(AST::Types::REGEXP - %i[regexp_root_expression regexp_bol_anchor]))
|
||||
|
||||
# Noop dispatch
|
||||
#
|
||||
# @return [undefined]
|
||||
def dispatch
|
||||
end
|
||||
end # Generic
|
||||
|
||||
# Mutator for root expression regexp wrapper
|
||||
class RootExpression < Node
|
||||
handle(:regexp_root_expression)
|
||||
|
|
Loading…
Add table
Reference in a new issue