Sha256: 3b46d8893935a3dee34282cc116dba6a93d571852a82dfe7d68f352238c77805

Contents?: true

Size: 585 Bytes

Versions: 67

Compression:

Stored size: 585 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 to_s(format = :full)
      "#{text}#{'^' if negated?}#{expressions.join}]#{quantifier_affix(format)}"
    end
  end
end # module Regexp::Expression

Version data entries

67 entries across 54 versions & 12 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/regexp_parser-2.2.1/lib/regexp_parser/expression/classes/character_set.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/regexp_parser-2.2.1/lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.3.1 lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.3.0 lib/regexp_parser/expression/classes/character_set.rb
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.2.1/lib/regexp_parser/expression/classes/character_set.rb
plaid-14.13.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/regexp_parser-2.2.1/lib/regexp_parser/expression/classes/character_set.rb
regexp_parser-2.2.1 lib/regexp_parser/expression/classes/character_set.rb
plaid-14.12.1 vendor/bundle/ruby/3.0.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
plaid-14.12.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
plaid-14.11.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/regexp_parser-2.2.0/lib/regexp_parser/expression/classes/character_set.rb
plaid-14.10.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
regexp_parser-2.2.0 lib/regexp_parser/expression/classes/character_set.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/regexp_parser-2.1.1/lib/regexp_parser/expression/classes/set.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/lib/regexp_parser/expression/classes/set.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.1.1/lib/regexp_parser/expression/classes/set.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.1.1/lib/regexp_parser/expression/classes/set.rb
plaid-14.7.0 vendor/bundle/ruby/2.6.0/gems/regexp_parser-1.8.0/lib/regexp_parser/expression/classes/set.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/regexp_parser-2.1.1/lib/regexp_parser/expression/classes/set.rb