Sha256: d2006266937a097fcbb1d988156a072a0429859b5ecd6e4bca9b076492a379dd

Contents?: true

Size: 826 Bytes

Versions: 6

Compression:

Stored size: 826 Bytes

Contents

# frozen_string_literal: true

module Mutant
  module AST
    module Regexp
      class Transformer
        # Transformer for root nodes
        class Root < self
          register :regexp_root_expression

          ExpressionToAST = Class.new(Recursive::ExpressionToAST)

          # Mapper from `Parser::AST::Node` to `Regexp::Expression`
          class ASTToExpression < Transformer::ASTToExpression

          private

            # Transform node into root expression
            #
            # @return [Regexp::Expression::Root]
            def transform
              ::Regexp::Expression::Root.build.tap do |root|
                root.expressions = subexpressions
              end
            end
          end # ASTToExpression
        end # Root
      end # Transformer
    end # Regexp
  end # AST
end # Mutant

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.8.24 lib/mutant/ast/regexp/transformer/root.rb
mutant-0.8.23 lib/mutant/ast/regexp/transformer/root.rb
mutant-0.8.22 lib/mutant/ast/regexp/transformer/root.rb
mutant-0.8.21 lib/mutant/ast/regexp/transformer/root.rb
mutant-0.8.20 lib/mutant/ast/regexp/transformer/root.rb
mutant-0.8.19 lib/mutant/ast/regexp/transformer/root.rb