File: quantifier.rb

package info (click to toggle)
ruby-regexp-parser 2.11.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,092 kB
  • sloc: ruby: 6,891; makefile: 6; sh: 3
file content (37 lines) | stat: -rw-r--r-- 899 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

module Regexp::Syntax
  module Token
    module Quantifier
      Greedy = %i[
        zero_or_one
        zero_or_more
        one_or_more
      ].freeze

      Reluctant = %i[
        zero_or_one_reluctant
        zero_or_more_reluctant
        one_or_more_reluctant
      ].freeze

      Possessive = %i[
        zero_or_one_possessive
        zero_or_more_possessive
        one_or_more_possessive
      ].freeze

      Interval             = %i[interval].freeze
      IntervalReluctant    = %i[interval_reluctant].freeze
      IntervalPossessive   = %i[interval_possessive].freeze

      IntervalAll = Interval + IntervalReluctant + IntervalPossessive

      V1_8_6 = Greedy + Reluctant + Interval + IntervalReluctant
      All = Greedy + Reluctant + Possessive + IntervalAll
      Type = :quantifier
    end

    Map[Quantifier::Type] = Quantifier::All
  end
end