Sha256: 55486f448176891a00b94f0a197eef0956cf708964f6cd3fec871c8f5381f6a2

Contents?: true

Size: 1.5 KB

Versions: 9

Compression:

Stored size: 1.5 KB

Contents

module Regexp::Syntax
  module Token

    module CharacterSet
      OpenClose = [:open, :close]

      Basic     = [:negate, :member, :range]
      Extended  = Basic + [:escape, :intersection, :backspace,
                           :member_hex, :range_hex]

      Types     = [:type_digit, :type_nondigit, :type_hex, :type_nonhex,
                   :type_space, :type_nonspace, :type_word, :type_nonword]

      Clustered = [:type_linebreak, :type_xgrapheme]

      module POSIX
        Standard  = [
          :class_alnum, :class_alpha, :class_blank, :class_cntrl,
          :class_digit, :class_graph, :class_lower, :class_print,
          :class_punct, :class_space, :class_upper, :class_xdigit,
        ]

        StandardNegative = [
          :class_nonalnum, :class_nonalpha, :class_nonblank,
          :class_noncntrl, :class_nondigit, :class_nongraph,
          :class_nonlower, :class_nonprint, :class_nonpunct,
          :class_nonspace, :class_nonupper, :class_nonxdigit,
        ]

        Extensions         = [:class_ascii, :class_word]
        ExtensionsNegative = [:class_nonascii, :class_nonword]

        All = Standard + StandardNegative + Extensions + ExtensionsNegative
      end

      All = Basic + Extended + Types + Clustered + POSIX::All
      Type = :set

      module SubSet
        OpenClose = [:open, :close]

        All = CharacterSet::All
        Type = :subset
      end
    end

    Map[CharacterSet::Type] = CharacterSet::All
    Map[CharacterSet::SubSet::Type] = CharacterSet::All

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
regexp_parser-0.5.0 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.13 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.12 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.11 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.10 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.9 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.8 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.7 lib/regexp_parser/syntax/tokens/character_set.rb
regexp_parser-0.4.6 lib/regexp_parser/syntax/tokens/character_set.rb