Sha256: f4cb2f79fb27f72bfb47fa142cf92ebd83407eda31c122263ebdab00053f254f

Contents?: true

Size: 653 Bytes

Versions: 8

Compression:

Stored size: 653 Bytes

Contents

module Regexp::Expression
  # abstract class
  class SequenceOperation < Regexp::Expression::Subexpression
    alias :sequences :expressions
    alias :operands :expressions
    alias :operator :text

    def starts_at
      expressions.first.starts_at
    end
    alias :ts :starts_at

    def <<(exp)
      expressions.last << exp
    end

    def add_sequence
      self.class::OPERAND.add_to(self)
    end

    def quantify(token, text, min = nil, max = nil, mode = :greedy)
      sequences.last.last.quantify(token, text, min, max, mode)
    end

    def to_s(format = :full)
      sequences.map { |e| e.to_s(format) }.join(text)
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
regexp_parser-1.5.0 lib/regexp_parser/expression/sequence_operation.rb
tdiary-5.0.13 vendor/bundle/gems/regexp_parser-1.3.0/lib/regexp_parser/expression/sequence_operation.rb
regexp_parser-1.4.0 lib/regexp_parser/expression/sequence_operation.rb
tdiary-5.0.12.1 vendor/bundle/gems/regexp_parser-1.3.0/lib/regexp_parser/expression/sequence_operation.rb
tdiary-5.0.11 vendor/bundle/gems/regexp_parser-1.3.0/lib/regexp_parser/expression/sequence_operation.rb
regexp_parser-1.3.0 lib/regexp_parser/expression/sequence_operation.rb
regexp_parser-1.2.0 lib/regexp_parser/expression/sequence_operation.rb
regexp_parser-1.1.0 lib/regexp_parser/expression/sequence_operation.rb