regexp_parser 2.11.1 → 2.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Rakefile +2 -0
  4. data/lib/regexp_parser/error.rb +2 -0
  5. data/lib/regexp_parser/expression/base.rb +2 -0
  6. data/lib/regexp_parser/expression/classes/alternation.rb +2 -0
  7. data/lib/regexp_parser/expression/classes/anchor.rb +2 -0
  8. data/lib/regexp_parser/expression/classes/backreference.rb +2 -0
  9. data/lib/regexp_parser/expression/classes/character_set/intersection.rb +2 -0
  10. data/lib/regexp_parser/expression/classes/character_set/range.rb +2 -0
  11. data/lib/regexp_parser/expression/classes/character_set.rb +2 -0
  12. data/lib/regexp_parser/expression/classes/character_type.rb +2 -0
  13. data/lib/regexp_parser/expression/classes/conditional.rb +2 -0
  14. data/lib/regexp_parser/expression/classes/escape_sequence.rb +2 -0
  15. data/lib/regexp_parser/expression/classes/free_space.rb +2 -0
  16. data/lib/regexp_parser/expression/classes/group.rb +2 -0
  17. data/lib/regexp_parser/expression/classes/keep.rb +2 -0
  18. data/lib/regexp_parser/expression/classes/literal.rb +2 -0
  19. data/lib/regexp_parser/expression/classes/posix_class.rb +2 -0
  20. data/lib/regexp_parser/expression/classes/root.rb +2 -0
  21. data/lib/regexp_parser/expression/classes/unicode_property.rb +2 -0
  22. data/lib/regexp_parser/expression/methods/construct.rb +2 -0
  23. data/lib/regexp_parser/expression/methods/escape_sequence_char.rb +2 -0
  24. data/lib/regexp_parser/expression/methods/escape_sequence_codepoint.rb +2 -0
  25. data/lib/regexp_parser/expression/methods/human_name.rb +2 -0
  26. data/lib/regexp_parser/expression/methods/match.rb +2 -0
  27. data/lib/regexp_parser/expression/methods/match_length.rb +2 -0
  28. data/lib/regexp_parser/expression/methods/negative.rb +2 -0
  29. data/lib/regexp_parser/expression/methods/options.rb +2 -0
  30. data/lib/regexp_parser/expression/methods/parts.rb +2 -0
  31. data/lib/regexp_parser/expression/methods/printing.rb +2 -0
  32. data/lib/regexp_parser/expression/methods/referenced_expressions.rb +2 -0
  33. data/lib/regexp_parser/expression/methods/strfregexp.rb +2 -0
  34. data/lib/regexp_parser/expression/methods/tests.rb +2 -0
  35. data/lib/regexp_parser/expression/methods/traverse.rb +2 -0
  36. data/lib/regexp_parser/expression/quantifier.rb +3 -1
  37. data/lib/regexp_parser/expression/sequence.rb +2 -0
  38. data/lib/regexp_parser/expression/sequence_operation.rb +2 -0
  39. data/lib/regexp_parser/expression/shared.rb +2 -0
  40. data/lib/regexp_parser/expression/subexpression.rb +2 -0
  41. data/lib/regexp_parser/expression.rb +2 -0
  42. data/lib/regexp_parser/lexer.rb +2 -0
  43. data/lib/regexp_parser/parser.rb +2 -0
  44. data/lib/regexp_parser/scanner/errors/premature_end_error.rb +2 -0
  45. data/lib/regexp_parser/scanner/errors/scanner_error.rb +2 -0
  46. data/lib/regexp_parser/scanner/errors/validation_error.rb +2 -0
  47. data/lib/regexp_parser/scanner/scanner.rl +9 -1
  48. data/lib/regexp_parser/scanner.rb +10 -2
  49. data/lib/regexp_parser/syntax/any.rb +2 -0
  50. data/lib/regexp_parser/syntax/base.rb +2 -0
  51. data/lib/regexp_parser/syntax/token/anchor.rb +5 -3
  52. data/lib/regexp_parser/syntax/token/assertion.rb +4 -2
  53. data/lib/regexp_parser/syntax/token/backreference.rb +8 -6
  54. data/lib/regexp_parser/syntax/token/character_set.rb +3 -1
  55. data/lib/regexp_parser/syntax/token/character_type.rb +6 -4
  56. data/lib/regexp_parser/syntax/token/conditional.rb +5 -3
  57. data/lib/regexp_parser/syntax/token/escape.rb +9 -7
  58. data/lib/regexp_parser/syntax/token/group.rb +8 -6
  59. data/lib/regexp_parser/syntax/token/keep.rb +3 -1
  60. data/lib/regexp_parser/syntax/token/meta.rb +4 -2
  61. data/lib/regexp_parser/syntax/token/posix_class.rb +4 -2
  62. data/lib/regexp_parser/syntax/token/quantifier.rb +8 -6
  63. data/lib/regexp_parser/syntax/token/unicode_property.rb +51 -49
  64. data/lib/regexp_parser/syntax/token/virtual.rb +5 -3
  65. data/lib/regexp_parser/syntax/token.rb +5 -3
  66. data/lib/regexp_parser/syntax/version_lookup.rb +4 -2
  67. data/lib/regexp_parser/syntax/versions/1.8.6.rb +2 -0
  68. data/lib/regexp_parser/syntax/versions/1.9.1.rb +2 -0
  69. data/lib/regexp_parser/syntax/versions/1.9.3.rb +2 -0
  70. data/lib/regexp_parser/syntax/versions/2.0.0.rb +2 -0
  71. data/lib/regexp_parser/syntax/versions/2.2.0.rb +2 -0
  72. data/lib/regexp_parser/syntax/versions/2.3.0.rb +2 -0
  73. data/lib/regexp_parser/syntax/versions/2.4.0.rb +2 -0
  74. data/lib/regexp_parser/syntax/versions/2.4.1.rb +2 -0
  75. data/lib/regexp_parser/syntax/versions/2.5.0.rb +2 -0
  76. data/lib/regexp_parser/syntax/versions/2.6.0.rb +2 -0
  77. data/lib/regexp_parser/syntax/versions/2.6.2.rb +2 -0
  78. data/lib/regexp_parser/syntax/versions/2.6.3.rb +2 -0
  79. data/lib/regexp_parser/syntax/versions/3.1.0.rb +2 -0
  80. data/lib/regexp_parser/syntax/versions/3.2.0.rb +2 -0
  81. data/lib/regexp_parser/syntax/versions.rb +2 -0
  82. data/lib/regexp_parser/syntax.rb +2 -0
  83. data/lib/regexp_parser/token.rb +2 -0
  84. data/lib/regexp_parser/version.rb +3 -1
  85. data/lib/regexp_parser.rb +2 -0
  86. data/regexp_parser.gemspec +2 -0
  87. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7598b7311a82778cbcb493188dad178ce93c8478e420cd9e2382732ee90d4e1
