Sha256: 20cd3a866223cc7d67d8cc95e7f55280bafcad6c66128f87901b6fa1698febab

Contents?: true

Size: 517 Bytes

Versions: 16

Compression:

Stored size: 517 Bytes

Contents

module Regexp::Expression
  class CharacterSet < Regexp::Expression::Subexpression
    class Range < Regexp::Expression::Subexpression
      def starts_at
        expressions.first.starts_at
      end
      alias :ts :starts_at

      def <<(exp)
        complete? and raise Regexp::Parser::Error,
          "Can't add more than 2 expressions to a Range"
        super
      end

      def complete?
        count == 2
      end

      def parts
        intersperse(expressions, text.dup)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 6 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.6.1/lib/regexp_parser/expression/classes/character_set/range.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.6.1/lib/regexp_parser/expression/classes/character_set/range.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.6.1/lib/regexp_parser/expression/classes/character_set/range.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set/range.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set/range.rb
call_your_name-0.1.0 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.7.0/lib/regexp_parser/expression/classes/character_set/range.rb
zilla-0.2.0 vendor/bundle/ruby/3.2.0/gems/regexp_parser-2.7.0/lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.7.0 lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.6.2 lib/regexp_parser/expression/classes/character_set/range.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.6.1 lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.6.0 lib/regexp_parser/expression/classes/character_set/range.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set/range.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.5.0 lib/regexp_parser/expression/classes/character_set/range.rb
regexp_parser-2.4.0 lib/regexp_parser/expression/classes/character_set/range.rb