class Mutest::AST::Regexp::Transformer::Direct

Transformer for nodes which map directly to other domain

A node maps “directly” to another domain if the node never has children or text which needs to be preserved for a mapping

@example direct mapping

input      = /\d/
expression = Regexp::Parser.parse(input).first
node       = Transformer::Direct.to_ast(expression)

# the digit type always has the same text and no children
expression.text      # => "\\d"
expression.terminal? # => true

# therefore the `Parser::AST::Node` is always the same
node # => s(:regexp_digit_type)