Hello community,

here is the log from the commit of package perl-Spooky-Patterns-XS for 
openSUSE:Factory checked in at 2019-07-28 10:22:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Spooky-Patterns-XS (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Spooky-Patterns-XS.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Spooky-Patterns-XS"

Sun Jul 28 10:22:54 2019 rev:3 rq:719273 version:1.52

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Spooky-Patterns-XS/perl-Spooky-Patterns-XS.changes
  2017-12-05 01:30:35.572525240 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Spooky-Patterns-XS.new.4126/perl-Spooky-Patterns-XS.changes
        2019-07-28 10:22:56.244567516 +0200
@@ -1,0 +2,5 @@
+Sat Jul 27 13:13:50 UTC 2019 - Stephan Kulow <[email protected]>
+
+- 1.52: Record all matches even if they overlap at the start
+
+-------------------------------------------------------------------

Old:
----
  Spooky-Patterns-XS-1.51.tar.gz

New:
----
  Spooky-Patterns-XS-1.52.tar.gz

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

Other differences:
------------------
++++++ perl-Spooky-Patterns-XS.spec ++++++
--- /var/tmp/diff_new_pack.udNw9r/_old  2019-07-28 10:22:56.716567505 +0200
+++ /var/tmp/diff_new_pack.udNw9r/_new  2019-07-28 10:22:56.716567505 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Spooky-Patterns-XS
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,16 +12,16 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           perl-Spooky-Patterns-XS
-Version:        1.51
+Version:        1.52
 Release:        0
 %define cpan_name Spooky-Patterns-XS
 Summary:        Spooky::Patterns::XS Perl module
-License:        GPL-2.0+
+License:        GPL-2.0-or-later
 Group:          Development/Libraries/Perl
 Url:            http://search.cpan.org/dist/Spooky-Patterns-XS/
 Source0:        Spooky-Patterns-XS-%{version}.tar.gz

++++++ Spooky-Patterns-XS-1.51.tar.gz -> Spooky-Patterns-XS-1.52.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/Changes 
new/Spooky-Patterns-XS-1.52/Changes
--- old/Spooky-Patterns-XS-1.51/Changes 2017-12-04 15:16:38.987570161 +0100
+++ new/Spooky-Patterns-XS-1.52/Changes 2019-07-27 15:08:33.627368132 +0200
@@ -1,5 +1,8 @@
 Revision history for Perl extension Spooky::Patterns::XS
 
+1.52    2019-07-27
+        - Record all matches even if they overlap at the start
+
 1.51    2017-12-04
         - Ignore skips at the end of a pattern
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/META.json 
new/Spooky-Patterns-XS-1.52/META.json
--- old/Spooky-Patterns-XS-1.51/META.json       2017-12-04 15:17:54.211367984 
+0100
+++ new/Spooky-Patterns-XS-1.52/META.json       2019-07-27 15:12:50.707185745 
+0200
@@ -4,13 +4,13 @@
       "Stephan Kulow <[email protected]>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
-      "unknown"
+      "gpl_2"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Spooky-Patterns-XS",
    "no_index" : {
@@ -45,6 +45,6 @@
          "url" : "https://github.com/coolo/spooky-pattern-xs";
       }
    },
-   "version" : "1.51",
-   "x_serialization_backend" : "JSON::PP version 2.27400_02"
+   "version" : "1.52",
+   "x_serialization_backend" : "JSON::PP version 2.97001"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/META.yml 
new/Spooky-Patterns-XS-1.52/META.yml
--- old/Spooky-Patterns-XS-1.51/META.yml        2017-12-04 15:17:54.159368124 
+0100
+++ new/Spooky-Patterns-XS-1.52/META.yml        2019-07-27 15:12:50.595185824 
+0200
@@ -7,8 +7,8 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 
2.150010'
-license: unknown
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
+license: gpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: '1.4'
@@ -22,5 +22,5 @@
 resources:
   license: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
   repository: https://github.com/coolo/spooky-pattern-xs
-version: '1.51'
+version: '1.52'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/Makefile.PL 
new/Spooky-Patterns-XS-1.52/Makefile.PL
--- old/Spooky-Patterns-XS-1.51/Makefile.PL     2017-12-04 14:39:44.881647238 
+0100
+++ new/Spooky-Patterns-XS-1.52/Makefile.PL     2019-07-27 15:10:43.639275811 
+0200
@@ -19,7 +19,7 @@
     },
     LD => 'g++',
     XSOPT => '-C++',
