Skip to content

Instantly share code, notes, and snippets.

@lopex
Created July 19, 2019 16:52
Show Gist options
  • Save lopex/be0d7fddf2eabb62ee371f9beb9ca47b to your computer and use it in GitHub Desktop.
Save lopex/be0d7fddf2eabb62ee371f9beb9ca47b to your computer and use it in GitHub Desktop.
$ git df
diff --git a/src/org/joni/Config.java b/src/org/joni/Config.java
index d2dcab2..571c805 100644
--- a/src/org/joni/Config.java
+++ b/src/org/joni/Config.java
@@ -74,7 +74,7 @@ public interface Config extends org.jcodings.Config {
final PrintStream log = System.out;
final PrintStream err = System.err;
- final boolean DEBUG_ALL = false;
+ final boolean DEBUG_ALL = true;
final boolean DEBUG = DEBUG_ALL;
final boolean DEBUG_PARSE_TREE = DEBUG_ALL;
diff --git a/src/org/joni/Matcher.java b/src/org/joni/Matcher.java
index 13939cf..0d8c6b8 100644
--- a/src/org/joni/Matcher.java
+++ b/src/org/joni/Matcher.java
@@ -36,8 +36,8 @@ public abstract class Matcher extends IntHolder {
protected final Encoding enc;
protected final byte[]bytes;
- protected final int str;
- protected final int end;
+ protected int str;
+ protected int end;
protected int msaStart;
protected int msaOptions;
@@ -296,19 +296,21 @@ public abstract class Matcher extends IntHolder {
return false;
}
- public final int search(int start, int range, int option) {
+ public final int search(int str, int end, int start, int range, int option) {
try {
- return searchCommon(start, range, option, false);
+ return searchCommon(str, end, start, range, option, false);
} catch (InterruptedException ex) {
return INTERRUPTED;
}
}
- public final int searchInterruptible(int start, int range, int option) throws InterruptedException {
- return searchCommon(start, range, option, true);
+ public final int searchInterruptible(int str, int end, int start, int range, int option) throws InterruptedException {
+ return searchCommon(str, end, start, range, option, true);
}
- private final int searchCommon(int start, int range, int option, boolean interrupt) throws InterruptedException {
+ public final int searchCommon(int str, int end, int start, int range, int option, boolean interrupt) throws InterruptedException {
+ this.str = str;
+ this.end = end;
int s, prev;
int origStart = start;
int origRange = range;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment