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-03 00:10:03 -04:00
parent 9d63f03b3d
commit 34c34f227c
514 changed files with 4972 additions and 3910 deletions

View File

@@ -109,7 +109,7 @@ public class Pfunc_iferror extends Pf_func_base {
private static final Btrie_slim_mgr trie = trie_();
static final byte State_null = 0, State_nde = 1, State_class = 2, State_error = 3, State_close = 4;
private static Btrie_slim_mgr trie_() {
Btrie_slim_mgr rv = Btrie_slim_mgr.ci_ascii_(); // NOTE:ci.ascii:MW_const.en
Btrie_slim_mgr rv = Btrie_slim_mgr.ci_a7(); // NOTE:ci.ascii:MW_const.en
trie_init(rv, State_nde , "<strong");
trie_init(rv, State_nde , "<span");
trie_init(rv, State_nde , "<p");

View File

@@ -19,7 +19,7 @@ package gplx.xowa.xtns.pfuncs.ifs; import gplx.*; import gplx.xowa.*; import gpl
import gplx.xowa.wmfs.apis.*; import gplx.xowa.wikis.data.tbls.*;
public class Pfunc_ifexist_mgr {
private Xowd_page_itm db_page = Xowd_page_itm.new_tmp();
private Hash_adp regy = Hash_adp_bry.cs_();
private Hash_adp regy = Hash_adp_bry.cs();
public void Clear() {regy.Clear();}
public boolean Exists(Xowe_wiki wiki, byte[] raw_bry) {
if (Bry_.Len_eq_0(raw_bry)) return false; // return early; NOTE: {{autolink}} can pass in "" (see test)

View File

@@ -23,14 +23,14 @@ public class Pfunc_ifexpr extends Pf_func_base {
int self_args_len = self.Args_len();
byte[] val_dat_ary = Eval_argx(ctx, src, caller, self);
if (val_dat_ary == null) return;
DecimalAdp result = shunter.Evaluate(ctx, val_dat_ary);
Decimal_adp result = shunter.Evaluate(ctx, val_dat_ary);
boolean is_nan = result == Pfunc_expr_shunter.Null_rslt;
if (is_nan && shunter.Err().Len() > 0) {
bb.Add_bfr_and_preserve(shunter.Err());
shunter.Err().Clear();
}
else {
if (is_nan || result.Xto_int() == 0)
if (is_nan || result.To_int() == 0)
bb.Add(Pf_func_.Eval_arg_or_empty(ctx, src, caller, self, self_args_len, 1));
else
bb.Add(Pf_func_.Eval_arg_or_empty(ctx, src, caller, self, self_args_len, 0));