1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-08-17 02:09:16 -04:00
parent 34c34f227c
commit df10db140c
421 changed files with 4867 additions and 2429 deletions

View File

@@ -35,7 +35,7 @@ class Ws_tkn implements Expr_tkn {
public int Tid() {return Expr_tkn_.Tid_space;}
public byte[] Val_ary() {return val_ary;} private byte[] val_ary;
public String Val_str() {return val_str;} private String val_str;
public Ws_tkn(byte b) {this.val_ary = new byte[] {b}; this.val_str = Char_.XtoStr(Char_.XbyInt(b));}
public Ws_tkn(byte b) {this.val_ary = new byte[] {b}; this.val_str = Char_.To_str(Char_.XbyInt(b));}
}
class Paren_bgn_tkn implements Expr_tkn, Func_tkn {
public int Tid() {return Expr_tkn_.Tid_paren_lhs;}

View File

@@ -158,7 +158,7 @@ public class Pfunc_expr_shunter {
return val_stack.Len() == 0 ? Null_rslt : val_stack.Pop(); // HACK: for [[List of Premiers of South Australia by time in office]] and {{#expr:\n{{age in days
}
private static Btrie_fast_mgr expression_() {
Btrie_fast_mgr rv = Btrie_fast_mgr.ci_ascii_(); // NOTE:ci.ascii:MW_const.en; math and expressions
Btrie_fast_mgr rv = Btrie_fast_mgr.ci_a7(); // NOTE:ci.ascii:MW_const.en; math and expressions
Trie_add(rv, new Ws_tkn(Byte_ascii.Space));
Trie_add(rv, new Ws_tkn(Byte_ascii.Tab));
Trie_add(rv, new Ws_tkn(Byte_ascii.Nl));
@@ -166,7 +166,7 @@ public class Pfunc_expr_shunter {
Trie_add(rv, Paren_end_tkn._);
Trie_add(rv, new Func_tkn_plus("+"));
Trie_add(rv, new Func_tkn_minus("-"));
Trie_add(rv, new Func_tkn_minus(Char_.XtoStr((char)8722)));
Trie_add(rv, new Func_tkn_minus(Char_.To_str((char)8722)));
Trie_add(rv, new Func_tkn_times("*"));
Trie_add(rv, new Func_tkn_divide("/"));
Trie_add(rv, new Func_tkn_divide("div"));

View File

@@ -108,7 +108,7 @@ public class Pft_fmt_itm_ {
, Hijiri_day_idx = new Pft_fmt_itm_hijiri_day_idx()
, Hijiri_month_name = new Pft_fmt_itm_hijiri_month_name()
;
public static final Btrie_fast_mgr Regy = Btrie_fast_mgr.cs_()
public static final Btrie_fast_mgr Regy = Btrie_fast_mgr.cs()
.Add(Byte_ascii.Ltr_Y , Pft_fmt_itm_.Year_len4) // 2012
.Add(Byte_ascii.Ltr_y , Pft_fmt_itm_.Year_len2) // 12
.Add(Byte_ascii.Ltr_L , Pft_fmt_itm_.Year_isLeap) // 1,0

View File

@@ -39,7 +39,7 @@ public class Pft_func_formatdate extends Pf_func_base {
}
public static Pft_func_formatdate_bldr Date_bldr() {return date_bldr;} private static Pft_func_formatdate_bldr date_bldr = new Pft_func_formatdate_bldr();
private static final Pft_fmt_itm[] Fmt_itms_default = new Pft_fmt_itm[0];
private static final Btrie_fast_mgr trie = Btrie_fast_mgr.cs_()
private static final Btrie_fast_mgr trie = Btrie_fast_mgr.cs()
.Add("dmy" , new Pft_fmt_itm[] {Pft_fmt_itm_.Day_int, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Year_len4})
.Add("mdy" , new Pft_fmt_itm[] {Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Day_int, Pft_fmt_itm_.Byte_comma, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Year_len4})
.Add("ymd" , new Pft_fmt_itm[] {Pft_fmt_itm_.Year_len4, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Month_name, Pft_fmt_itm_.Byte_space, Pft_fmt_itm_.Day_int})

View File

@@ -98,7 +98,7 @@ public class Pfunc_anchorencode extends Pf_func_base { // EX: {{anchorencode:a b
Tkn(src, xnde.Subs_get(i), xnde, i, tmp_bfr);
}
}
private static Btrie_fast_mgr encode_trie = Btrie_fast_mgr.cs_();
private static Btrie_fast_mgr encode_trie = Btrie_fast_mgr.cs();
private static Xop_ctx anchor_ctx; static Xop_tkn_mkr anchor_tkn_mkr;
private static Xop_parser anchor_parser;
}

View File

@@ -39,7 +39,7 @@ public class Pfunc_filepath extends Pf_func_base {
if (tmp_rslt.Repo_idx() == Byte_.Max_value_127) return;
Xof_repo_itm trg_repo = wiki.File_mgr().Repo_mgr().Repos_get_at(tmp_rslt.Repo_idx()).Trg();
xfer_itm.Orig_ttl_and_redirect_(ttl_bry, Bry_.Empty); // redirect is empty b/c Get_page does all redirect lookups
byte[] url = url_bldr.Init_for_trg_html(Xof_repo_itm_.Mode_orig, trg_repo, ttl_bry, xfer_itm.Orig_ttl_md5(), xfer_itm.Orig_ext(), Xof_img_size.Size_null_deprecated, Xof_lnki_time.Null, Xof_lnki_page.Null).Xto_bry();
byte[] url = url_bldr.Init_for_trg_html(Xof_repo_itm_.Mode_orig, trg_repo, ttl_bry, xfer_itm.Orig_ttl_md5(), xfer_itm.Orig_ext(), Xof_img_size.Size__neg1, Xof_lnki_time.Null, Xof_lnki_page.Null).Xto_bry();
bfr.Add(url);
}
private static final Xof_xfer_itm xfer_itm = new Xof_xfer_itm();

View File

@@ -21,7 +21,7 @@ public class Pfunc_rel2abs extends Pf_func_base {
@Override public boolean Func_require_colon_arg() {return true;}
private static final byte[] Ary_dot_slash = Bry_.new_a7("./"), Ary_dot_dot = Bry_.new_a7(".."), Ary_dot_dot_slash = Bry_.new_a7("../");
private static void qry_bgns_with_init() {
qry_bgns_with = Btrie_fast_mgr.cs_();
qry_bgns_with = Btrie_fast_mgr.cs();
qry_bgns_with.Add(Byte_ascii.Slash, Int_obj_ref.new_(Id_slash));
qry_bgns_with.Add(Byte_ascii.Dot, Int_obj_ref.new_(Id_dot));
qry_bgns_with.Add(Ary_dot_slash, Int_obj_ref.new_(Id_dot_slash));