Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package rubygem-regexp_parser for 
openSUSE:Factory checked in at 2022-06-15 00:32:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-regexp_parser (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-regexp_parser.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-regexp_parser"

Wed Jun 15 00:32:37 2022 rev:10 rq:982535 version:2.5.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-regexp_parser/rubygem-regexp_parser.changes  
    2022-05-16 18:11:01.585397888 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-regexp_parser.new.1548/rubygem-regexp_parser.changes
    2022-06-15 00:32:53.202578269 +0200
@@ -1,0 +2,10 @@
+Mon Jun 13 17:10:18 UTC 2022 - Manuel Schnitzer <mschnit...@suse.com>
+
+- updated to version 2.5.0
+
+  ### Added
+
+  - `Regexp::Expression::Base.construct` and `.token_class` methods
+    * see the [wiki](https://github.com/ammar/regexp_parser/wiki) for details
+
+-------------------------------------------------------------------

Old:
----
  regexp_parser-2.4.0.gem

New:
----
  regexp_parser-2.5.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-regexp_parser.spec ++++++
--- /var/tmp/diff_new_pack.NQ7GCP/_old  2022-06-15 00:32:54.426580069 +0200
+++ /var/tmp/diff_new_pack.NQ7GCP/_new  2022-06-15 00:32:54.430580074 +0200
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-regexp_parser
-Version:        2.4.0
+Version:        2.5.0
 Release:        0
 %define mod_name regexp_parser
 %define mod_full_name %{mod_name}-%{version}

++++++ regexp_parser-2.4.0.gem -> regexp_parser-2.5.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2022-05-09 21:26:43.000000000 +0200
+++ new/CHANGELOG.md    2022-05-27 23:32:50.000000000 +0200
@@ -1,5 +1,9 @@
 ## [Unreleased]
 
+### Added
+
+- `Regexp::Expression::Base.construct` and `.token_class` methods
+
 ## [2.4.0] - 2022-05-09 - [Janosch M??ller](mailto:janosc...@gmail.com)
 
 ### Fixed
@@ -36,10 +40,12 @@
 
     It will no longer be supported in regexp_parser v3.0.0.
 
-    Please pass a Regexp::Token instead, e.g. replace `type, text, min, max, 
mode`
-    with `::Regexp::Token.new(:quantifier, type, text)`. min, max, and mode
+    Please pass a Regexp::Token instead, e.g. replace `token, text, min, max, 
mode`
+    with `::Regexp::Token.new(:quantifier, token, text)`. min, max, and mode
     will be derived automatically.
 
+    Or do `exp.quantifier = Quantifier.construct(token: token, text: str)`.
+
     This is consistent with how Expression::Base instances are created.
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2022-05-09 21:26:43.000000000 +0200
+++ new/README.md       2022-05-27 23:32:50.000000000 +0200
@@ -447,12 +447,14 @@
 
 - [capybara](https://github.com/teamcapybara/capybara) is an integration 
testing tool that uses regexp_parser to convert Regexps to css/xpath selectors.
 
-- [js_regex](https://github.com/janosch-x/js_regex) converts Ruby regular 
expressions to JavaScript-compatible regular expressions.
+- [js_regex](https://github.com/jaynetics/js_regex) converts Ruby regular 
expressions to JavaScript-compatible regular expressions.
 
 - [meta_re](https://github.com/ammar/meta_re) is a regular expression 
preprocessor with alias support.
 
 - [mutant](https://github.com/mbj/mutant) manipulates your regular expressions 
(amongst others) to see if your tests cover their behavior.
 
+- [repper](https://github.com/jaynetics/repper) is a regular expression 
pretty-printer for Ruby.
+
 - [rubocop](https://github.com/rubocop-hq/rubocop) is a linter for Ruby that 
uses regexp_parser to lint Regexps.
 
 - [twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb) is a 
localization helper that uses regexp_parser to generate examples of postal 
codes.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/regexp_parser/expression/classes/backreference.rb 
new/lib/regexp_parser/expression/classes/backreference.rb
--- old/lib/regexp_parser/expression/classes/backreference.rb   2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/classes/backreference.rb   2022-05-27 
23:32:50.000000000 +0200
@@ -1,4 +1,5 @@
 module Regexp::Expression
+  # TODO: unify name with token :backref, one way or the other, in v3.0.0
   module Backreference
     class Base < Regexp::Expression::Base
       attr_accessor :referenced_expression
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/regexp_parser/expression/classes/character_type.rb 
new/lib/regexp_parser/expression/classes/character_type.rb
--- old/lib/regexp_parser/expression/classes/character_type.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/lib/regexp_parser/expression/classes/character_type.rb  2022-05-27 
23:32:50.000000000 +0200
@@ -0,0 +1,17 @@
+module Regexp::Expression
+  module CharacterType
+    class Base < Regexp::Expression::Base; end
+
+    class Any              < CharacterType::Base; end
+    class Digit            < CharacterType::Base; end
+    class NonDigit         < CharacterType::Base; end
+    class Hex              < CharacterType::Base; end
+    class NonHex           < CharacterType::Base; end
+    class Word             < CharacterType::Base; end
+    class NonWord          < CharacterType::Base; end
+    class Space            < CharacterType::Base; end
+    class NonSpace         < CharacterType::Base; end
+    class Linebreak        < CharacterType::Base; end
+    class ExtendedGrapheme < CharacterType::Base; end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/classes/keep.rb 
new/lib/regexp_parser/expression/classes/keep.rb
--- old/lib/regexp_parser/expression/classes/keep.rb    2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/classes/keep.rb    2022-05-27 
23:32:50.000000000 +0200
@@ -1,5 +1,7 @@
 module Regexp::Expression
   module Keep
+    # TOOD: in regexp_parser v3.0.0 this should possibly be a Subexpression
+    #       that contains all expressions to its left.
     class Mark < Regexp::Expression::Base; end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/classes/property.rb 
new/lib/regexp_parser/expression/classes/property.rb
--- old/lib/regexp_parser/expression/classes/property.rb        2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/classes/property.rb        1970-01-01 
01:00:00.000000000 +0100
@@ -1,118 +0,0 @@
-module Regexp::Expression
-  module UnicodeProperty
-    class Base < Regexp::Expression::Base
-      def negative?
-        type == :nonproperty
-      end
-
-      def name
-        text[/\A\\[pP]\{([^}]+)\}\z/, 1]
-      end
-
-      def shortcut
-        (Regexp::Scanner.short_prop_map.rassoc(token.to_s) || []).first
-      end
-    end
-
-    class Alnum         < Base; end
-    class Alpha         < Base; end
-    class Ascii         < Base; end
-    class Blank         < Base; end
-    class Cntrl         < Base; end
-    class Digit         < Base; end
-    class Graph         < Base; end
-    class Lower         < Base; end
-    class Print         < Base; end
-    class Punct         < Base; end
-    class Space         < Base; end
-    class Upper         < Base; end
-    class Word          < Base; end
-    class Xdigit        < Base; end
-    class XPosixPunct   < Base; end
-
-    class Newline       < Base; end
-
-    class Any           < Base; end
-    class Assigned      < Base; end
-
-    module Letter
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Letter::Base; end
-      class Cased       < Letter::Base; end
-      class Uppercase   < Letter::Base; end
-      class Lowercase   < Letter::Base; end
-      class Titlecase   < Letter::Base; end
-      class Modifier    < Letter::Base; end
-      class Other       < Letter::Base; end
-    end
-
-    module Mark
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Mark::Base; end
-      class Combining   < Mark::Base; end
-      class Nonspacing  < Mark::Base; end
-      class Spacing     < Mark::Base; end
-      class Enclosing   < Mark::Base; end
-    end
-
-    module Number
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Number::Base; end
-      class Decimal     < Number::Base; end
-      class Letter      < Number::Base; end
-      class Other       < Number::Base; end
-    end
-
-    module Punctuation
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Punctuation::Base; end
-      class Connector   < Punctuation::Base; end
-      class Dash        < Punctuation::Base; end
-      class Open        < Punctuation::Base; end
-      class Close       < Punctuation::Base; end
-      class Initial     < Punctuation::Base; end
-      class Final       < Punctuation::Base; end
-      class Other       < Punctuation::Base; end
-    end
-
-    module Separator
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Separator::Base; end
-      class Space       < Separator::Base; end
-      class Line        < Separator::Base; end
-      class Paragraph   < Separator::Base; end
-    end
-
-    module Symbol
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Symbol::Base; end
-      class Math        < Symbol::Base; end
-      class Currency    < Symbol::Base; end
-      class Modifier    < Symbol::Base; end
-      class Other       < Symbol::Base; end
-    end
-
-    module Codepoint
-      class Base < UnicodeProperty::Base; end
-
-      class Any         < Codepoint::Base; end
-      class Control     < Codepoint::Base; end
-      class Format      < Codepoint::Base; end
-      class Surrogate   < Codepoint::Base; end
-      class PrivateUse  < Codepoint::Base; end
-      class Unassigned  < Codepoint::Base; end
-    end
-
-    class Age     < UnicodeProperty::Base; end
-    class Derived < UnicodeProperty::Base; end
-    class Emoji   < UnicodeProperty::Base; end
-    class Script  < UnicodeProperty::Base; end
-    class Block   < UnicodeProperty::Base; end
-  end
-end # module Regexp::Expression
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/classes/root.rb 
new/lib/regexp_parser/expression/classes/root.rb
--- old/lib/regexp_parser/expression/classes/root.rb    2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/classes/root.rb    2022-05-27 
23:32:50.000000000 +0200
@@ -1,11 +1,9 @@
 module Regexp::Expression
   class Root < Regexp::Expression::Subexpression
     def self.build(options = {})
-      new(build_token, options)
-    end
-
-    def self.build_token
-      Regexp::Token.new(:expression, :root, '', 0)
+      warn "`#{self.class}.build(options)` is deprecated and will raise in "\
+           "regexp_parser v3.0.0. Please use `.construct(options: options)`."
+      construct(options: options)
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/classes/type.rb 
new/lib/regexp_parser/expression/classes/type.rb
--- old/lib/regexp_parser/expression/classes/type.rb    2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/classes/type.rb    1970-01-01 
01:00:00.000000000 +0100
@@ -1,17 +0,0 @@
-module Regexp::Expression
-  module CharacterType
-    class Base < Regexp::Expression::Base; end
-
-    class Any              < CharacterType::Base; end
-    class Digit            < CharacterType::Base; end
-    class NonDigit         < CharacterType::Base; end
-    class Hex              < CharacterType::Base; end
-    class NonHex           < CharacterType::Base; end
-    class Word             < CharacterType::Base; end
-    class NonWord          < CharacterType::Base; end
-    class Space            < CharacterType::Base; end
-    class NonSpace         < CharacterType::Base; end
-    class Linebreak        < CharacterType::Base; end
-    class ExtendedGrapheme < CharacterType::Base; end
-  end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/regexp_parser/expression/classes/unicode_property.rb 
new/lib/regexp_parser/expression/classes/unicode_property.rb
--- old/lib/regexp_parser/expression/classes/unicode_property.rb        
1970-01-01 01:00:00.000000000 +0100
+++ new/lib/regexp_parser/expression/classes/unicode_property.rb        
2022-05-27 23:32:50.000000000 +0200
@@ -0,0 +1,119 @@
+module Regexp::Expression
+  # TODO: unify name with token :property, on way or the other, in v3.0.0
+  module UnicodeProperty
+    class Base < Regexp::Expression::Base
+      def negative?
+        type == :nonproperty
+      end
+
+      def name
+        text[/\A\\[pP]\{([^}]+)\}\z/, 1]
+      end
+
+      def shortcut
+        (Regexp::Scanner.short_prop_map.rassoc(token.to_s) || []).first
+      end
+    end
+
+    class Alnum         < Base; end
+    class Alpha         < Base; end
+    class Ascii         < Base; end
+    class Blank         < Base; end
+    class Cntrl         < Base; end
+    class Digit         < Base; end
+    class Graph         < Base; end
+    class Lower         < Base; end
+    class Print         < Base; end
+    class Punct         < Base; end
+    class Space         < Base; end
+    class Upper         < Base; end
+    class Word          < Base; end
+    class Xdigit        < Base; end
+    class XPosixPunct   < Base; end
+
+    class Newline       < Base; end
+
+    class Any           < Base; end
+    class Assigned      < Base; end
+
+    module Letter
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Letter::Base; end
+      class Cased       < Letter::Base; end
+      class Uppercase   < Letter::Base; end
+      class Lowercase   < Letter::Base; end
+      class Titlecase   < Letter::Base; end
+      class Modifier    < Letter::Base; end
+      class Other       < Letter::Base; end
+    end
+
+    module Mark
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Mark::Base; end
+      class Combining   < Mark::Base; end
+      class Nonspacing  < Mark::Base; end
+      class Spacing     < Mark::Base; end
+      class Enclosing   < Mark::Base; end
+    end
+
+    module Number
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Number::Base; end
+      class Decimal     < Number::Base; end
+      class Letter      < Number::Base; end
+      class Other       < Number::Base; end
+    end
+
+    module Punctuation
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Punctuation::Base; end
+      class Connector   < Punctuation::Base; end
+      class Dash        < Punctuation::Base; end
+      class Open        < Punctuation::Base; end
+      class Close       < Punctuation::Base; end
+      class Initial     < Punctuation::Base; end
+      class Final       < Punctuation::Base; end
+      class Other       < Punctuation::Base; end
+    end
+
+    module Separator
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Separator::Base; end
+      class Space       < Separator::Base; end
+      class Line        < Separator::Base; end
+      class Paragraph   < Separator::Base; end
+    end
+
+    module Symbol
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Symbol::Base; end
+      class Math        < Symbol::Base; end
+      class Currency    < Symbol::Base; end
+      class Modifier    < Symbol::Base; end
+      class Other       < Symbol::Base; end
+    end
+
+    module Codepoint
+      class Base < UnicodeProperty::Base; end
+
+      class Any         < Codepoint::Base; end
+      class Control     < Codepoint::Base; end
+      class Format      < Codepoint::Base; end
+      class Surrogate   < Codepoint::Base; end
+      class PrivateUse  < Codepoint::Base; end
+      class Unassigned  < Codepoint::Base; end
+    end
+
+    class Age     < UnicodeProperty::Base; end
+    class Derived < UnicodeProperty::Base; end
+    class Emoji   < UnicodeProperty::Base; end
+    class Script  < UnicodeProperty::Base; end
+    class Block   < UnicodeProperty::Base; end
+  end
+end # module Regexp::Expression
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/methods/construct.rb 
new/lib/regexp_parser/expression/methods/construct.rb
--- old/lib/regexp_parser/expression/methods/construct.rb       1970-01-01 
01:00:00.000000000 +0100
+++ new/lib/regexp_parser/expression/methods/construct.rb       2022-05-27 
23:32:50.000000000 +0200
@@ -0,0 +1,43 @@
+module Regexp::Expression
+  module Shared
+    module ClassMethods
+      # Convenience method to init a valid Expression without a Regexp::Token
+      def construct(params = {})
+        attrs = construct_defaults.merge(params)
+        options = attrs.delete(:options)
+        token_args = Regexp::TOKEN_KEYS.map { |k| attrs.delete(k) }
+        token = Regexp::Token.new(*token_args)
+        raise ArgumentError, "unsupported attribute(s): #{attrs}" if attrs.any?
+
+        new(token, options)
+      end
+
+      def construct_defaults
+        if self == Root
+          { type: :expression, token: :root, ts: 0 }
+        elsif self < Sequence
+          { type: :expression, token: :sequence }
+        else
+          { type: token_class::Type }
+        end.merge(level: 0, set_level: 0, conditional_level: 0, text: '')
+      end
+
+      def token_class
+        if self == Root || self < Sequence
+          nil # no token class because these objects are Parser-generated
+        # TODO: synch exp & token class names for alt., dot, escapes in v3.0.0
+        elsif self == Alternation || self == CharacterType::Any
+          Regexp::Syntax::Token::Meta
+        elsif self <= EscapeSequence::Base
+          Regexp::Syntax::Token::Escape
+        else
+          Regexp::Syntax::Token.const_get(name.split('::')[2])
+        end
+      end
+    end
+
+    def token_class
+      self.class.token_class
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/methods/match_length.rb 
new/lib/regexp_parser/expression/methods/match_length.rb
--- old/lib/regexp_parser/expression/methods/match_length.rb    2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/methods/match_length.rb    2022-05-27 
23:32:50.000000000 +0200
@@ -112,7 +112,7 @@
     end
 
     def inner_match_length
-      dummy = Regexp::Expression::Root.build
+      dummy = Regexp::Expression::Root.construct
       dummy.expressions = expressions.map(&:clone)
       dummy.quantifier = quantifier && quantifier.clone
       dummy.match_length
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/quantifier.rb 
new/lib/regexp_parser/expression/quantifier.rb
--- old/lib/regexp_parser/expression/quantifier.rb      2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/quantifier.rb      2022-05-27 
23:32:50.000000000 +0200
@@ -14,7 +14,7 @@
       deprecated_old_init(*args) and return if args.count == 4 || args.count 
== 5
 
       init_from_token_and_options(*args)
-      @mode = (token[/greedy|reluctant|possessive/] || :greedy).to_sym
+      @mode = (token.to_s[/greedy|reluctant|possessive/] || :greedy).to_sym
       @min, @max = minmax
       # TODO: remove in v3.0.0, stop removing parts of #token (?)
       self.token = token.to_s.sub(/_(greedy|possessive|reluctant)/, '').to_sym
@@ -44,10 +44,11 @@
     def deprecated_old_init(token, text, min, max, mode = :greedy)
       warn "Calling `Expression::Base#quantify` or `#{self.class}.new` with 4+ 
arguments "\
            "is deprecated.\nIt will no longer be supported in regexp_parser 
v3.0.0.\n"\
-           "Please pass a Regexp::Token instead, e.g. replace `type, text, 
min, max, mode` "\
-           "with `::Regexp::Token.new(:quantifier, type, text)`. min, max, and 
mode "\
-           "will be derived automatically. \nThis is consistent with how 
Expression::Base "\
-           "instances are created."
+           "Please pass a Regexp::Token instead, e.g. replace `token, text, 
min, max, mode` "\
+           "with `::Regexp::Token.new(:quantifier, token, text)`. min, max, 
and mode "\
+           "will be derived automatically.\n"\
+           "Or do `exp.quantifier = #{self.class}.construct(token: token, 
text: str)`.\n"\
+           "This is consistent with how Expression::Base instances are 
created. "
       @token = token
       @text  = text
       @min   = min
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/sequence.rb 
new/lib/regexp_parser/expression/sequence.rb
--- old/lib/regexp_parser/expression/sequence.rb        2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression/sequence.rb        2022-05-27 
23:32:50.000000000 +0200
@@ -7,31 +7,17 @@
   # branches, and CharacterSet::Intersection intersected sequences.
   class Sequence < Regexp::Expression::Subexpression
     class << self
-      def add_to(subexpression, params = {}, active_opts = {})
-        sequence = at_levels(
-          subexpression.level,
-          subexpression.set_level,
-          params[:conditional_level] || subexpression.conditional_level
+      def add_to(exp, params = {}, active_opts = {})
+        sequence = construct(
+          level:             exp.level,
+          set_level:         exp.set_level,
+          conditional_level: params[:conditional_level] || 
exp.conditional_level,
         )
-        sequence.nesting_level = subexpression.nesting_level + 1
+        sequence.nesting_level = exp.nesting_level + 1
         sequence.options = active_opts
-        subexpression.expressions << sequence
+        exp.expressions << sequence
         sequence
       end
-
-      def at_levels(level, set_level, conditional_level)
-        token = Regexp::Token.new(
-          :expression,
-          :sequence,
-          '',
-          nil, # ts
-          nil, # te
-          level,
-          set_level,
-          conditional_level
-        )
-        new(token)
-      end
     end
 
     def starts_at
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression/shared.rb 
new/lib/regexp_parser/expression/shared.rb
--- old/lib/regexp_parser/expression/shared.rb  2022-05-09 21:26:43.000000000 
+0200
+++ new/lib/regexp_parser/expression/shared.rb  2022-05-27 23:32:50.000000000 
+0200
@@ -1,7 +1,11 @@
 module Regexp::Expression
   module Shared
+    module ClassMethods; end # filled in ./methods/*.rb
+
     def self.included(mod)
       mod.class_eval do
+        extend Shared::ClassMethods
+
         attr_accessor :type, :token, :text, :ts, :te,
                       :level, :set_level, :conditional_level,
                       :options, :quantifier
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/expression.rb 
new/lib/regexp_parser/expression.rb
--- old/lib/regexp_parser/expression.rb 2022-05-09 21:26:43.000000000 +0200
+++ new/lib/regexp_parser/expression.rb 2022-05-27 23:32:50.000000000 +0200
@@ -13,6 +13,7 @@
 require 'regexp_parser/expression/classes/character_set'
 require 'regexp_parser/expression/classes/character_set/intersection'
 require 'regexp_parser/expression/classes/character_set/range'
+require 'regexp_parser/expression/classes/character_type'
 require 'regexp_parser/expression/classes/conditional'
 require 'regexp_parser/expression/classes/escape_sequence'
 require 'regexp_parser/expression/classes/free_space'
@@ -20,10 +21,10 @@
 require 'regexp_parser/expression/classes/keep'
 require 'regexp_parser/expression/classes/literal'
 require 'regexp_parser/expression/classes/posix_class'
-require 'regexp_parser/expression/classes/property'
 require 'regexp_parser/expression/classes/root'
-require 'regexp_parser/expression/classes/type'
+require 'regexp_parser/expression/classes/unicode_property'
 
+require 'regexp_parser/expression/methods/construct'
 require 'regexp_parser/expression/methods/match'
 require 'regexp_parser/expression/methods/match_length'
 require 'regexp_parser/expression/methods/options'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/parser.rb 
new/lib/regexp_parser/parser.rb
--- old/lib/regexp_parser/parser.rb     2022-05-09 21:26:43.000000000 +0200
+++ new/lib/regexp_parser/parser.rb     2022-05-27 23:32:50.000000000 +0200
@@ -23,7 +23,7 @@
   end
 
   def parse(input, syntax = "ruby/#{RUBY_VERSION}", options: nil, &block)
-    root = Root.build(extract_options(input, options))
+    root = Root.construct(options: extract_options(input, options))
 
     self.root = root
     self.node = root
@@ -200,11 +200,11 @@
   end
 
   def captured_group_count_at_level
-    captured_group_counts[node.level]
+    captured_group_counts[node]
   end
 
   def count_captured_group
-    captured_group_counts[node.level] += 1
+    captured_group_counts[node] += 1
   end
 
   def close_group
@@ -475,17 +475,14 @@
     # description of the problem: 
https://github.com/ammar/regexp_parser/issues/3
     # rationale for this solution: 
https://github.com/ammar/regexp_parser/pull/69
     if target_node.quantified?
-      new_token = Regexp::Token.new(
-        :group,
-        :passive,
-        '', # text (none because this group is implicit)
-        target_node.ts,
-        nil, # te (unused)
-        target_node.level,
-        target_node.set_level,
-        target_node.conditional_level
+      new_group = Group::Passive.construct(
+        token:             :passive,
+        ts:                target_node.ts,
+        level:             target_node.level,
+        set_level:         target_node.set_level,
+        conditional_level: target_node.conditional_level,
+        options:           active_opts,
       )
-      new_group = Group::Passive.new(new_token, active_opts)
       new_group.implicit = true
       new_group << target_node
       increase_group_level(target_node)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/syntax/token/escape.rb 
new/lib/regexp_parser/syntax/token/escape.rb
--- old/lib/regexp_parser/syntax/token/escape.rb        2022-05-09 
21:26:43.000000000 +0200
+++ new/lib/regexp_parser/syntax/token/escape.rb        2022-05-27 
23:32:50.000000000 +0200
@@ -1,6 +1,6 @@
 module Regexp::Syntax
   module Token
-    # TODO: unify naming with RE::EscapeSequence, on way or the other, in 
v3.0.0
+    # TODO: unify naming with RE::EscapeSequence, one way or the other, in 
v3.0.0
     module Escape
       Basic = %i[backslash literal]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/version.rb 
new/lib/regexp_parser/version.rb
--- old/lib/regexp_parser/version.rb    2022-05-09 21:26:43.000000000 +0200
+++ new/lib/regexp_parser/version.rb    2022-05-27 23:32:50.000000000 +0200
@@ -1,5 +1,5 @@
 class Regexp
   class Parser
-    VERSION = '2.4.0'
+    VERSION = '2.5.0'
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-05-09 21:26:43.000000000 +0200
+++ new/metadata        2022-05-27 23:32:50.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: regexp_parser
 version: !ruby/object:Gem::Version
-  version: 2.4.0
+  version: 2.5.0
 platform: ruby
 authors:
 - Ammar Ali
 autorequire:
 bindir: bin
 cert_chain: []
-date: 2022-05-09 00:00:00.000000000 Z
+date: 2022-05-27 00:00:00.000000000 Z
 dependencies: []
 description: A library for tokenizing, lexing, and parsing Ruby regular 
expressions.
 email:
@@ -32,6 +32,7 @@
 - lib/regexp_parser/expression/classes/character_set.rb
 - lib/regexp_parser/expression/classes/character_set/intersection.rb
 - lib/regexp_parser/expression/classes/character_set/range.rb
+- lib/regexp_parser/expression/classes/character_type.rb
 - lib/regexp_parser/expression/classes/conditional.rb
 - lib/regexp_parser/expression/classes/escape_sequence.rb
 - lib/regexp_parser/expression/classes/free_space.rb
@@ -39,9 +40,9 @@
 - lib/regexp_parser/expression/classes/keep.rb
 - lib/regexp_parser/expression/classes/literal.rb
 - lib/regexp_parser/expression/classes/posix_class.rb
-- lib/regexp_parser/expression/classes/property.rb
 - lib/regexp_parser/expression/classes/root.rb
-- lib/regexp_parser/expression/classes/type.rb
+- lib/regexp_parser/expression/classes/unicode_property.rb
+- lib/regexp_parser/expression/methods/construct.rb
 - lib/regexp_parser/expression/methods/match.rb
 - lib/regexp_parser/expression/methods/match_length.rb
 - lib/regexp_parser/expression/methods/options.rb

Reply via email to