1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Refactor: Clean up Int_ classes

This commit is contained in:
gnosygnu
2017-10-22 08:07:00 -04:00
parent d270cce881
commit 3157551d1d
154 changed files with 609 additions and 577 deletions

View File

@@ -40,7 +40,7 @@ public class Php_srl_parser {
val = Xto_kv_ary(ary);
break;
case Php_srl_itm_.Tid_function:
val = new gplx.xowa.xtns.scribunto.Scrib_lua_proc(Object_.Xto_str_strict_or_null_mark(key), Int_.cast(itm_val.Val())); // NOTE: in most cases, key is a STRING (name of ScribFunction); however, for gsub it is an INT (arg_idx) b/c it is passed as a parameter
val = new gplx.xowa.xtns.scribunto.Scrib_lua_proc(Object_.Xto_str_strict_or_null_mark(key), Int_.Cast(itm_val.Val())); // NOTE: in most cases, key is a STRING (name of ScribFunction); however, for gsub it is an INT (arg_idx) b/c it is passed as a parameter
break;
default:
val = itm_val.Val();

View File

@@ -119,11 +119,11 @@ public class Php_text_itm_parser {
}
if (txt_bgn != -1) {tmp_list.Add(new Php_text_itm_text(txt_bgn, raw_len)); txt_bgn = -1; rslt_val = Rslt_dirty;}
rslt.Val_(rslt_val);
} private static final byte[] CONST_utf_prefix = Bry_.new_a7("\\u00");
} private static final byte[] CONST_utf_prefix = Bry_.new_a7("\\u00");
private void Parse_utf16(List_adp rv, byte[] src, int bgn, int src_len) {
int end = bgn + 4;
if (end >= src_len) throw Err_.new_wo_type("utf16_parse", "src", String_.new_u8(src));
int v = Int_.To_int_hex(src, bgn, end); // +2; skip "\" + "u"
int v = Int_.By_hex_bry(src, bgn, end); // +2; skip "\" + "u"
byte[] literal = gplx.core.intls.Utf16_.Encode_int_to_bry(v);
rv.Add(new Php_text_itm_utf16(bgn, end, literal));
}