[jruby-joni] 112/279: Fix char class.
Hideki Yamane
henrich at moszumanska.debian.org
Mon Nov 16 11:27:08 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 aec8dafd7b3c9f17a8e291cd6f27e23967b080b6
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date: Sun Feb 19 16:44:27 2012 +0100
Fix char class.
---
src/org/joni/Parser.java | 2 +-
src/org/joni/ast/CClassNode.java | 7 ++++++-
test/org/joni/test/TestA.java | 3 +++
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/org/joni/Parser.java b/src/org/joni/Parser.java
index 3cb7608..35db08c 100644
--- a/src/org/joni/Parser.java
+++ b/src/org/joni/Parser.java
@@ -358,7 +358,7 @@ class Parser extends Lexer {
if (workCC == null) workCC = new CClassNode();
cc = workCC;
}
- // initialize_cclass(cc); // clear it ??
+ cc.clear();
break;
case EOT:
diff --git a/src/org/joni/ast/CClassNode.java b/src/org/joni/ast/CClassNode.java
index 86c82fb..7927023 100644
--- a/src/org/joni/ast/CClassNode.java
+++ b/src/org/joni/ast/CClassNode.java
@@ -22,7 +22,6 @@ package org.joni.ast;
import org.jcodings.CodeRange;
import org.jcodings.Encoding;
import org.jcodings.IntHolder;
-import org.jcodings.ascii.AsciiTables;
import org.jcodings.constants.CharacterType;
import org.jcodings.exception.EncodingException;
import org.jcodings.specific.ASCIIEncoding;
@@ -58,6 +57,12 @@ public final class CClassNode extends Node {
this.enc = enc;
}
+ public void clear() {
+ bs.clear();
+ flags = 0;
+ mbuf = null;
+ }
+
// node_new_cclass_by_codepoint_range, only used by shared Char Classes
public CClassNode(boolean not, int sbOut, int[]ranges) {
if (not) setNot();
diff --git a/test/org/joni/test/TestA.java b/test/org/joni/test/TestA.java
index b5170c7..0a317fa 100644
--- a/test/org/joni/test/TestA.java
+++ b/test/org/joni/test/TestA.java
@@ -488,6 +488,9 @@ public class TestA extends Test {
x2s("(?<!b|aa)", "Aac", 0, 0, Option.IGNORECASE);
x2s("(?<=b|aa)c", "Aac", 2, 3, Option.IGNORECASE);
x2s("(?<=b|aa)", "Aac", 2, 2, Option.IGNORECASE);
+
+ ns("\\A[a-f&&[^b-c]&&[^e]]\\z", "e");
+ ns("[[^a]&&e&&[^e]]", "e");
}
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