[jruby-joni] 148/194: more consistent call scheme

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:36 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 3bd14e578879e179544bb4f4fecc039f64911d8d
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Thu Jan 11 17:11:24 2018 +0100

    more consistent call scheme
---
 src/org/joni/Lexer.java | 28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/src/org/joni/Lexer.java b/src/org/joni/Lexer.java
index 9685c6c..f921474 100644
--- a/src/org/joni/Lexer.java
+++ b/src/org/joni/Lexer.java
@@ -135,7 +135,7 @@ class Lexer extends ScannerSupport {
     }
 
     /* \M-, \C-, \c, or \... */
-    private int fetchEscapedValue() {
+    private void fetchEscapedValue() {
         if (!left()) newSyntaxException(ERR_END_PATTERN_AT_ESCAPE);
         fetch();
 
@@ -148,9 +148,7 @@ class Lexer extends ScannerSupport {
                 if (c != '-') newSyntaxException(ERR_META_CODE_SYNTAX);
                 if (!left()) newSyntaxException(ERR_END_PATTERN_AT_META);
                 fetch();
-                if (c == syntax.metaCharTable.esc) {
-                    c = fetchEscapedValue();
-                }
+                if (c == syntax.metaCharTable.esc) fetchEscapedValue();
                 c = ((c & 0xff) | 0x80);
             } else {
                 fetchEscapedValueBackSlash();
@@ -177,8 +175,6 @@ class Lexer extends ScannerSupport {
         default:
             fetchEscapedValueBackSlash();
         } // switch
-
-        return c; // ???
     }
 
     private void fetchEscapedValueBackSlash() {
@@ -197,9 +193,7 @@ class Lexer extends ScannerSupport {
         if (c == '?') {
             c = 0177;
         } else {
-            if (c == syntax.metaCharTable.esc) {
-                c = fetchEscapedValue();
-            }
+            if (c == syntax.metaCharTable.esc) fetchEscapedValue();
             c &= 0x9f;
         }
     }
@@ -719,9 +713,9 @@ class Lexer extends ScannerSupport {
 
             default:
                 unfetch();
-                int num = fetchEscapedValue();
-                if (token.getC() != num) {
-                    token.setCode(num);
+                fetchEscapedValue();
+                if (token.getC() != c) {
+                    token.setCode(c);
                     token.type = TokenType.CODE_POINT;
                 }
                 break;
@@ -1167,19 +1161,15 @@ class Lexer extends ScannerSupport {
                     if (syntax.op2EscCapitalKKeep()) token.type = TokenType.KEEP;
                 default:
                     unfetch();
-                    int num = fetchEscapedValue();
-
-                    /* set_raw: */
-                    if (token.getC() != num) {
+                    fetchEscapedValue();
+                    if (token.getC() != c) { /* set_raw: */
                         token.type = TokenType.CODE_POINT;
-                        token.setCode(num);
+                        token.setCode(c);
                     } else { /* string */
                         p = token.backP + enc.length(bytes, token.backP, stop);
                     }
                     break;
-
                 } // switch (c)
-
             } else {
                 token.setC(c);
                 token.escaped = false;

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