-    LICENSE       => 'GPL-2.0+',
+    LICENSE       => 'GPL_2',
     AUTHOR            => 'Stephan Kulow <[email protected]>',
     INC               => join(' ', @INC),
     LIBS              => [ join(' ', @LIBPATH, @LIBS) ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/XS.pm 
new/Spooky-Patterns-XS-1.52/XS.pm
--- old/Spooky-Patterns-XS-1.51/XS.pm   2017-12-04 15:16:57.179521271 +0100
+++ new/Spooky-Patterns-XS-1.52/XS.pm   2019-07-27 15:08:33.627368132 +0200
@@ -23,7 +23,7 @@
 our @ISA       = qw(Exporter);
 our @EXPORT_OK = qw();
 
-our $VERSION = '1.51';
+our $VERSION = '1.52';
 
 require XSLoader;
 XSLoader::load( 'Spooky::Patterns::XS', $VERSION );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/patterns_impl.cc 
new/Spooky-Patterns-XS-1.52/patterns_impl.cc
--- old/Spooky-Patterns-XS-1.51/patterns_impl.cc        2017-12-04 
15:16:07.587654549 +0100
+++ new/Spooky-Patterns-XS-1.52/patterns_impl.cc        2019-07-27 
15:08:33.627368132 +0200
@@ -43,6 +43,16 @@
 const int MAX_TOKEN_LENGTH = 100;
 const int MAX_LINE_SIZE = 8000;
 
+struct Match {
+    int start;
+    int matched;
+    int pattern;
+    int sline;
+    int eline;
+};
+
+typedef std::list<Match> Matches;
+
 struct Matcher {
     TokenTree ignore_tree;
     TokenTree pattern_tree;
@@ -250,17 +260,33 @@
         m->longest_pattern = len;
 }
 
-unsigned int check_token_matches(const TokenList& tokens, unsigned int offset, 
const TokenTree* patterns, int* pid)
+void add_match(const TokenList& ts, Matches& ms, int tokenlist_offset, int 
tokenlist_index, unsigned int matched, int pid) {
+  Match m;
+  m.start = tokenlist_offset + tokenlist_index;
+  m.matched = matched - tokenlist_index;
+
+  m.sline = ts[tokenlist_index].linenumber;
+  m.eline = ts[matched - 1].linenumber;
+
+  m.pattern = pid;
+#if DEBUG
+  fprintf(stderr, "L %d(%d)-%d(%d) id:%d\n", ts[tokenlist_index].linenumber,
+      tokenlist_offset + tokenlist_index, ts[matched - 1].linenumber, 
m.matched, m.pattern);
+#endif
+  ms.push_back(m);
+}
+
+void check_token_matches(const TokenList& tokens, Matches &ms, int 
tokenlist_offset, int tokenlist_index, unsigned int offset, const TokenTree* 
patterns)
 {
-    unsigned int last_match = 0;
+    if (offset >= tokens.size())
+        return;
+
     while (patterns) {
         if (offset >= tokens.size()) {
             // end of text, check if pattern ends too
-            if (patterns->pid && last_match < offset) {
-                *pid = patterns->pid;
-                last_match = offset;
-            }
-            return last_match;
+            if (patterns->pid)
+                add_match(tokens, ms, tokenlist_offset, tokenlist_index, 
offset, patterns->pid);
+            return;
         }
 
 #if DEBUG
@@ -272,36 +298,17 @@
         if (patterns->skips) {
             for (SkipList::const_iterator it = patterns->skips->begin(); it != 
patterns->skips->end(); ++it) {
                 for (int i = 1; i <= it->first; ++i) {
-                    int cpid = 0;
-                    unsigned int matched = check_token_matches(tokens, offset 
+ i, it->second, &cpid);
-#if DEBUG
-                    fprintf(stderr, "MP2 %d SKIP %d:%d = %d %d\n", offset, 
it->first, i, matched, cpid);
-#endif
-
-                    if (last_match < matched) {
-                        last_match = matched;
-                        *pid = cpid;
-                    }
+                    check_token_matches(tokens, ms, tokenlist_offset, 
tokenlist_index, offset + i, it->second);
                 }
             }
         }
-        if (patterns->pid && last_match < offset) {
-            *pid = patterns->pid;
-            last_match = offset;
-        }
+        if (patterns->pid)
+            add_match(tokens, ms, tokenlist_offset, tokenlist_index, offset, 
patterns->pid);
         patterns = patterns->find(tokens[offset].hash);
         offset++;
     }
-    return last_match;
 }
 
-struct Match {
-    int start;
-    int matched;
-    int pattern;
-    int sline;
-    int eline;
-};
 
 // if either the start or the end of one region is within the other
 bool match_overlap(int s1, int e1, int s2, int e2)
@@ -313,30 +320,12 @@
     return false;
 }
 
-typedef std::list<Match> Matches;
-
 void find_tokens(Matcher* m, TokenList& ts, Matches& ms, int tokenlist_offset, 
int tokenlist_index)
 {
     TokenTree* patterns = m->pattern_tree.find(ts[tokenlist_index].hash);
     if (!patterns)
         return;
-    int pid = 0;
-    int matched = check_token_matches(ts, tokenlist_index + 1, patterns, &pid);
-    if (pid) {
-        Match m;
-        m.start = tokenlist_offset + tokenlist_index;
-        m.matched = matched - tokenlist_index;
-
-        m.sline = ts[tokenlist_index].linenumber;
-        m.eline = ts[matched - 1].linenumber;
-
-        m.pattern = pid;
-#if DEBUG
-        fprintf(stderr, "L %d(%d)-%d(%d) id:%d\n", 
ts[tokenlist_index].linenumber,
-            tokenlist_offset + tokenlist_index, ts[tokenlist_index + matched - 
1].linenumber, m.matched, m.pattern);
-#endif
-        ms.push_back(m);
-    }
+    check_token_matches(ts, ms, tokenlist_offset, tokenlist_index, 
tokenlist_index + 1, patterns);
 }
 
 AV* pattern_find_matches(Matcher* m, const char* filename)
