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

@@ -25,12 +25,12 @@ public class Xop_tvar_lxr implements Xop_lxr {
public int Make_tkn(Xop_ctx ctx, Xop_tkn_mkr tkn_mkr, Xop_root_tkn root, byte[] src, int src_len, int bgn_pos, int cur_pos) {
int rhs_end = Bry_find_.Find_fwd(src, Byte_ascii.Gt, cur_pos); if (rhs_end == Bry_find_.Not_found) return ctx.Lxr_make_txt_(cur_pos);
int lhs_bgn = Bry_find_.Find_fwd(src, Close_nde , rhs_end); if (lhs_bgn == Bry_find_.Not_found) return ctx.Lxr_make_txt_(cur_pos);
byte[] body = Bry_.Mid(src, rhs_end + Int_.Const_position_after_char, lhs_bgn);
byte[] body = Bry_.Mid(src, rhs_end + Int_.Offset_1, lhs_bgn);
Xop_ctx sub_ctx = Xop_ctx.New__sub__reuse_page(ctx);
Xop_root_tkn sub_root = tkn_mkr.Root(body);
body = ctx.Wiki().Parser_mgr().Main().Expand_tmpl(sub_root, sub_ctx, tkn_mkr, body); // NOTE: must parse inner text for templates; EX:<tvar|a>{{B}}</>; PAGE:mw:Download; DATE:2014-04-27
int end_pos = lhs_bgn + Close_nde.length;
ctx.Subs_add(root, tkn_mkr.Tvar(bgn_pos, end_pos, cur_pos, rhs_end, rhs_end + Int_.Const_position_after_char, lhs_bgn, body));
ctx.Subs_add(root, tkn_mkr.Tvar(bgn_pos, end_pos, cur_pos, rhs_end, rhs_end + Int_.Offset_1, lhs_bgn, body));
return end_pos;
}
public static final Xop_tvar_lxr Instance = new Xop_tvar_lxr(); Xop_tvar_lxr() {}