[jruby-joni] 203/279: Allow \b in look behind

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:27:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit 9c7cb2646638768642d4190af6c3ea9e254e4b0b
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Wed May 28 18:44:30 2014 +0200

    Allow \b in look behind
---
 src/org/joni/constants/AnchorType.java | 27 +++++++++++++++++----------
 test/org/joni/test/TestA.java          |  3 +++
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/src/org/joni/constants/AnchorType.java b/src/org/joni/constants/AnchorType.java
index 5d7336d..f297577 100644
--- a/src/org/joni/constants/AnchorType.java
+++ b/src/org/joni/constants/AnchorType.java
@@ -42,17 +42,24 @@ public interface AnchorType {
     final int ANYCHAR_STAR_MASK = (ANYCHAR_STAR | ANYCHAR_STAR_ML);
     final int END_BUF_MASK      = (END_BUF | SEMI_END_BUF);
 
-    final int ALLOWED_IN_LB =     ( LOOK_BEHIND |
-                                    BEGIN_LINE |
-                                    END_LINE |
-                                    BEGIN_BUF |
-                                    BEGIN_POSITION );
+    final int KEEP              = (1<<16);
 
-    final int ALLOWED_IN_LB_NOT = ( LOOK_BEHIND |
-                                    LOOK_BEHIND_NOT |
-                                    BEGIN_LINE |
-                                    END_LINE |
+    final int ALLOWED_IN_LB =     ( END_LINE |
                                     BEGIN_BUF |
-                                    BEGIN_POSITION );
+                                    BEGIN_POSITION |
+                                    KEEP |
+                                    WORD_BOUND |
+                                    NOT_WORD_BOUND |
+                                    WORD_BEGIN |
+                                    WORD_END );
+
 
+    final int ALLOWED_IN_LB_NOT = ( END_LINE |
+                                    BEGIN_BUF |
+                                    BEGIN_POSITION |
+                                    KEEP |
+                                    WORD_BOUND |
+                                    NOT_WORD_BOUND |
+                                    WORD_BEGIN |
+                                    WORD_END );
 }
diff --git a/test/org/joni/test/TestA.java b/test/org/joni/test/TestA.java
index aee59ae..d9403da 100644
--- a/test/org/joni/test/TestA.java
+++ b/test/org/joni/test/TestA.java
@@ -497,6 +497,9 @@ public class TestA extends Test {
         x2s("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAA", 0, 35, Option.IGNORECASE);
 
         x2s("(?mix)", "", 0, 0);
+
+        x2s("(?<=\\babc)d", " abcd", 4, 5);
+        x2s("(?<=\\Babc)d", "aabcd", 4, 5);
     }
 
     public static void main(String[] args) throws Throwable{

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list