[jruby-joni] 64/194: introduce new test Syntax with asci range option tuned off

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:27 UTC 2018


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 92a05debc9112846b54fb2f7e2eef75b626c3356
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sat Dec 30 15:09:24 2017 +0100

    introduce new test Syntax with asci range option tuned off
---
 src/org/joni/Syntax.java                     | 11 +++++++++--
 src/org/joni/constants/SyntaxProperties.java |  1 +
 test/org/joni/test/TestA.java                |  2 +-
 test/org/joni/test/TestC.java                |  2 +-
 test/org/joni/test/TestCornerCases.java      |  2 +-
 test/org/joni/test/TestCrnl.java             |  2 +-
 test/org/joni/test/TestNSU8.java             |  2 +-
 test/org/joni/test/TestU.java                |  2 +-
 test/org/joni/test/TestU8.java               |  2 +-
 9 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/src/org/joni/Syntax.java b/src/org/joni/Syntax.java
index 2e50738..42146a6 100644
--- a/src/org/joni/Syntax.java
+++ b/src/org/joni/Syntax.java
@@ -399,6 +399,10 @@ public final class Syntax implements SyntaxProperties{
         return isBehavior(WARN_CC_OP_NOT_ESCAPED);
     }
 
+    public boolean warnCCDup() {
+        return isBehavior(WARN_CC_DUP);
+    }
+
     public boolean warnReduntantNestedRepeat() {
         return isBehavior(WARN_REDUNDANT_NESTED_REPEAT);
     }
@@ -432,9 +436,10 @@ public final class Syntax implements SyntaxProperties{
         ALLOW_MULTIPLEX_DEFINITION_NAME |
         FIXED_INTERVAL_IS_GREEDY_ONLY |
         WARN_CC_OP_NOT_ESCAPED |
+        WARN_CC_DUP |
         WARN_REDUNDANT_NESTED_REPEAT ),
 
-        Option.NONE,
+        (Option.ASCII_RANGE | Option.POSIX_BRACKET_ALL_RANGE | Option.WORD_BOUND_ALL_RANGE),
 
         new MetaCharTable(
             '\\',                           /* esc */
@@ -448,6 +453,8 @@ public final class Syntax implements SyntaxProperties{
 
     public static final Syntax DEFAULT = RUBY;
 
+    public static final Syntax TEST = new Syntax(RUBY.op, RUBY.op2, RUBY.behavior, RUBY.options & ~ Option.ASCII_RANGE, RUBY.metaCharTable);
+
     public static final Syntax ASIS = new Syntax(
         0,
 
@@ -592,7 +599,7 @@ public final class Syntax implements SyntaxProperties{
 
         ( GNU_REGEX_BV | DIFFERENT_LEN_ALT_LOOK_BEHIND ),
 
-        Option.SINGLELINE,
+        (Option.SINGLELINE | Option.WORD_BOUND_ALL_RANGE | Option.WORD_BOUND_ALL_RANGE),
 
         new MetaCharTable(
             '\\',                          /* esc */
diff --git a/src/org/joni/constants/SyntaxProperties.java b/src/org/joni/constants/SyntaxProperties.java
index a9be9f9..5ed9e00 100644
--- a/src/org/joni/constants/SyntaxProperties.java
+++ b/src/org/joni/constants/SyntaxProperties.java
@@ -110,6 +110,7 @@ public interface SyntaxProperties {
     /* syntax (behavior); warning */
     final int WARN_CC_OP_NOT_ESCAPED          = (1<<24); /* [,-,] */
     final int WARN_REDUNDANT_NESTED_REPEAT    = (1<<25); /* (?:a*);+ */
+    final int WARN_CC_DUP                     = (1<<26); /* [aa] */
 
     final int POSIX_COMMON_OP =
                             OP_DOT_ANYCHAR | OP_POSIX_BRACKET |
diff --git a/test/org/joni/test/TestA.java b/test/org/joni/test/TestA.java
index 383062a..ea10698 100644
--- a/test/org/joni/test/TestA.java
+++ b/test/org/joni/test/TestA.java
@@ -42,7 +42,7 @@ public class TestA extends Test {
 
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
 
     @Override
diff --git a/test/org/joni/test/TestC.java b/test/org/joni/test/TestC.java
index 7f42b6c..33e5946 100755
--- a/test/org/joni/test/TestC.java
+++ b/test/org/joni/test/TestC.java
@@ -39,7 +39,7 @@ public class TestC extends Test {
     }
 	@Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
 	@Override
     public void test() throws Exception {
diff --git a/test/org/joni/test/TestCornerCases.java b/test/org/joni/test/TestCornerCases.java
index 6e1464d..6b1c850 100755
--- a/test/org/joni/test/TestCornerCases.java
+++ b/test/org/joni/test/TestCornerCases.java
@@ -42,7 +42,7 @@ public class TestCornerCases extends Test {
     }
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
     @Override
     public void test() throws Exception {
diff --git a/test/org/joni/test/TestCrnl.java b/test/org/joni/test/TestCrnl.java
index 8abead7..3268c98 100755
--- a/test/org/joni/test/TestCrnl.java
+++ b/test/org/joni/test/TestCrnl.java
@@ -42,7 +42,7 @@ public class TestCrnl extends Test {
     }
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
     @Override
     public void test() throws Exception {
diff --git a/test/org/joni/test/TestNSU8.java b/test/org/joni/test/TestNSU8.java
index d1f2647..3503d38 100755
--- a/test/org/joni/test/TestNSU8.java
+++ b/test/org/joni/test/TestNSU8.java
@@ -39,7 +39,7 @@ public class TestNSU8 extends Test {
     }
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
     @Override
     public void test() throws Exception {
diff --git a/test/org/joni/test/TestU.java b/test/org/joni/test/TestU.java
index 5ceb829..f2e8b15 100755
--- a/test/org/joni/test/TestU.java
+++ b/test/org/joni/test/TestU.java
@@ -39,7 +39,7 @@ public class TestU extends Test {
     }
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
 
     private int ulen(byte[]bytes) {
diff --git a/test/org/joni/test/TestU8.java b/test/org/joni/test/TestU8.java
index 3a03241..5f28761 100755
--- a/test/org/joni/test/TestU8.java
+++ b/test/org/joni/test/TestU8.java
@@ -41,7 +41,7 @@ public class TestU8 extends Test {
     }
     @Override
     public Syntax syntax() {
-        return Syntax.DEFAULT;
+        return Syntax.TEST;
     }
     @Override
     public void test() throws Exception {

-- 
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