Sha256: 38445a677f6b4e726497b690d5a99bd69429fce9f804ad187a2669b9411d63a7

Contents?: true

Size: 544 Bytes

Versions: 16

Compression:

Stored size: 544 Bytes

Contents

module Regexp::Expression
  class CharacterSet < Regexp::Expression::Subexpression
    attr_accessor :closed, :negative

    alias :negative? :negative
    alias :negated?  :negative
    alias :closed?   :closed

    def initialize(token, options = {})
      self.negative = false
      self.closed   = false
      super
    end

    def negate
      self.negative = true
    end

    def close
      self.closed = true
    end

    def parts
      ["#{text}#{'^' if negated?}", *expressions, ']']
    end
  end
end # module Regexp::Expression

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.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.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.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set.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.rb
zilla-0.2.0 vendor/bundle/ruby/3.2.0/gems/regexp_parser-2.7.0/lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.7.0 lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.6.2 lib/regexp_parser/expression/classes/character_set.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.6.1 lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.6.0 lib/regexp_parser/expression/classes/character_set.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.5.0/lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.5.0 lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.4.0 lib/regexp_parser/expression/classes/character_set.rb