Use child nameing in literal regexp mutator

This commit is contained in:
Markus Schirp 2013-06-21 15:32:36 +02:00
parent 50263607b8
commit 1be5f790a8

View file

@ -12,7 +12,7 @@ module Mutant
# No input can ever be matched with this
NULL_REGEXP_SOURCE = 'a\A'.freeze
SOURCE_INDEX, OPTIONS_INDEX = 0, 1
children :source, :options
private
@ -28,26 +28,6 @@ module Mutant
emit_self(s(:str, NULL_REGEXP_SOURCE), options)
end
# Return options
#
# @return [Parser::AST::Node]
#
# @api private
#
def options
children[OPTIONS_INDEX]
end
# Return source
#
# @return [Parser::AST::Node]
#
# @api private
#
def source
children[SOURCE_INDEX]
end
end # Regex
end # Literal
end # Node