regexp_parser 2.2.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -1
  3. data/Gemfile +2 -1
  4. data/LICENSE +1 -1
  5. data/README.md +16 -6
  6. data/Rakefile +1 -59
  7. data/lib/regexp_parser/expression/classes/escape_sequence.rb +12 -7
  8. data/lib/regexp_parser/expression/methods/strfregexp.rb +1 -1
  9. data/lib/regexp_parser/lexer.rb +1 -1
  10. data/lib/regexp_parser/scanner/properties/long.csv +622 -0
  11. data/lib/regexp_parser/scanner/properties/short.csv +246 -0
  12. data/lib/regexp_parser/scanner/scanner.rl +6 -4
  13. data/lib/regexp_parser/scanner.rb +126 -124
  14. data/lib/regexp_parser/syntax/any.rb +2 -5
  15. data/lib/regexp_parser/syntax/base.rb +91 -66
  16. data/lib/regexp_parser/syntax/token/backreference.rb +7 -2
  17. data/lib/regexp_parser/syntax/token/quantifier.rb +4 -4
  18. data/lib/regexp_parser/syntax/token/unicode_property.rb +26 -5
  19. data/lib/regexp_parser/syntax/version_lookup.rb +20 -29
  20. data/lib/regexp_parser/syntax/versions/1.8.6.rb +13 -20
  21. data/lib/regexp_parser/syntax/versions/1.9.1.rb +10 -17
  22. data/lib/regexp_parser/syntax/versions/1.9.3.rb +3 -10
  23. data/lib/regexp_parser/syntax/versions/2.0.0.rb +8 -15
  24. data/lib/regexp_parser/syntax/versions/2.2.0.rb +3 -9
  25. data/lib/regexp_parser/syntax/versions/2.3.0.rb +3 -9
  26. data/lib/regexp_parser/syntax/versions/2.4.0.rb +3 -9
  27. data/lib/regexp_parser/syntax/versions/2.4.1.rb +2 -8
  28. data/lib/regexp_parser/syntax/versions/2.5.0.rb +3 -9
  29. data/lib/regexp_parser/syntax/versions/2.6.0.rb +3 -9
  30. data/lib/regexp_parser/syntax/versions/2.6.2.rb +3 -9
  31. data/lib/regexp_parser/syntax/versions/2.6.3.rb +3 -9
  32. data/lib/regexp_parser/syntax/versions/3.1.0.rb +3 -9
  33. data/lib/regexp_parser/syntax/versions/3.2.0.rb +4 -0
  34. data/lib/regexp_parser/syntax/versions.rb +1 -1
  35. data/lib/regexp_parser/version.rb +1 -1
  36. data/regexp_parser.gemspec +20 -22
  37. metadata +12 -143
  38. data/lib/regexp_parser/scanner/properties/long.yml +0 -607
  39. data/lib/regexp_parser/scanner/properties/short.yml +0 -245
  40. data/spec/expression/base_spec.rb +0 -104
  41. data/spec/expression/clone_spec.rb +0 -152
  42. data/spec/expression/conditional_spec.rb +0 -89
  43. data/spec/expression/free_space_spec.rb +0 -27
  44. data/spec/expression/methods/match_length_spec.rb +0 -161
  45. data/spec/expression/methods/match_spec.rb +0 -25
  46. data/spec/expression/methods/strfregexp_spec.rb +0 -224
  47. data/spec/expression/methods/tests_spec.rb +0 -99
  48. data/spec/expression/methods/traverse_spec.rb +0 -161
  49. data/spec/expression/options_spec.rb +0 -128
  50. data/spec/expression/subexpression_spec.rb +0 -50
  51. data/spec/expression/to_h_spec.rb +0 -26
  52. data/spec/expression/to_s_spec.rb +0 -108
  53. data/spec/lexer/all_spec.rb +0 -22
  54. data/spec/lexer/conditionals_spec.rb +0 -53
  55. data/spec/lexer/delimiters_spec.rb +0 -68
  56. data/spec/lexer/escapes_spec.rb +0 -14
  57. data/spec/lexer/keep_spec.rb +0 -10
  58. data/spec/lexer/literals_spec.rb +0 -64
  59. data/spec/lexer/nesting_spec.rb +0 -99
  60. data/spec/lexer/refcalls_spec.rb +0 -60
  61. data/spec/parser/all_spec.rb +0 -43
  62. data/spec/parser/alternation_spec.rb +0 -88
  63. data/spec/parser/anchors_spec.rb +0 -17
  64. data/spec/parser/conditionals_spec.rb +0 -179
  65. data/spec/parser/errors_spec.rb +0 -30
  66. data/spec/parser/escapes_spec.rb +0 -133
  67. data/spec/parser/free_space_spec.rb +0 -130
  68. data/spec/parser/groups_spec.rb +0 -108
  69. data/spec/parser/keep_spec.rb +0 -6
  70. data/spec/parser/options_spec.rb +0 -28
  71. data/spec/parser/posix_classes_spec.rb +0 -8
  72. data/spec/parser/properties_spec.rb +0 -117
  73. data/spec/parser/quantifiers_spec.rb +0 -68
  74. data/spec/parser/refcalls_spec.rb +0 -117
  75. data/spec/parser/set/intersections_spec.rb +0 -127
  76. data/spec/parser/set/ranges_spec.rb +0 -121
  77. data/spec/parser/sets_spec.rb +0 -178
  78. data/spec/parser/types_spec.rb +0 -18
  79. data/spec/scanner/all_spec.rb +0 -18
  80. data/spec/scanner/anchors_spec.rb +0 -21
  81. data/spec/scanner/conditionals_spec.rb +0 -128
  82. data/spec/scanner/delimiters_spec.rb +0 -52
  83. data/spec/scanner/errors_spec.rb +0 -67
  84. data/spec/scanner/escapes_spec.rb +0 -73
  85. data/spec/scanner/free_space_spec.rb +0 -165
  86. data/spec/scanner/groups_spec.rb +0 -61
  87. data/spec/scanner/keep_spec.rb +0 -10
  88. data/spec/scanner/literals_spec.rb +0 -39
  89. data/spec/scanner/meta_spec.rb +0 -18
  90. data/spec/scanner/options_spec.rb +0 -36
  91. data/spec/scanner/properties_spec.rb +0 -64
  92. data/spec/scanner/quantifiers_spec.rb +0 -25
  93. data/spec/scanner/refcalls_spec.rb +0 -55
  94. data/spec/scanner/sets_spec.rb +0 -151
  95. data/spec/scanner/types_spec.rb +0 -14
  96. data/spec/spec_helper.rb +0 -28
  97. data/spec/support/capturing_stderr.rb +0 -9
  98. data/spec/support/shared_examples.rb +0 -77
  99. data/spec/syntax/syntax_spec.rb +0 -48
  100. data/spec/syntax/syntax_token_map_spec.rb +0 -23
  101. data/spec/syntax/versions/1.8.6_spec.rb +0 -17
  102. data/spec/syntax/versions/1.9.1_spec.rb +0 -10
  103. data/spec/syntax/versions/1.9.3_spec.rb +0 -9
  104. data/spec/syntax/versions/2.0.0_spec.rb +0 -13
  105. data/spec/syntax/versions/2.2.0_spec.rb +0 -9
  106. data/spec/syntax/versions/aliases_spec.rb +0 -38
  107. data/spec/token/token_spec.rb +0 -85