4
- data.tar.gz: 60a8399981030bdef025cf9657e043a5ccac93adeee62a589a8adb41ec460664
3
+ metadata.gz: 4a040acf8a74a8fba3bb10e289258195ecfbd78a0708da8757230fc6d6e9fe23
4
+ data.tar.gz: 2c444d8dcb5f24d752e00eca09adb0c2c9b1f4612accf3356b923b19c47cae57
5
5
  SHA512:
6
- metadata.gz: a7ac06fda5f76d4497b8f01d1e724917d009f7c9ea10befcf03a801af8e769b52619433a22cc997cf584b03e1ca9e6ced257f5fc07e327c966f5c25714d2d0b4
7
- data.tar.gz: 3d3f89a383bb63208a41801ea059bfc407ff2e88d657d23b0f13740d418335ad47c9f5174bc1d5b7f06841d7a461828c57efa1f97f8bc1b9b42e255959bd18cf
6
+ metadata.gz: 57021cd49ca2c5db4b62de77b6e929e717f44520eeff6d39a195f15b8a5b2e9bdb98eb74e849465dd2648a24a2c8c0102c38b9f938b41bc4ca40059925d038c4
7
+ data.tar.gz: 0e03ce414e29548f4923c98396262297f61260a1960b9849ffb24ed6da32788fd728cc42e0949b176fa9e1404790d4b3f788219f345607c187f81c0b9352ea3c
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler'
2
4
  require 'rubygems'
3
5
  require 'rubygems/package_task'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Regexp::Parser
2
4
  # base class for all gem-specific errors
3
5
  class Error < StandardError; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Base
