Sha256: 4adbe3c36a9e1bb658ea22b125bd1d79c701a58661a97fcab5c38f2cc85ab2e0

Contents?: true

Size: 959 Bytes

Versions: 8

Compression:

Stored size: 959 Bytes

Contents

module Regexp::Expression

  module Backreference
    class Base < Regexp::Expression::Base; end

    class Name < Backreference::Base
      attr_reader :name

      def initialize(token, options = {})
        @name = token.text[3..-2]
        super
      end
    end

    class Number < Backreference::Base
      attr_reader :number

      def initialize(token, options = {})
        @number = token.text[token.token.equal?(:number) ? 1..-1 : 3..-2]
        super
      end
    end

    class NumberRelative      < Backreference::Number; end

    class NameNestLevel       < Backreference::Base; end
    class NumberNestLevel     < Backreference::Base; end

    class NameCall < Backreference::Base
      attr_reader :name

      def initialize(token, options = {})
        @name = token.text[3..-2]
        super
      end
    end

    class NumberCall          < Backreference::Base; end
    class NumberCallRelative  < Backreference::Base; end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
regexp_parser-0.5.0 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.13 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.12 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.11 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.10 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.9 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.8 lib/regexp_parser/expression/classes/backref.rb
regexp_parser-0.4.7 lib/regexp_parser/expression/classes/backref.rb