Class: Mutant::AST::Regexp::Transformer::Quantifier::ASTToExpression Private

Inherits:
ASTToExpression
  • Object
show all
Includes:
NamedChildren
Defined in:
lib/mutant/ast/regexp/transformer/quantifier.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Mapper from ‘Parser::AST::Node` to `Regexp::Expression`

Constant Summary collapse

Quantifier =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Class.new.include(Concord::Public.new(:type, :suffix, :mode))
QUANTIFIER_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
regexp_greedy_zero_or_more:     [:zero_or_more, '*',  :greedy],
regexp_greedy_one_or_more:      [:one_or_more,  '+',  :greedy],
regexp_greedy_zero_or_one:      [:zero_or_one,  '?',  :greedy],
regexp_possessive_zero_or_one:  [:zero_or_one,  '?+', :possessive],
regexp_reluctant_zero_or_more:  [:zero_or_more, '*?', :reluctant],
regexp_reluctant_one_or_more:   [:one_or_more,  '+?', :reluctant],
regexp_possessive_zero_or_more: [:zero_or_more, '*+', :possessive],
regexp_possessive_one_or_more:  [:one_or_more,  '++', :possessive],
regexp_greedy_interval:         [:interval,     '',   :greedy],
regexp_reluctant_interval:      [:interval,     '?',  :reluctant],
regexp_possessive_interval:     [:interval,     '+',  :possessive]
            }.transform_values { |arguments| Quantifier.new(*arguments) }
.to_h
.freeze

Method Summary

Methods included from NamedChildren

included

Methods inherited from ASTToExpression

#call

Methods included from Procto

included