3
5
  include Regexp::Expression::Shared
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  # A sequence of expressions, used by Alternation as one of its alternatives.
3
5
  class Alternative < Regexp::Expression::Sequence; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Anchor
3
5
  class Base < Regexp::Expression::Base; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Backreference
3
5
  class Base < Regexp::Expression::Base; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class CharacterSet < Regexp::Expression::Subexpression
3
5
  class IntersectedSequence < Regexp::Expression::Sequence; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class CharacterSet < Regexp::Expression::Subexpression
3
5
  class Range < Regexp::Expression::Subexpression
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class CharacterSet < Regexp::Expression::Subexpression
3
5
  attr_accessor :closed, :negative
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module CharacterType
3
5
  class Base < Regexp::Expression::Base; end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Conditional
3
5
  class TooManyBranches < Regexp::Parser::Error
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module EscapeSequence
3
5
  Base = Class.new(Regexp::Expression::Base)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class FreeSpace < Regexp::Expression::Base
3
5
  def quantify(*_args)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Group
3
5
  class Base < Regexp::Expression::Subexpression
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Keep
3
5
  # TODO: in regexp_parser v3.0.0 this should possibly be a Subexpression
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Literal < Regexp::Expression::Base; end
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class PosixClass < Regexp::Expression::Base
3
5
  def name
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Root < Regexp::Expression::Subexpression
3
5
  def self.build(options = {})
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module UnicodeProperty
3
5
  class Base < Regexp::Expression::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  module ClassMethods
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Regexp::Expression::EscapeSequence::Base.class_eval do
2
4
  def char
3
5
  codepoint.chr('utf-8')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression::EscapeSequence
2
4
  AsciiEscape.class_eval { def codepoint; 0x1B end }
3
5
  Backspace.class_eval { def codepoint; 0x8 end }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  # default implementation, e.g. "atomic group", "hex escape", "word type", ..
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Base
3
5
  def match?(string)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Regexp::MatchLength
2
4
  include Enumerable
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  def negative?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Base
3
5
  def multiline?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  # default implementation
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  def inspect
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module ReferencedExpressions
3
5
  attr_accessor :referenced_expressions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Base
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Subexpression < Regexp::Expression::Base
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  # TODO: in v3.0.0, maybe put Shared back into Base, and inherit from Base and
3
5
  # call super in #initialize, but raise in #quantifier= and #quantify,
@@ -6,7 +8,7 @@ module Regexp::Expression
6
8
  class Quantifier
7
9
  include Regexp::Expression::Shared
8
10
 
9
- MODES = %i[greedy possessive reluctant]
11
+ MODES = %i[greedy possessive reluctant].freeze
10
12
 
11
13
  def initialize(*args)
12
14
  deprecated_old_init(*args) and return if args.count == 4 || args.count == 5
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  # A sequence of expressions. Differs from a Subexpressions by how it handles
3
5
  # quantifiers, as it applies them to its last element instead of itself as
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  # abstract class
3
5
  class SequenceOperation < Regexp::Expression::Subexpression
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  module Shared
3
5
  module ClassMethods; end # filled in ./methods/*.rb
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Expression
2
4
  class Subexpression < Regexp::Expression::Base
3
5
  include Enumerable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'error'
2
4
 
3
5
  require_relative 'expression/shared'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # A very thin wrapper around the scanner that breaks quantified literal runs,
2
4
  # collects emitted tokens into an array, calculates their nesting depth, and
3
5
  # normalizes tokens for the parser, and checks if they are implemented by the
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'error'
2
4
  require_relative 'expression'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Regexp::Scanner
2
4
  # Unexpected end of pattern
3
5
  class PrematureEndError < ScannerError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative '../../../regexp_parser/error'
2
4
 
3
5
  class Regexp::Scanner
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Regexp::Scanner
2
4
  # Base for all scanner validation errors
3
5
  class ValidationError < ScannerError
@@ -686,7 +686,7 @@ class Regexp::Scanner
686
686
 
687
687
  input = input_object.is_a?(Regexp) ? input_object.source : input_object
688
688
  self.free_spacing = free_spacing?(input_object, options)
689
- self.regexp_encoding = input_object.encoding if input_object.is_a?(::Regexp)
689
+ self.regexp_encoding = extract_encoding(input_object, options)
690
690
  self.spacing_stack = [{:free_spacing => free_spacing, :depth => 0}]