@@ -3,11 +3,8 @@ module Regexp::Syntax
3
3
  # is useful during development, testing, and should be useful for some types
4
4
  # of transformations as well.
5
5
  class Any < Base
6
- def initialize # rubocop:disable Lint/MissingSuper
7
- @implements = { :* => %i[*] }
8
- end
6
+ implements :*, [:*]
9
7
 
10
- def implements?(_type, _token) true end
11
- def implements!(_type, _token) true end
8
+ def self.implements?(_type, _token) true end
12
9
  end
13
10
  end
@@ -1,9 +1,7 @@
1
- require 'set'
2
-
3
1
  module Regexp::Syntax
4
2
  class NotImplementedError < Regexp::Syntax::SyntaxError
5
3
  def initialize(syntax, type, token)
6
- super "#{syntax.class.name} does not implement: [#{type}:#{token}]"
4
+ super "#{syntax} does not implement: [#{type}:#{token}]"
7
5
  end
8
6
  end
9
7
 
@@ -11,85 +9,112 @@ module Regexp::Syntax
11
9
  class Base
12
10
  include Regexp::Syntax::Token
13
11
 
14
- def initialize
15
- @implements = {}
12
+ class << self
13
+ attr_accessor :features
16
14
 
17
- implements Token::Literal::Type, Token::Literal::All
18
- implements Token::FreeSpace::Type, Token::FreeSpace::All
19
- end
15
+ # automatically inherit features through the syntax class hierarchy
16
+ def inherited(subclass)
17
+ super
18
+ subclass.features = features.to_h.map { |k, v| [k, v.dup] }.to_h
19
+ end
20
20
 
