Hello community,

here is the log from the commit of package rubygem-regexp_parser for 
openSUSE:Factory checked in at 2020-11-11 20:47:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-regexp_parser (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-regexp_parser.new.26437 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-regexp_parser"

Wed Nov 11 20:47:11 2020 rev:3 rq:847723 version:1.8.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/rubygem-regexp_parser/rubygem-regexp_parser.changes  
    2020-10-05 19:33:21.133213501 +0200
+++ 
/work/SRC/openSUSE:Factory/.rubygem-regexp_parser.new.26437/rubygem-regexp_parser.changes
   2020-11-11 20:47:17.283697474 +0100
@@ -1,0 +2,11 @@
+Tue Nov 10 21:43:06 UTC 2020 - Manuel Schnitzer <mschnit...@suse.com>
+
+- updated to version 1.8.2
+
+  ### Fixed
+
+  - fix `FrozenError` in `Expression::Base#repetitions` on Ruby 3.0
+    * thanks to [Thomas Walpole](https://github.com/twalpole)
+  - removed "unknown future version" warning on Ruby 3.0
+
+-------------------------------------------------------------------

Old:
----
  regexp_parser-1.8.0.gem

New:
----
  regexp_parser-1.8.2.gem

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

Other differences:
------------------
++++++ rubygem-regexp_parser.spec ++++++
--- /var/tmp/diff_new_pack.twhMTo/_old  2020-11-11 20:47:17.963698113 +0100
+++ /var/tmp/diff_new_pack.twhMTo/_new  2020-11-11 20:47:17.967698117 +0100
@@ -24,12 +24,12 @@
 #
 
 Name:           rubygem-regexp_parser
-Version:        1.8.0
+Version:        1.8.2
 Release:        0
 %define mod_name regexp_parser
 %define mod_full_name %{mod_name}-%{version}
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  %{ruby >= 1.9.1}
+BuildRequires:  %{ruby >= 2.0.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  %{rubygem rdoc > 3.10}
 BuildRequires:  ruby-macros >= 5

++++++ regexp_parser-1.8.0.gem -> regexp_parser-1.8.2.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2020-09-20 12:20:52.000000000 +0200
+++ new/CHANGELOG.md    2020-10-11 23:38:14.000000000 +0200
@@ -1,5 +1,23 @@
 ## [Unreleased]
 
+### [1.8.2] - 2020-10-11 - [Janosch Müller](mailto:janosc...@gmail.com)
+
+### Fixed
+
+- fix `FrozenError` in `Expression::Base#repetitions` on Ruby 3.0
+  * thanks to [Thomas Walpole](https://github.com/twalpole)
+- removed "unknown future version" warning on Ruby 3.0
+
+### [1.8.1] - 2020-09-28 - [Janosch Müller](mailto:janosc...@gmail.com)
+
+### Fixed
+
+- fixed scanning of comment-like text in normal mode
+  * this was an old bug, but had become more prevalent in v1.8.0
+  * thanks to [Tietew](https://github.com/Tietew) for the report
+- specified correct minimum Ruby version in gemspec
+  * it said 1.9 but really required 2.0 as of v1.8.0
+
 ### [1.8.0] - 2020-09-20 - [Janosch Müller](mailto:janosc...@gmail.com)
 
 ### Changed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2020-09-20 12:20:52.000000000 +0200
+++ new/README.md       2020-10-11 23:38:14.000000000 +0200
@@ -8,8 +8,8 @@
   * A scanner/tokenizer based on 
[Ragel](http://www.colm.net/open-source/ragel/)
   * A lexer that produces a "stream" of token objects.
   * A parser that produces a "tree" of Expression objects (OO API)
-* Runs on Ruby 2.x and JRuby runtimes
-* Recognizes Ruby 1.8, 1.9, and 2.x regular expressions [See Supported 
Syntax](#supported-syntax)
+* Runs on Ruby 2.x, 3.x and JRuby runtimes
+* Recognizes Ruby 1.8, 1.9, 2.x and 3.x regular expressions [See Supported 
Syntax](#supported-syntax)
 
 
 _For examples of regexp_parser in use, see [Example 
Projects](#example-projects)._
@@ -18,7 +18,7 @@
 ---
 ## Requirements
 
-* Ruby >= 1.9
+* Ruby >= 2.0
 * Ragel >= 6.0, but only if you want to build the gem or work on the scanner.
 
 
@@ -317,7 +317,7 @@
 
 ## Supported Syntax
 The three modules support all the regular expression syntax features of Ruby 
1.8,
-1.9, and 2.x:
+1.9, 2.x and 3.x:
 
 _Note that not all of these are available in all versions of Ruby_
 
@@ -440,13 +440,17 @@
 ## Example Projects
 Projects using regexp_parser.
 
+- [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.
+
 - [meta_re](https://github.com/ammar/meta_re) is a regular expression 
preprocessor with alias support.
 
 - [mutant](https://github.com/mbj/mutant) (before v0.9.0) manipulates your 
regular expressions (amongst others) to see if your tests cover their behavior.
 
-- [twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb) uses 
regexp_parser to generate examples of postal codes.
+- [rubocop](https://github.com/rubocop-hq/rubocop) is a linter for Ruby that 
uses regexp_parser to lint Regexps.
 
-- [js_regex](https://github.com/janosch-x/js_regex) converts Ruby regular 
expressions to JavaScript-compatible regular expressions.
+- [twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb) is a 
localization helper that uses regexp_parser to generate examples of postal 
codes.
 
 
 ## References
@@ -475,4 +479,4 @@
 
 ---
 ##### Copyright
-_Copyright (c) 2010-2019 Ammar Ali. See LICENSE file for details._
+_Copyright (c) 2010-2020 Ammar Ali. See LICENSE file for details._
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.rb 
new/lib/regexp_parser/expression.rb
--- old/lib/regexp_parser/expression.rb 2020-09-20 12:20:52.000000000 +0200
+++ new/lib/regexp_parser/expression.rb 2020-10-11 23:38:14.000000000 +0200
@@ -80,8 +80,12 @@
       return 1..1 unless quantified?
       min = quantifier.min
       max = quantifier.max < 0 ? Float::INFINITY : quantifier.max
-      # fix Range#minmax - https://bugs.ruby-lang.org/issues/15807
-      (min..max).tap { |r| r.define_singleton_method(:minmax) { [min, max] } }
+      range = min..max
+      # fix Range#minmax on old Rubies - 
https://bugs.ruby-lang.org/issues/15807
+      if RUBY_VERSION.to_f < 2.7
+        range.define_singleton_method(:minmax) { [min, max] }
+      end
+      range
     end
 
     def greedy?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/scanner/scanner.rl 
new/lib/regexp_parser/scanner/scanner.rl
--- old/lib/regexp_parser/scanner/scanner.rl    2020-09-20 12:20:52.000000000 
+0200
+++ new/lib/regexp_parser/scanner/scanner.rl    2020-10-11 23:38:14.000000000 
+0200
@@ -649,7 +649,9 @@
       if free_spacing
         emit(:free_space, :comment, *text(data, ts, te))
       else
-        append_literal(data, ts, te)
+        # consume only the pound sign (#) and backtrack to do regular scanning
+        append_literal(data, ts, ts + 1)
+        fexec ts + 1;
       end
     };
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/scanner.rb 
new/lib/regexp_parser/scanner.rb
--- old/lib/regexp_parser/scanner.rb    2020-09-20 12:20:52.000000000 +0200
+++ new/lib/regexp_parser/scanner.rb    2020-10-11 23:38:14.000000000 +0200
@@ -2,7 +2,7 @@
 
 # line 1 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
 
-# line 676 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 678 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
 
 
 # THIS IS A GENERATED FILE, DO NOT EDIT DIRECTLY
@@ -1131,7 +1131,7 @@
 self.re_scanner_en_main = 110;
 
 
-# line 763 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 765 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
     
 # line 1136 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
 begin
@@ -1144,7 +1144,7 @@
        act = 0
 end
 
-# line 764 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 766 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
     
 # line 1149 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
 begin
@@ -2035,7 +2035,10 @@
       if free_spacing
         emit(:free_space, :comment, *text(data, ts, te))
       else
-        append_literal(data, ts, te)
+        # consume only the pound sign (#) and backtrack to do regular scanning
+        append_literal(data, ts, ts + 1)
+         begin p = (( ts + 1))-1; end
+
       end
      end
                end
@@ -2135,12 +2138,15 @@
       if free_spacing
         emit(:free_space, :comment, *text(data, ts, te))
       else
-        append_literal(data, ts, te)
+        # consume only the pound sign (#) and backtrack to do regular scanning
+        append_literal(data, ts, ts + 1)
+         begin p = (( ts + 1))-1; end
+
       end
      end
                end
        when 43 then
-# line 656 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 658 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
                begin
 te = p
 p = p - 1; begin 
@@ -2152,7 +2158,7 @@
      end
                end
        when 42 then
-# line 671 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 673 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
                begin
 te = p
 p = p - 1; begin 
@@ -2559,7 +2565,7 @@
                begin
 te = p+1
                end
-# line 671 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 673 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
                begin
 act = 56;              end
        when 47 then
@@ -2573,7 +2579,7 @@
 # line 149 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
                begin
  self.group_depth = group_depth + 1            end
-# line 2576 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
+# line 2582 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
        end
        end
        end
@@ -2591,7 +2597,7 @@
                begin
 act = 0
                end
-# line 2594 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
+# line 2600 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
        end
 
        if cs == 0
@@ -2625,7 +2631,7 @@
     text = ts ? copy(data, ts-1..-1) : data.pack('c*')
     raise PrematureEndError.new( text )
                end
-# line 2628 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
+# line 2634 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner.rb"
          end
        end
 
@@ -2636,7 +2642,7 @@
 end
        end
 
-# line 765 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
+# line 767 
"/Users/jannoschmuller/code/regexp_parser/lib/regexp_parser/scanner/scanner.rl"
 
     # to avoid "warning: assigned but unused variable - testEof"
     testEof = testEof
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/regexp_parser/syntax/version_lookup.rb 
new/lib/regexp_parser/syntax/version_lookup.rb
--- old/lib/regexp_parser/syntax/version_lookup.rb      2020-09-20 
12:20:52.000000000 +0200
+++ new/lib/regexp_parser/syntax/version_lookup.rb      2020-10-11 
23:38:14.000000000 +0200
@@ -74,9 +74,9 @@
   end
 
   def warn_if_future_version(const_name)
-    return if comparable_version(const_name) < comparable_version('3.0.0')
+    return if comparable_version(const_name) < comparable_version('4.0.0')
 
-    warn('This library has only been tested up to Ruby 2.x, '\
+    warn('This library has only been tested up to Ruby 3.x, '\
          "but you are running with #{const_get(const_name).inspect}")
   end
 end
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    2020-09-20 12:20:52.000000000 +0200
+++ new/lib/regexp_parser/version.rb    2020-10-11 23:38:14.000000000 +0200
@@ -1,5 +1,5 @@
 class Regexp
   class Parser
-    VERSION = '1.8.0'
+    VERSION = '1.8.2'
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2020-09-20 12:20:52.000000000 +0200
+++ new/metadata        2020-10-11 23:38:14.000000000 +0200
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: regexp_parser
 version: !ruby/object:Gem::Version
-  version: 1.8.0
+  version: 1.8.2
 platform: ruby
 authors:
 - Ammar Ali
 autorequire:
 bindir: bin
 cert_chain: []
-date: 2020-09-20 00:00:00.000000000 Z
+date: 2020-10-11 00:00:00.000000000 Z
 dependencies: []
 description: A library for tokenizing, lexing, and parsing Ruby regular 
expressions.
 email:
@@ -178,86 +178,86 @@
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
-      version: 1.9.1
+      version: 2.0.0
 required_rubygems_version: !ruby/object:Gem::Requirement
   requirements:
   - - ">="
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.1.2
+rubygems_version: 3.2.0.rc.1
 signing_key:
 specification_version: 4
 summary: Scanner, lexer, parser for ruby's regular expressions
 test_files:
-- spec/token/token_spec.rb
-- spec/spec_helper.rb
-- spec/lexer/escapes_spec.rb
-- spec/lexer/keep_spec.rb
+- spec/expression/base_spec.rb
+- spec/expression/clone_spec.rb
+- spec/expression/conditional_spec.rb
+- spec/expression/free_space_spec.rb
+- spec/expression/methods/match_length_spec.rb
+- spec/expression/methods/match_spec.rb
+- spec/expression/methods/strfregexp_spec.rb
+- spec/expression/methods/tests_spec.rb
+- spec/expression/methods/traverse_spec.rb
+- spec/expression/options_spec.rb
+- spec/expression/root_spec.rb
+- spec/expression/sequence_spec.rb
+- spec/expression/subexpression_spec.rb
+- spec/expression/to_h_spec.rb
+- spec/expression/to_s_spec.rb
 - spec/lexer/all_spec.rb
 - spec/lexer/conditionals_spec.rb
-- spec/lexer/nesting_spec.rb
 - spec/lexer/delimiters_spec.rb
-- spec/lexer/refcalls_spec.rb
+- spec/lexer/escapes_spec.rb
+- spec/lexer/keep_spec.rb
 - spec/lexer/literals_spec.rb
+- spec/lexer/nesting_spec.rb
+- spec/lexer/refcalls_spec.rb
+- spec/parser/all_spec.rb
+- spec/parser/alternation_spec.rb
+- spec/parser/anchors_spec.rb
+- spec/parser/conditionals_spec.rb
+- spec/parser/errors_spec.rb
 - spec/parser/escapes_spec.rb
-- spec/parser/properties_spec.rb
-- spec/parser/sets_spec.rb
 - spec/parser/free_space_spec.rb
+- spec/parser/groups_spec.rb
 - spec/parser/keep_spec.rb
 - spec/parser/options_spec.rb
-- spec/parser/all_spec.rb
-- spec/parser/conditionals_spec.rb
-- spec/parser/types_spec.rb
-- spec/parser/anchors_spec.rb
-- spec/parser/alternation_spec.rb
 - spec/parser/posix_classes_spec.rb
-- spec/parser/set/ranges_spec.rb
-- spec/parser/set/intersections_spec.rb
-- spec/parser/errors_spec.rb
-- spec/parser/refcalls_spec.rb
-- spec/parser/groups_spec.rb
+- spec/parser/properties_spec.rb
 - spec/parser/quantifiers_spec.rb
-- spec/support/warning_extractor.rb
-- spec/support/shared_examples.rb
-- spec/support/runner.rb
-- spec/expression/subexpression_spec.rb
-- spec/expression/methods/match_spec.rb
-- spec/expression/methods/match_length_spec.rb
-- spec/expression/methods/traverse_spec.rb
-- spec/expression/methods/strfregexp_spec.rb
-- spec/expression/methods/tests_spec.rb
-- spec/expression/free_space_spec.rb
-- spec/expression/options_spec.rb
-- spec/expression/to_s_spec.rb
-- spec/expression/root_spec.rb
-- spec/expression/sequence_spec.rb
-- spec/expression/clone_spec.rb
-- spec/expression/to_h_spec.rb
-- spec/expression/conditional_spec.rb
-- spec/expression/base_spec.rb
-- spec/syntax/syntax_spec.rb
-- spec/syntax/syntax_token_map_spec.rb
-- spec/syntax/versions/1.9.3_spec.rb
-- spec/syntax/versions/2.2.0_spec.rb
-- spec/syntax/versions/1.9.1_spec.rb
-- spec/syntax/versions/2.0.0_spec.rb
-- spec/syntax/versions/1.8.6_spec.rb
-- spec/syntax/versions/aliases_spec.rb
-- spec/scanner/escapes_spec.rb
-- spec/scanner/properties_spec.rb
-- spec/scanner/sets_spec.rb
-- spec/scanner/free_space_spec.rb
-- spec/scanner/keep_spec.rb
-- spec/scanner/options_spec.rb
+- spec/parser/refcalls_spec.rb
+- spec/parser/set/intersections_spec.rb
+- spec/parser/set/ranges_spec.rb
+- spec/parser/sets_spec.rb
+- spec/parser/types_spec.rb
 - spec/scanner/all_spec.rb
-- spec/scanner/conditionals_spec.rb
-- spec/scanner/types_spec.rb
 - spec/scanner/anchors_spec.rb
-- spec/scanner/meta_spec.rb
-- spec/scanner/errors_spec.rb
+- spec/scanner/conditionals_spec.rb
 - spec/scanner/delimiters_spec.rb
-- spec/scanner/refcalls_spec.rb
+- spec/scanner/errors_spec.rb
+- spec/scanner/escapes_spec.rb
+- spec/scanner/free_space_spec.rb
 - spec/scanner/groups_spec.rb
+- spec/scanner/keep_spec.rb
 - spec/scanner/literals_spec.rb
+- spec/scanner/meta_spec.rb
+- spec/scanner/options_spec.rb
+- spec/scanner/properties_spec.rb
 - spec/scanner/quantifiers_spec.rb
+- spec/scanner/refcalls_spec.rb
+- spec/scanner/sets_spec.rb
+- spec/scanner/types_spec.rb
+- spec/spec_helper.rb
+- spec/support/runner.rb
+- spec/support/shared_examples.rb
+- spec/support/warning_extractor.rb
+- spec/syntax/syntax_spec.rb
+- spec/syntax/syntax_token_map_spec.rb
+- spec/syntax/versions/1.8.6_spec.rb
+- spec/syntax/versions/1.9.1_spec.rb
+- spec/syntax/versions/1.9.3_spec.rb
+- spec/syntax/versions/2.0.0_spec.rb
+- spec/syntax/versions/2.2.0_spec.rb
+- spec/syntax/versions/aliases_spec.rb
+- spec/token/token_spec.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/regexp_parser.gemspec new/regexp_parser.gemspec
--- old/regexp_parser.gemspec   2020-09-20 12:20:52.000000000 +0200
+++ new/regexp_parser.gemspec   2020-10-11 23:38:14.000000000 +0200
@@ -32,5 +32,5 @@
 
   gem.platform      = Gem::Platform::RUBY
 
-  gem.required_ruby_version = '>= 1.9.1'
+  gem.required_ruby_version = '>= 2.0.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/parser/free_space_spec.rb 
new/spec/parser/free_space_spec.rb
--- old/spec/parser/free_space_spec.rb  2020-09-20 12:20:52.000000000 +0200
+++ new/spec/parser/free_space_spec.rb  2020-10-11 23:38:14.000000000 +0200
@@ -24,34 +24,13 @@
     expect(root.first.text).to eq 'a b c d'
   end
 
-  specify('parse single-line free space comments without spaces') do
-    regexp = /a#b/x
-
-    root = RP.parse(regexp)
-    expect(root.length).to eq 2
-
-    expect(root[0]).to be_instance_of(Literal)
-    expect(root[1]).to be_instance_of(Comment)
-  end
-
-  specify('parse single-line free space comments with spaces') do
-    regexp = /a # b/x
-
-    root = RP.parse(regexp)
-    expect(root.length).to eq 3
-
-    expect(root[0]).to be_instance_of(Literal)
-    expect(root[1]).to be_instance_of(WhiteSpace)
-    expect(root[2]).to be_instance_of(Comment)
-  end
-
   specify('parse free space comments') do
     regexp = /
       a   ?     # One letter
       b {2,5}   # Another one
       [c-g]  +  # A set
       (h|i|j) | # A group
-      klm#nospace before or after comment hash
+      klm *
       nop +
     /x
 
@@ -72,11 +51,11 @@
 
     alt_2 = alt.alternatives.last
     expect(alt_2).to be_instance_of(Alternative)
-    expect(alt_2.length).to eq 8
+    expect(alt_2.length).to eq 7
 
-    [0, 2, 5, 7].each { |i| expect(alt_2[i].class).to eq WhiteSpace }
+    [0, 2, 4, 6].each { |i| expect(alt_2[i].class).to eq WhiteSpace }
 
-    [1, 4].each { |i| expect(alt_2[i]).to be_instance_of(Comment) }
+    expect(alt_2[1]).to be_instance_of(Comment)
   end
 
   specify('parse free space nested comments') do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/spec/scanner/free_space_spec.rb 
new/spec/scanner/free_space_spec.rb
--- old/spec/scanner/free_space_spec.rb 2020-09-20 12:20:52.000000000 +0200
+++ new/spec/scanner/free_space_spec.rb 2020-10-11 23:38:14.000000000 +0200
@@ -39,6 +39,17 @@
       11 => [:free_space, :comment,  "# B ? comment\n",      37,  51],
       17 => [:free_space, :comment,  "# C {2,3} comment\n",  66,  84],
       29 => [:free_space, :comment,  "# D|E comment\n",     100, 114]
+
+    # single line / no trailing newline (c.f. issue #66)
+    include_examples 'scan', /a # b/x,
+      0 => [:literal,    :literal,    'a',   0,  1],
+      1 => [:free_space, :whitespace, ' ',   1,  2],
+      2 => [:free_space, :comment,    "# b", 2,  5]
+
+    # without spaces (c.f. issue #66)
+    include_examples 'scan', /a#b/x,
+      0 => [:literal,    :literal,  'a',   0,  1],
+      1 => [:free_space, :comment,  "#b", 1,  3]
   end
 
   describe('scan free space inlined') do
@@ -130,4 +141,25 @@
       26 => [:literal,    :literal,        'i j',   35, 38],
       27 => [:group,      :close,          ')',     38, 39]
   end
+
+  describe('scanning `#` in regular (non-x mode)') do # c.f. issue 70
+    include_examples 'scan', /a#bcd/,
+      0 => [:literal, :literal, 'a#bcd', 0, 5]
+    include_examples 'scan', /a # bcd/,
+      0 => [:literal, :literal, 'a # bcd', 0, 7]
+
+    include_examples 'scan', /a#\d/,
+      0 => [:literal, :literal, 'a#', 0, 2],
+      1 => [:type,    :digit,   '\d', 2, 4]
+    include_examples 'scan', /a # \d/,
+      0 => [:literal, :literal, 'a # ', 0, 4],
+      1 => [:type,    :digit,   '\d',   4, 6]
+
+    include_examples 'scan', /a#()/,
+      0 => [:literal, :literal, 'a#', 0, 2],
+      1 => [:group,   :capture, '(',  2, 3]
+    include_examples 'scan', /a # ()/,
+      0 => [:literal, :literal, 'a # ', 0, 4],
+      1 => [:group,   :capture, '(',    4, 5]
+  end
 end
_______________________________________________
openSUSE Commits mailing list -- commit@lists.opensuse.org
To unsubscribe, email commit-le...@lists.opensuse.org
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/commit@lists.opensuse.org

Reply via email to