691
691
 
692
692
  data = input.unpack("c*")
@@ -780,6 +780,14 @@ class Regexp::Scanner
780
780
  :group_depth, :set_depth, :conditional_stack,
781
781
  :char_pos
782
782
 
783
+ def extract_encoding(input_object, options)
784
+ if input_object.is_a?(::Regexp)
785
+ input_object.encoding
786
+ elsif options && (options & Regexp::NOENCODING)
787
+ Encoding::BINARY
788
+ end
789
+ end
790
+
783
791
  def free_spacing?(input_object, options)
784
792
  if options && !input_object.is_a?(String)
785
793
  raise ArgumentError, 'options cannot be supplied unless scanning a String'
@@ -1,4 +1,4 @@
1
- # -*- warn-indent:false; -*-
1
+ # -*- frozen_string_literal: true; warn-indent: false -*-
2
2
  #
3
3
  # THIS IS A GENERATED FILE, DO NOT EDIT DIRECTLY
4
4
  #
@@ -28,7 +28,7 @@ class Regexp::Scanner
28
28
 
29
29
  input = input_object.is_a?(Regexp) ? input_object.source : input_object
30
30
  self.free_spacing = free_spacing?(input_object, options)
31
- self.regexp_encoding = input_object.encoding if input_object.is_a?(::Regexp)
31
+ self.regexp_encoding = extract_encoding(input_object, options)
32
32
  self.spacing_stack = [{:free_spacing => free_spacing, :depth => 0}]
33
33
 
34
34
  data = input.unpack("c*")
@@ -2425,6 +2425,14 @@ end
2425
2425
  :group_depth, :set_depth, :conditional_stack,
2426
2426
  :char_pos
2427
2427
 
2428
+ def extract_encoding(input_object, options)
2429
+ if input_object.is_a?(::Regexp)
2430
+ input_object.encoding
2431
+ elsif options && (options & Regexp::NOENCODING)
2432
+ Encoding::BINARY
2433
+ end
2434
+ end
2435
+
2428
2436
  def free_spacing?(input_object, options)
2429
2437
  if options && !input_object.is_a?(String)
2430
2438
  raise ArgumentError, 'options cannot be supplied unless scanning a String'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  # A syntax that always returns true, passing all tokens as implemented. This
3
5
  # is useful during development, testing, and should be useful for some types
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  class NotImplementedError < Regexp::Syntax::SyntaxError
3
5
  def initialize(syntax, type, token)
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Anchor
4
- Basic = %i[bol eol]
6
+ Basic = %i[bol eol].freeze
5
7
  Extended = Basic + %i[word_boundary nonword_boundary]
6
- String = %i[bos eos eos_ob_eol]
7
- MatchStart = %i[match_start]
8
+ String = %i[bos eos eos_ob_eol].freeze
9
+ MatchStart = %i[match_start].freeze
8
10
 
9
11
  All = Extended + String + MatchStart
10
12
  Type = :anchor
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Assertion
4
- Lookahead = %i[lookahead nlookahead]
5
- Lookbehind = %i[lookbehind nlookbehind]
6
+ Lookahead = %i[lookahead nlookahead].freeze
7
+ Lookbehind = %i[lookbehind nlookbehind].freeze
6
8
 
7
9
  All = Lookahead + Lookbehind
8
10
  Type = :assertion
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Backreference
4
- Plain = %i[number]
5
- NumberRef = %i[number_ref number_rel_ref]
6
+ Plain = %i[number].freeze
7
+ NumberRef = %i[number_ref number_rel_ref].freeze
6
8
  Number = Plain + NumberRef
7
- Name = %i[name_ref]
9
+ Name = %i[name_ref].freeze
8
10
 
9
- RecursionLevel = %i[name_recursion_ref number_recursion_ref]
11
+ RecursionLevel = %i[name_recursion_ref number_recursion_ref].freeze
10
12
 
11
13
  V1_8_6 = Plain
12
14
 
@@ -18,8 +20,8 @@ module Regexp::Syntax
18
20
 
19
21
  # Type is the same as Backreference so keeping it here, for now.
20
22
  module SubexpressionCall
21
- Name = %i[name_call]
22
- Number = %i[number_call number_rel_call]
23
+ Name = %i[name_call].freeze
24
+ Number = %i[number_call number_rel_call].freeze
23
25
 