21
- def features
22
- @implements
23
- end
21
+ def implements(type, tokens)
22
+ (features[type] ||= []).concat(tokens)
23
+ added_features[type] = tokens
24
+ end
24
25
 
25
- def implementations(type)
26
- @implements[type] ||= Set.new
27
- end
26
+ def excludes(type, tokens)
27
+ tokens.each { |tok| features[type].delete(tok) }
28
+ removed_features[type] = tokens
29
+ end
28
30
 
29
- def implements(type, tokens)
30
- implementations(type).merge(Array(tokens))
31
- end
31
+ def implements?(type, token)
32
+ implementations(type).include?(token)
33
+ end
34
+ alias :check? :implements?
32
35
 
33
- def excludes(type, tokens)
34
- implementations(type).subtract(Array(tokens))
35
- end
36
+ def implementations(type)
37
+ features[type] || []
38
+ end
36
39
 
37
- def implements?(type, token)
38
- implementations(type).include?(token)
39
- end
40
- alias :check? :implements?
40
+ def implements!(type, token)
41
+ raise NotImplementedError.new(self, type, token) unless
42
+ implements?(type, token)
43
+ end
44
+ alias :check! :implements!
41
45
 
42
- def implements!(type, token)
43
- raise NotImplementedError.new(self, type, token) unless
44
- implements?(type, token)
45
- end
46
- alias :check! :implements!
47
-
48
- def normalize(type, token)
49
- case type
50
- when :group
51
- normalize_group(type, token)
52
- when :backref
53
- normalize_backref(type, token)
54
- else
55
- [type, token]
46
+ def added_features
47
+ @added_features ||= {}
56
48
  end
57
- end
58
49
 
59
- def normalize_group(type, token)
60
- case token
61
- when :named_ab, :named_sq
62
- %i[group named]
63
- else
64
- [type, token]
50
+ def removed_features
51
+ @removed_features ||= {}
65
52
  end
53
+
54
+ def normalize(type, token)
55
+ case type
56
+ when :group
57
+ normalize_group(type, token)
58
+ when :backref
59
+ normalize_backref(type, token)
60
+ else
61
+ [type, token]
62
+ end
63
+ end
64
+
65
+ def normalize_group(type, token)
66
+ case token
67
+ when :named_ab, :named_sq
68
+ %i[group named]
69
+ else
70
+ [type, token]
71
+ end
72
+ end
73
+
74
+ def normalize_backref(type, token)
75
+ case token
76
+ when :name_ref_ab, :name_ref_sq
77
+ %i[backref name_ref]
78
+ when :name_call_ab, :name_call_sq
79
+ %i[backref name_call]
80
+ when :name_recursion_ref_ab, :name_recursion_ref_sq
81
+ %i[backref name_recursion_ref]
82
+ when :number_ref_ab, :number_ref_sq
83
+ %i[backref number_ref]
84
+ when :number_call_ab, :number_call_sq
85
+ %i[backref number_call]
86
+ when :number_rel_ref_ab, :number_rel_ref_sq
87
+ %i[backref number_rel_ref]
88
+ when :number_rel_call_ab, :number_rel_call_sq
89
+ %i[backref number_rel_call]
90
+ when :number_recursion_ref_ab, :number_recursion_ref_sq
91
+ %i[backref number_recursion_ref]
92
+ else
93
+ [type, token]
94
+ end
95
+ end
96
+ end
97
+
98
+ # TODO: drop this backwards compatibility code in v3.0.0, do `private :new`
99
+ def initialize
100
+ warn 'Using instances of Regexp::Parser::Syntax is deprecated ' \
101
+ "and will no longer be supported in v3.0.0."
66
102
  end
