diff --git a/400_xowa/src/gplx/xowa/xtns/scribunto/libs/patterns/Scrib_pattern_matcher__luaj.java b/400_xowa/src/gplx/xowa/xtns/scribunto/libs/patterns/Scrib_pattern_matcher__luaj.java index c98f6de23..0c9de1fe7 100644 --- a/400_xowa/src/gplx/xowa/xtns/scribunto/libs/patterns/Scrib_pattern_matcher__luaj.java +++ b/400_xowa/src/gplx/xowa/xtns/scribunto/libs/patterns/Scrib_pattern_matcher__luaj.java @@ -17,33 +17,34 @@ package gplx.xowa.xtns.scribunto.libs.patterns; import gplx.*; import gplx.xowa. import gplx.core.intls.*; import gplx.langs.regxs.*; import org.luaj.vm2.lib.StringLib; -import org.luaj.vm2.lib.Str_find_mgr; -import org.luaj.vm2.lib.Str_find_mgr__regx; +//import org.luaj.vm2.lib.Str_find_mgr; +//import org.luaj.vm2.lib.Str_find_mgr__regx; class Scrib_pattern_matcher__luaj implements Scrib_pattern_matcher { public Regx_match[] Match(Xoa_url url, Unicode_string text_ucs, Scrib_regx_converter regx_converter, String find_str, int bgn_as_codes) { // int src_bgn = bgn_as_codes < 0 ? bgn_as_codes : text_ucs.Pos_codes_to_bytes(bgn_as_codes); - int src_bgn = bgn_as_codes < 0 ? Int_.Base1 : bgn_as_codes + Int_.Base1; - src_bgn = src_bgn >= text_ucs.Len_codes() ? text_ucs.Len_codes() : text_ucs.Pos_codes_to_bytes(src_bgn); - Str_find_mgr__regx mgr = new Str_find_mgr__regx(text_ucs.Src_string(), find_str, src_bgn, false, true); - mgr.Process(); - - // convert to Regx_match - int find_bgn = mgr.Bgn() == -1 ? -1 : text_ucs.Pos_bytes_to_chars(mgr.Bgn()); - int find_end = mgr.End() == -1 ? -1 : text_ucs.Pos_bytes_to_chars(mgr.End()); - boolean found = find_bgn != -1; - if (!found) { - return Regx_match.Ary_empty; - } - int[] captures = mgr.Capture_ints(); - Regx_group[] groups = null; - if (found && captures != null) { - int captures_len = captures.length; - groups = new Regx_group[captures_len / 2]; - for (int i = 0; i < captures_len; i += 2) { - groups[i / 2] = new Regx_group(true, captures[i], captures[i + 1], String_.Mid(text_ucs.Src_string(), text_ucs.Pos_bytes_to_chars(captures[i]), text_ucs.Pos_bytes_to_chars(captures[i + 1]))); - } - } - Regx_match rv = new Regx_match(found, find_bgn, find_end, groups); - return new Regx_match[] {rv}; +// int src_bgn = bgn_as_codes < 0 ? Int_.Base1 : bgn_as_codes + Int_.Base1; +// src_bgn = src_bgn >= text_ucs.Len_codes() ? text_ucs.Len_codes() : text_ucs.Pos_codes_to_bytes(src_bgn); +// Str_find_mgr__regx mgr = new Str_find_mgr__regx(text_ucs.Src_string(), find_str, src_bgn, false, true); +// mgr.Process(); +// +// // convert to Regx_match +// int find_bgn = mgr.Bgn() == -1 ? -1 : text_ucs.Pos_bytes_to_chars(mgr.Bgn()); +// int find_end = mgr.End() == -1 ? -1 : text_ucs.Pos_bytes_to_chars(mgr.End()); +// boolean found = find_bgn != -1; +// if (!found) { +// return Regx_match.Ary_empty; +// } +// int[] captures = mgr.Capture_ints(); +// Regx_group[] groups = null; +// if (found && captures != null) { +// int captures_len = captures.length; +// groups = new Regx_group[captures_len / 2]; +// for (int i = 0; i < captures_len; i += 2) { +// groups[i / 2] = new Regx_group(true, captures[i], captures[i + 1], String_.Mid(text_ucs.Src_string(), text_ucs.Pos_bytes_to_chars(captures[i]), text_ucs.Pos_bytes_to_chars(captures[i + 1]))); +// } +// } +// Regx_match rv = new Regx_match(found, find_bgn, find_end, groups); +// return new Regx_match[] {rv}; + return null; } } diff --git a/res/bin/any/java/luaj/luaj_xowa.jar b/res/bin/any/java/luaj/luaj_xowa.jar index 2e7ac49db..52c113a8a 100644 Binary files a/res/bin/any/java/luaj/luaj_xowa.jar and b/res/bin/any/java/luaj/luaj_xowa.jar differ