24
26
  All = Name + Number
25
27
  end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module CharacterSet
4
- Basic = %i[open close negate range]
6
+ Basic = %i[open close negate range].freeze
5
7
  Extended = Basic + %i[intersection]
6
8
 
7
9
  All = Extended
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module CharacterType
4
- Basic = []
5
- Extended = %i[digit nondigit space nonspace word nonword]
6
- Hex = %i[hex nonhex]
6
+ Basic = [].freeze
7
+ Extended = %i[digit nondigit space nonspace word nonword].freeze
8
+ Hex = %i[hex nonhex].freeze
7
9
 
8
- Clustered = %i[linebreak xgrapheme]
10
+ Clustered = %i[linebreak xgrapheme].freeze
9
11
 
10
12
  All = Basic + Extended + Hex + Clustered
11
13
  Type = :type
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Conditional
4
- Delimiters = %i[open close]
6
+ Delimiters = %i[open close].freeze
5
7
 
6
- Condition = %i[condition_open condition condition_close]
7
- Separator = %i[separator]
8
+ Condition = %i[condition_open condition condition_close].freeze
9
+ Separator = %i[separator].freeze
8
10
 
9
11
  All = Conditional::Delimiters + Conditional::Condition + Conditional::Separator
10
12
 
@@ -1,25 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Escape
4
- Basic = %i[backslash literal]
6
+ Basic = %i[backslash literal].freeze
5
7
 
6
- Control = %i[control meta_sequence]
8
+ Control = %i[control meta_sequence].freeze
7
9
 
8
10
  ASCII = %i[bell backspace escape form_feed newline carriage
9
- tab vertical_tab]
11
+ tab vertical_tab].freeze
10
12
 
11
- Unicode = %i[codepoint codepoint_list]
13
+ Unicode = %i[codepoint codepoint_list].freeze
12
14
 
13
15
  Meta = %i[dot alternation
14
16
  zero_or_one zero_or_more one_or_more
15
17
  bol eol
16
18
  group_open group_close
17
19
  interval_open interval_close
18
- set_open set_close]
20
+ set_open set_close].freeze
19
21
 
20
- Hex = %i[hex utf8_hex]
22
+ Hex = %i[hex utf8_hex].freeze
21
23
 
22
- Octal = %i[octal]
24
+ Octal = %i[octal].freeze
23
25
 
24
26
  All = Basic + Control + ASCII + Unicode + Meta + Hex + Octal
25
27
  Type = :escape
@@ -1,18 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Group
4
- Basic = %i[capture close]
6
+ Basic = %i[capture close].freeze
5
7
  Extended = Basic + %i[options options_switch]
6
8
 
7
- Named = %i[named]
8
- Atomic = %i[atomic]
9
- Passive = %i[passive]
10
- Comment = %i[comment]
9
+ Named = %i[named].freeze
10
+ Atomic = %i[atomic].freeze
11
+ Passive = %i[passive].freeze
12
+ Comment = %i[comment].freeze
11
13
 
12
14
  V1_8_6 = Group::Extended + Group::Named + Group::Atomic +
13
15
  Group::Passive + Group::Comment
14
16
 
15
- V2_4_1 = %i[absence]
17
+ V2_4_1 = %i[absence].freeze
16
18
 
17
19
  All = V1_8_6 + V2_4_1
18
20
  Type = :group
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Keep
4
- Mark = %i[mark]
6
+ Mark = %i[mark].freeze
5
7
 
6
8
  All = Mark
7
9
  Type = :keep
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module Meta
4
- Basic = %i[dot]
5
- Alternation = %i[alternation]
6
+ Basic = %i[dot].freeze
7
+ Alternation = %i[alternation].freeze
6
8
  Extended = Basic + Alternation
7
9
 
8
10
  All = Extended
@@ -1,10 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Regexp::Syntax
2
4
  module Token
3
5
  module PosixClass
4
6
  Standard = %i[alnum alpha blank cntrl digit graph
5
- lower print punct space upper xdigit]
7
+ lower print punct space upper xdigit].freeze
6
8
 
7
- Extensions = %i[ascii word]
9
+ Extensions = %i[ascii word].freeze
8
10
 
9
11
  All = Standard + Extensions
10
12
  Type = :posixclass