67
103
 
68
- def normalize_backref(type, token)
69
- case token
70
- when :name_ref_ab, :name_ref_sq
71
- %i[backref name_ref]
72
- when :name_call_ab, :name_call_sq
73
- %i[backref name_call]
74
- when :name_recursion_ref_ab, :name_recursion_ref_sq
75
- %i[backref name_recursion_ref]
76
- when :number_ref_ab, :number_ref_sq
77
- %i[backref number_ref]
78
- when :number_call_ab, :number_call_sq
79
- %i[backref number_call]
80
- when :number_rel_ref_ab, :number_rel_ref_sq
81
- %i[backref number_rel_ref]
82
- when :number_rel_call_ab, :number_rel_call_sq
83
- %i[backref number_rel_call]
84
- when :number_recursion_ref_ab, :number_recursion_ref_sq
85
- %i[backref number_recursion_ref]
104
+ def method_missing(name, *args)
105
+ if self.class.respond_to?(name)
106
+ warn 'Using instances of Regexp::Parser::Syntax is deprecated ' \
107
+ "and will no longer be supported in v3.0.0. Please call "\
108
+ "methods on the class directly, e.g.: #{self.class}.#{name}"
109
+ self.class.send(name, *args)
86
110
  else
87
- [type, token]
111
+ super
88
112
  end
89
113
  end
90
114
 
91
- def self.inspect
92
- "#{super} (feature set of #{ancestors[1].to_s.split('::').last})"
115
+ def respond_to_missing?(name, include_private = false)
116
+ self.class.respond_to?(name) || super
93
117
  end
118
+ # end of backwards compatibility code
94
119
  end
95
120
  end
@@ -2,12 +2,17 @@ module Regexp::Syntax
2
2
  module Token
3
3
  module Backreference
4
4
  Plain = %i[number]
5
- Number = Plain + %i[number_ref number_rel_ref]
5
+ NumberRef = %i[number_ref number_rel_ref]
6
+ Number = Plain + NumberRef
6
7
  Name = %i[name_ref]
7
8
 
8
9
  RecursionLevel = %i[name_recursion_ref number_recursion_ref]
9
10
 
10
- All = Name + Number + RecursionLevel
11
+ V1_8_6 = Plain
12
+
13
+ V1_9_1 = Name + NumberRef + RecursionLevel
14
+
15
+ All = V1_8_6 + V1_9_1
11
16
  Type = :backref
12
17
  end
13
18
 
@@ -1,7 +1,7 @@
1
1
  module Regexp::Syntax
2
2
  module Token
3
3
  module Quantifier
4
- Greedy = %i[
4
+ Greedy = %i[
5
5
  zero_or_one
6
6
  zero_or_more
7
7
  one_or_more
@@ -13,7 +13,7 @@ module Regexp::Syntax
13
13
  one_or_more_reluctant
14
14
  ]
15
15
 
16
- Possessive = %i[
16
+ Possessive = %i[
17
17
  zero_or_one_possessive
18
18
  zero_or_more_possessive
19
19
  one_or_more_possessive
@@ -23,9 +23,9 @@ module Regexp::Syntax
23
23
  IntervalReluctant = %i[interval_reluctant]
24
24
  IntervalPossessive = %i[interval_possessive]
25
25
 
26
- IntervalAll = Interval + IntervalReluctant +
27
- IntervalPossessive
26
+ IntervalAll = Interval + IntervalReluctant + IntervalPossessive
28
27
 
28
+ V1_8_6 = Greedy + Reluctant + Interval + IntervalReluctant
29
29
  All = Greedy + Reluctant + Possessive + IntervalAll
30
30
  Type = :quantifier
31
31
  end
@@ -59,6 +59,8 @@ module Regexp::Syntax
59
59
 
60
60
  Age_V3_1_0 = %i[age=13.0]
61
61
 
62
+ Age_V3_2_0 = %i[age=14.0]
63
+
62
64
  Age = all[:Age_V]
63
65
 
64
66
  Derived_V1_9_0 = %i[
@@ -304,14 +306,9 @@ module Regexp::Syntax
304
306
  ]
305
307
 
306
308
  Script_V2_6_2 = %i[
307
- egyptian_hieroglyph_format_controls
308
309
  elymaic
309
310
  nandinagari
310
311
  nyiakeng_puachue_hmong
311
- ottoman_siyaq_numbers
312
- small_kana_extension
313
- symbols_and_pictographs_extended_a
314
- tamil_supplement
315
312
  wancho
316
313
  ]
317
314
 
@@ -322,6 +319,14 @@ module Regexp::Syntax
322
319
  yezidi
323
320
  ]
324
321
 
322
+ Script_V3_2_0 = %i[
323
+ cypro_minoan
324
+ old_uyghur
325
+ tangsa
326
+ toto
327
+ vithkuqi
328
+ ]
329
+
325
330
  Script = all[:Script_V]
326
331
 
327
332
  UnicodeBlock_V1_9_0 = %i[
@@ -660,6 +665,21 @@ module Regexp::Syntax
660
665
  in_yezidi
661
666
  ]
662
667
 
668
+ UnicodeBlock_V3_2_0 = %i[
669
+ in_arabic_extended_b
670
+ in_cypro_minoan
671
+ in_ethiopic_extended_b
672
+ in_kana_extended_b
673
+ in_latin_extended_f
674
+ in_latin_extended_g
675
+ in_old_uyghur
676
+ in_tangsa
677
+ in_toto
678
+ in_unified_canadian_aboriginal_syllabics_extended_a
679
+ in_vithkuqi
680
+ in_znamenny_musical_notation
681
+ ]
682
+
663
683
  UnicodeBlock = all[:UnicodeBlock_V]
664
684
 
665
685
  Emoji_V2_5_0 = %i[
@@ -683,6 +703,7 @@ module Regexp::Syntax
683
703
  V2_6_2 = all[:V2_6_2]
684
704
  V2_6_3 = all[:V2_6_3]
685
705
  V3_1_0 = all[:V3_1_0]
706
+ V3_2_0 = all[:V3_2_0]
686
707
 
687
708
  All = all[/^V\d+_\d+_\d+$/]
688
709
 
@@ -17,29 +17,31 @@ module Regexp::Syntax
17
17
 
18
18
  module_function
19
19
 
20
- # Loads and instantiates an instance of the syntax specification class for
21
- # the given syntax version name. The special names 'any' and '*' return an
22
- # instance of Syntax::Any.
20
+ # Returns the syntax specification class for the given syntax
21
+ # version name. The special names 'any' and '*' return Syntax::Any.
22
+ def for(name)
23
+ (@alias_map ||= {})[name] ||= version_class(name)
24
+ end
25
+
23
26
  def new(name)
24
- return Regexp::Syntax::Any.new if ['*', 'any'].include?(name.to_s)
25
- version_class(name).new
27
+ warn 'Regexp::Syntax.new is deprecated in favor of Regexp::Syntax.for. '\
28
+ 'It does not return distinct instances and will be removed in v3.0.0.'
29
+ self.for(name)
26
30
  end
27
31
 
28
32
  def supported?(name)
29
- name =~ VERSION_REGEXP &&
30
- comparable_version(name) >= comparable_version('1.8.6')
33
+ name =~ VERSION_REGEXP && comparable(name) >= comparable('1.8.6')
31
34
  end
32
35
 
33
36
  def version_class(version)
37
+ return Regexp::Syntax::Any if ['*', 'any'].include?(version.to_s)
38
+
34
39
  version =~ VERSION_REGEXP || raise(InvalidVersionNameError, version)
35
- version_const_name = version_const_name(version)
40
+ warn_if_future_version(version)
41
+ version_const_name = "V#{version.to_s.scan(/\d+/).join('_')}"
36
42
  const_get(version_const_name) || raise(UnknownSyntaxNameError, version)
37
43
  end
38
44
 
39
- def version_const_name(version_string)
40
- "V#{version_string.to_s.scan(/\d+/).join('_')}"
41
- end
42
-
43
45
  def const_missing(const_name)
44
46
  if const_name =~ VERSION_CONST_REGEXP
45
47
  return fallback_version_class(const_name)
@@ -48,35 +50,24 @@ module Regexp::Syntax
48
50
  end
49
51
 
50
52
  def fallback_version_class(version)
51
- sorted_versions = (specified_versions + [version])
52
- .sort_by { |name| comparable_version(name) }
53
- return if (version_index = sorted_versions.index(version)) < 1
54
-
55
- next_lower_version = sorted_versions[version_index - 1]
56
- inherit_from_version(next_lower_version, version)
57
- end
58
-
59
- def inherit_from_version(parent_version, new_version)
60
- new_const = version_const_name(new_version)
61
- parent = const_get(version_const_name(parent_version))
62
- const_defined?(new_const) || const_set(new_const, Class.new(parent))
63
- warn_if_future_version(new_const)
64
- const_get(new_const)
53
+ sorted = (specified_versions + [version]).sort_by { |ver| comparable(ver) }
54
+ index = sorted.index(version)
55
+ index > 0 && const_get(sorted[index - 1])
65
56
  end
66
57
 
67
58
  def specified_versions
68
59
  constants.select { |const_name| const_name =~ VERSION_CONST_REGEXP }
69
60
  end
70
61
 
71
- def comparable_version(name)
62
+ def comparable(name)
72
63
  # add .99 to treat versions without a patch value as latest patch version
73
64
  Gem::Version.new((name.to_s.scan(/\d+/) << 99).join('.'))
74
65
  end
75
66
 
76
67
  def warn_if_future_version(const_name)
77
- return if comparable_version(const_name) < comparable_version('4.0.0')
68
+ return if comparable(const_name) < comparable('4.0.0')
78
69
 
79
70
  warn('This library has only been tested up to Ruby 3.x, '\
80
- "but you are running with #{const_get(const_name).inspect}")
71
+ "but you are running with #{const_name}")
81
72
  end
82
73
  end
@@ -1,21 +1,14 @@
1
- module Regexp::Syntax
2
- class V1_8_6 < Regexp::Syntax::Base
3
- def initialize
4
- super
5
-
6
- implements :anchor, Anchor::All
7
- implements :assertion, Assertion::Lookahead
8
- implements :backref, Backreference::Plain
9
- implements :posixclass, PosixClass::Standard
10
- implements :group, Group::All
11
- implements :meta, Meta::Extended
12
- implements :set, CharacterSet::All
13
- implements :type, CharacterType::Extended
14
- implements :escape,
15
- Escape::Basic + Escape::ASCII + Escape::Meta + Escape::Control
16
- implements :quantifier,
17
- Quantifier::Greedy + Quantifier::Reluctant +
18
- Quantifier::Interval + Quantifier::IntervalReluctant
19
- end
20
- end
1
+ class Regexp::Syntax::V1_8_6 < Regexp::Syntax::Base
2
+ implements :anchor, Anchor::All
3
+ implements :assertion, Assertion::Lookahead
4
+ implements :backref, Backreference::V1_8_6
5
+ implements :escape, Escape::Basic + Escape::ASCII + Escape::Meta + Escape::Control
6
+ implements :free_space, FreeSpace::All
7
+ implements :group, Group::V1_8_6
8
+ implements :literal, Literal::All
9
+ implements :meta, Meta::Extended
10
+ implements :posixclass, PosixClass::Standard
11
+ implements :quantifier, Quantifier::V1_8_6
12
+ implements :set, CharacterSet::All
13
+ implements :type, CharacterType::Extended
21
14
  end
@@ -1,18 +1,11 @@
1
- module Regexp::Syntax
2
- class V1_9_1 < Regexp::Syntax::V1_8_6
3
- def initialize
4
- super
5
-
6
- implements :assertion, Assertion::Lookbehind
7
- implements :backref, Backreference::All + SubexpressionCall::All
8
- implements :posixclass, PosixClass::Extensions
9
- implements :nonposixclass, PosixClass::All
10
- implements :escape, Escape::Unicode + Escape::Hex + Escape::Octal
11
- implements :type, CharacterType::Hex
12
- implements :property, UnicodeProperty::V1_9_0
13
- implements :nonproperty, UnicodeProperty::V1_9_0
14
- implements :quantifier,
15
- Quantifier::Possessive + Quantifier::IntervalPossessive
16
- end
17
- end
1
+ class Regexp::Syntax::V1_9_1 < Regexp::Syntax::V1_8_6
2
+ implements :assertion, Assertion::Lookbehind
3
+ implements :backref, Backreference::V1_9_1 + SubexpressionCall::All
4
+ implements :escape, Escape::Unicode + Escape::Hex + Escape::Octal
5
+ implements :posixclass, PosixClass::Extensions
6
+ implements :nonposixclass, PosixClass::All
7
+ implements :property, UnicodeProperty::V1_9_0
8
+ implements :nonproperty, UnicodeProperty::V1_9_0
9
+ implements :quantifier, Quantifier::Possessive + Quantifier::IntervalPossessive
10
+ implements :type, CharacterType::Hex
18
11
  end
@@ -1,11 +1,4 @@
1
- module Regexp::Syntax
2
- class V1_9_3 < Regexp::Syntax::V1_9_1
3
- def initialize
4
- super
5
-
6
- # these were added with update of Oniguruma to Unicode 6.0
7
- implements :property, UnicodeProperty::V1_9_3
8
- implements :nonproperty, UnicodeProperty::V1_9_3
9
- end
10
- end
1
+ class Regexp::Syntax::V1_9_3 < Regexp::Syntax::V1_9_1
2
+ implements :property, UnicodeProperty::V1_9_3
3
+ implements :nonproperty, UnicodeProperty::V1_9_3
11
4
  end
@@ -1,17 +1,10 @@
1
- module Regexp::Syntax
2
- # use the last 1.9 release as the base
3
- class V2_0_0 < Regexp::Syntax::V1_9
4
- def initialize
5
- super
1
+ class Regexp::Syntax::V2_0_0 < Regexp::Syntax::V1_9_3
2
+ implements :keep, Keep::All
3
+ implements :conditional, Conditional::All
4
+ implements :property, UnicodeProperty::V2_0_0
5
+ implements :nonproperty, UnicodeProperty::V2_0_0
6
+ implements :type, CharacterType::Clustered
6
7
 
7
- implements :keep, Keep::All
8
- implements :conditional, Conditional::All
9
- implements :property, UnicodeProperty::V2_0_0
10
- implements :nonproperty, UnicodeProperty::V2_0_0
11
- implements :type, CharacterType::Clustered
12
-
13
- excludes :property, :newline
14
- excludes :nonproperty, :newline
15
- end
16
- end
8
+ excludes :property, %i[newline]
9
+ excludes :nonproperty, %i[newline]
17
10
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_2_0 < Regexp::Syntax::V2_1
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_2_0
7
- implements :nonproperty, UnicodeProperty::V2_2_0
8
- end
9
- end
1
+ class Regexp::Syntax::V2_2_0 < Regexp::Syntax::V2_0_0
2
+ implements :property, UnicodeProperty::V2_2_0
3
+ implements :nonproperty, UnicodeProperty::V2_2_0
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_3_0 < Regexp::Syntax::V2_2
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_3_0
7
- implements :nonproperty, UnicodeProperty::V2_3_0
8
- end
9
- end
1
+ class Regexp::Syntax::V2_3_0 < Regexp::Syntax::V2_2_0
2
+ implements :property, UnicodeProperty::V2_3_0
3
+ implements :nonproperty, UnicodeProperty::V2_3_0
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_4_0 < Regexp::Syntax::V2_3
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_4_0
7
- implements :nonproperty, UnicodeProperty::V2_4_0
8
- end
9
- end
1
+ class Regexp::Syntax::V2_4_0 < Regexp::Syntax::V2_3_0
2
+ implements :property, UnicodeProperty::V2_4_0
3
+ implements :nonproperty, UnicodeProperty::V2_4_0
10
4
  end
@@ -1,9 +1,3 @@
1
- module Regexp::Syntax
2
- class V2_4_1 < Regexp::Syntax::V2_4_0
3
- def initialize
4
- super
5
-
6
- implements :group, Group::V2_4_1
7
- end
8
- end
1
+ class Regexp::Syntax::V2_4_1 < Regexp::Syntax::V2_4_0
2
+ implements :group, Group::V2_4_1
9
3
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_5_0 < Regexp::Syntax::V2_4
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_5_0
7
- implements :nonproperty, UnicodeProperty::V2_5_0
8
- end
9
- end
1
+ class Regexp::Syntax::V2_5_0 < Regexp::Syntax::V2_4_1
2
+ implements :property, UnicodeProperty::V2_5_0
3
+ implements :nonproperty, UnicodeProperty::V2_5_0
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_6_0 < Regexp::Syntax::V2_5
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_6_0
7
- implements :nonproperty, UnicodeProperty::V2_6_0
8
- end
9
- end
1
+ class Regexp::Syntax::V2_6_0 < Regexp::Syntax::V2_5_0
2
+ implements :property, UnicodeProperty::V2_6_0
3
+ implements :nonproperty, UnicodeProperty::V2_6_0
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_6_2 < Regexp::Syntax::V2_6_0
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_6_2
7
- implements :nonproperty, UnicodeProperty::V2_6_2
8
- end
9
- end
1
+ class Regexp::Syntax::V2_6_2 < Regexp::Syntax::V2_6_0
2
+ implements :property, UnicodeProperty::V2_6_2
3
+ implements :nonproperty, UnicodeProperty::V2_6_2
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V2_6_3 < Regexp::Syntax::V2_6_2
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V2_6_3
7
- implements :nonproperty, UnicodeProperty::V2_6_3
8
- end
9
- end
1
+ class Regexp::Syntax::V2_6_3 < Regexp::Syntax::V2_6_2
2
+ implements :property, UnicodeProperty::V2_6_3
3
+ implements :nonproperty, UnicodeProperty::V2_6_3
10
4
  end
@@ -1,10 +1,4 @@
1
- module Regexp::Syntax
2
- class V3_1_0 < Regexp::Syntax::V2_6_3
3
- def initialize
4
- super
5
-
6
- implements :property, UnicodeProperty::V3_1_0
7
- implements :nonproperty, UnicodeProperty::V3_1_0
8
- end
9
- end
1
+ class Regexp::Syntax::V3_1_0 < Regexp::Syntax::V2_6_3
2
+ implements :property, UnicodeProperty::V3_1_0
3
+ implements :nonproperty, UnicodeProperty::V3_1_0
10
4
  end
@@ -0,0 +1,4 @@
1
+ class Regexp::Syntax::V3_2_0 < Regexp::Syntax::V3_1_0
2
+ implements :property, UnicodeProperty::V3_2_0
3
+ implements :nonproperty, UnicodeProperty::V3_2_0
4
+ end
@@ -1,4 +1,4 @@
1
- # Ruby 1.8.x is no longer a supported runtime,
1
+ # Ruby 1.x is no longer a supported runtime,
2
2
  # but its regex features are still recognized.
3
3
  #
4
4
  # Aliases for the latest patch version are provided as 'ruby/n.n',
@@ -1,5 +1,5 @@
1
1
  class Regexp
2
2
  class Parser
3
- VERSION = '2.2.0'
3
+ VERSION = '2.3.1'
4
4
  end
5
5
  end