@@ -348,6 +337,7 @@
         std::cerr << "Failed to open " << filename << std::endl;
         return ret;
     }
+
     char line[MAX_LINE_SIZE];
     int linenumber = 1;
     TokenList ts;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/t/03match.t 
new/Spooky-Patterns-XS-1.52/t/03match.t
--- old/Spooky-Patterns-XS-1.51/t/03match.t     2017-12-04 15:10:20.852586153 
+0100
+++ new/Spooky-Patterns-XS-1.52/t/03match.t     2019-07-27 15:08:33.627368132 
+0200
@@ -15,7 +15,7 @@
 $m = Spooky::Patterns::XS::init_matcher();
 $m->add_pattern( 1, Spooky::Patterns::XS::parse_tokens('this is a $SKIP20') );
 use Data::Dumper;
-print Dumper($m->find_matches('t/03match.txt'));
+print Dumper( $m->find_matches('t/03match.txt') );
 cmp_deeply(
     $m->find_matches('t/03match.txt'),
     [ [ 1, 4, 4 ] ],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/t/04license.21.pattern 
new/Spooky-Patterns-XS-1.52/t/04license.21.pattern
--- old/Spooky-Patterns-XS-1.51/t/04license.21.pattern  2017-12-04 
14:39:44.885647226 +0100
+++ new/Spooky-Patterns-XS-1.52/t/04license.21.pattern  2019-07-27 
15:08:33.627368132 +0200
@@ -1 +1,14 @@
-Copyright $SKIP10 ALL RIGHTS RESERVED.
+All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License v2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/t/04license.t 
new/Spooky-Patterns-XS-1.52/t/04license.t
--- old/Spooky-Patterns-XS-1.51/t/04license.t   2017-12-04 14:39:44.885647226 
+0100
+++ new/Spooky-Patterns-XS-1.52/t/04license.t   2019-07-27 15:08:33.631368128 
+0200
@@ -20,16 +20,17 @@
 }
 
 my %exp = (
-    1 => [ [ 1,  1,  165 ] ],
-    2 => [ [ 2,  2,  23 ] ],
-    3 => [ [ 7,  6,  7 ], [ 4, 10, 10 ] ],
-    4 => [ [ 11, 35, 59 ], [ 12, 6, 18 ], [ 4, 2, 2 ], [ 4, 27, 27 ] ],
-    5 => [ [ 13, 1,  502 ] ],
-    6 => [ [ 15, 5, 17 ], [ 4, 2, 2 ] ],
-    7 => [ [ 16, 1, 1 ] ],
-    8  => [ [ 19, 7,   18 ],  [ 18, 5,   5 ],   [ 4, 3,   3 ] ],
+    1  => [ [ 1,  1,   165 ] ],
+    2  => [ [ 2,  2,   23 ] ],
+    3  => [ [ 7,  6,   7 ], [ 4, 10, 10 ] ],
+    4  => [ [ 11, 35,  59 ], [ 12, 6, 18 ], [ 4, 2, 2 ], [ 4, 27, 27 ] ],
+    5  => [ [ 13, 1,   502 ] ],
+    6  => [ [ 15, 5,   17 ], [ 4, 2, 2 ] ],
+    7  => [ [ 16, 1,   1 ] ],
+    8  => [ [ 19, 7,   18 ], [ 18, 5, 5 ], [ 4, 3, 3 ] ],
     9  => [ [ 20, 1,   29 ] ],
-    10 => [ [ 22, 113, 114 ], [ 4,  112, 112 ], [ 3, 109, 109 ] ]
+    10 => [ [ 22, 113, 114 ], [ 4, 112, 112 ], [ 3, 109, 109 ] ],
+    11 => [ [ 25, 4,   15 ], [ 23, 2, 2 ], [ 4, 2, 2 ] ],
 );
 
 for my $fn ( glob("t/04license.*.txt") ) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Spooky-Patterns-XS-1.51/t/07close.t 
new/Spooky-Patterns-XS-1.52/t/07close.t
--- old/Spooky-Patterns-XS-1.51/t/07close.t     2017-12-04 14:39:44.885647226 
+0100
+++ new/Spooky-Patterns-XS-1.52/t/07close.t     2019-07-27 15:08:33.631368128 
+0200
@@ -17,7 +17,7 @@
 
 my @words1 = map { $_->[1] } @$p1;
 my @words2 = map { $_->[1] } @$p2;
-my @diff = sdiff( \@words1, \@words2 );
+my @diff    = sdiff( \@words1, \@words2 );
 my $seen_cs = 0;
 for my $row (@diff) {
     if ( $row->[0] eq 'c' ) {


Reply via email to