[jruby-joni] 54/194: enable one char class

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:26 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 06b1e603583ff09a3795765af7a81f861bf1b50a
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Sat Dec 30 00:56:30 2017 +0100

    enable one char class
---
 src/org/joni/Parser.java | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/Parser.java b/src/org/joni/Parser.java
index ca1eeb3..3a92fac 100644
--- a/src/org/joni/Parser.java
+++ b/src/org/joni/Parser.java
@@ -833,7 +833,7 @@ class Parser extends Lexer {
             break;
 
         case CC_CC_OPEN:
-            node = parseCcCcOpen();
+            node = parseCcCcOpen(group);
             break;
 
         case ANYCHAR:
@@ -1269,6 +1269,10 @@ class Parser extends Lexer {
 
     private Node parseExpTkByte(boolean group) {
         StringNode node = new StringNode(bytes, token.backP, p); // tk_byte:
+        return parseStringLoop(node, group);
+    }
+
+    private Node parseStringLoop(StringNode node, boolean group) {
         while (true) {
             fetchToken();
             if (token.type != TokenType.STRING) break;
@@ -1445,10 +1449,18 @@ class Parser extends Lexer {
         return node;
     }
 
-    private Node parseCcCcOpen() {
+    private Node parseCcCcOpen(boolean group) {
         ObjPtr<CClassNode> ascPtr = new ObjPtr<CClassNode>();
         CClassNode cc = parseCharClass(ascPtr);
         Node node = cc;
+
+        int code = cc.isOneChar();
+        if (code != -1) {
+            StringNode sn = new StringNode();
+            sn.catCode(code, enc);
+            return parseStringLoop(sn, group);
+        }
+
         if (isIgnoreCase(env.option)) {
             node = cClassCaseFold(node, cc, ascPtr.p);
         }

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