mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.2.1'
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import gplx.xowa.parsers.xndes.*; import gplx.xowa.parsers.miscs.*;
|
||||
public class Arg_bldr {
|
||||
public class Arg_bldr { // TS
|
||||
public boolean Bld(Xop_ctx ctx, Xop_tkn_mkr tkn_mkr, Xop_arg_wkr wkr, int wkr_typ, Xop_root_tkn root, Xop_tkn_itm tkn, int bgn_pos, int cur_pos, int loop_bgn, int loop_end, byte[] src) {
|
||||
boolean ws_bgn_chk = true, colon_chk = false, itm_is_static = true, key_exists = false; int ws_bgn_idx = -1, ws_end_idx = -1, cur_itm_subs_len = 0, cur_nde_idx = -1; Arg_nde_tkn cur_nde = null; Arg_itm_tkn cur_itm = null;
|
||||
int brack_count = 0;
|
||||
@@ -190,7 +190,7 @@ public class Arg_bldr {
|
||||
// itm.Dat_ary_(dat_end == dat_bgn ? Bry_.Empty : Bry_.Mid(src, dat_bgn, dat_end));
|
||||
itm.Itm_static_(itm_is_static);
|
||||
}
|
||||
public static final Arg_bldr Instance = new Arg_bldr(); Arg_bldr() {}
|
||||
public static final Arg_bldr Instance = new Arg_bldr(); Arg_bldr() {}
|
||||
}
|
||||
/*
|
||||
NOTE_1:mark tkn ignore unless wkr is prm;
|
||||
|
||||
@@ -56,13 +56,11 @@ public class Xop_subst_tst {
|
||||
@Test public void Urlencode_invalid_ttl() { // PURPOSE: handle invalid ttl inside does-template-exist; EX: en.d:peace; DATE:2014-03-31
|
||||
fxt.Init_defn_clear();
|
||||
fxt.Init_defn_add("test", "{{safesubst:urlencode:{{safesubst:Template:{{{1}}}}}}}");
|
||||
fxt.Init_log_(Xop_ttl_log.Invalid_char);
|
||||
fxt.Test_parse_page_tmpl_str("{{test|[xyz]}}", "%7B%7Bsafesubst%3ATemplate%3A%5Bxyz%5D%7D%7D"); // url-encoded version of {{safesubst:Template:xyz}}
|
||||
}
|
||||
@Test public void Urlencode_template_ttl() { // PURPOSE: handle template ttl inside does-template-exist; based on above; DATE:2014-03-31
|
||||
fxt.Init_defn_clear();
|
||||
fxt.Init_defn_add("test", "{{safesubst:urlencode:{{Template:{{{1}}}}}}}");
|
||||
fxt.Init_log_(Xop_ttl_log.Invalid_char);
|
||||
fxt.Test_parse_page_tmpl_str("{{test|Template:[xyz]}}", "%7B%7BTemplate%3ATemplate%3A%5Bxyz%5D%7D%7D"); // url-encoded version of {{safesubst:Template:xyz}}
|
||||
}
|
||||
@Test public void Nowiki() { // PURPOSE: stack overflow; PAGE:Близкие_друзья_(Сезон_2) DATE:2014-10-21
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Xot_defn_tmpl implements Xot_defn {
|
||||
}
|
||||
return bfr.To_bry_and_rls();
|
||||
}
|
||||
private static final byte[] Bry_onlyinclude_bgn = Bry_.new_a7("<onlyinclude>"), Bry_onlyinclude_end = Bry_.new_a7("</onlyinclude>");
|
||||
private static final byte[] Bry_onlyinclude_bgn = Bry_.new_a7("<onlyinclude>"), Bry_onlyinclude_end = Bry_.new_a7("</onlyinclude>");
|
||||
private static int Bry_onlyinclude_bgn_len = Bry_onlyinclude_bgn.length, Bry_onlyinclude_end_len = Bry_onlyinclude_end.length;
|
||||
public void Rls() {
|
||||
if (root != null) root.Clear();
|
||||
@@ -62,33 +62,35 @@ public class Xot_defn_tmpl implements Xot_defn {
|
||||
}
|
||||
public void Parse_tmpl(Xop_ctx ctx) {ctx.Wiki().Parser_mgr().Main().Parse_text_to_defn(this, ctx, ctx.Tkn_mkr(), ns, name, data_raw);} boolean onlyinclude_parsed = false;
|
||||
public boolean Tmpl_evaluate(Xop_ctx ctx, Xot_invk caller, Bry_bfr bfr) {
|
||||
if (root == null) Parse_tmpl(ctx);
|
||||
Xoae_page page = ctx.Page();
|
||||
if (!page.Tmpl_stack_add(full_name)) {
|
||||
bfr.Add_str_a7("<!-- template loop detected:" + gplx.langs.htmls.Gfh_utl.Escape_html_as_str(String_.new_u8(name)) + " -->");
|
||||
Xoa_app_.Usr_dlg().Log_many("", "", "template loop detected: url=~{0} name=~{1}", ctx.Page().Url().To_str(), name);
|
||||
return false;
|
||||
}
|
||||
boolean rv = true;
|
||||
if (onlyInclude_exists) {
|
||||
Xowe_wiki wiki = ctx.Wiki();
|
||||
if (!onlyinclude_parsed) {
|
||||
onlyinclude_parsed = true;
|
||||
byte[] new_data = Extract_onlyinclude(data_raw, wiki.Utl__bfr_mkr());
|
||||
Xop_ctx new_ctx = Xop_ctx.new_sub_(wiki);
|
||||
Xot_defn_tmpl tmpl = wiki.Parser_mgr().Main().Parse_text_to_defn_obj(new_ctx, new_ctx.Tkn_mkr(), wiki.Ns_mgr().Ns_template(), Bry_.Empty, new_data);
|
||||
tmpl.Root().Tmpl_compile(new_ctx, new_data, Xot_compile_data.Null);
|
||||
data_raw = new_data;
|
||||
root = tmpl.Root();
|
||||
// synchronized (this) { // LOCK:DELETE; DATE:2016-07-06
|
||||
if (root == null) Parse_tmpl(ctx);
|
||||
Xoae_page page = ctx.Page();
|
||||
if (!page.Tmpl_stack_add(full_name)) {
|
||||
bfr.Add_str_a7("<!-- template loop detected:" + gplx.langs.htmls.Gfh_utl.Escape_html_as_str(String_.new_u8(name)) + " -->");
|
||||
Xoa_app_.Usr_dlg().Log_many("", "", "template loop detected: url=~{0} name=~{1}", ctx.Page().Url().To_str(), name);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int subs_len = root.Subs_len();
|
||||
for (int i = 0; i < subs_len; i++) {
|
||||
boolean result = root.Subs_get(i).Tmpl_evaluate(ctx, data_raw, caller, bfr);
|
||||
if (!result) rv = false;
|
||||
}
|
||||
page.Tmpl_stack_del();
|
||||
return rv;
|
||||
boolean rv = true;
|
||||
if (onlyInclude_exists) {
|
||||
Xowe_wiki wiki = ctx.Wiki();
|
||||
if (!onlyinclude_parsed) {
|
||||
onlyinclude_parsed = true;
|
||||
byte[] new_data = Extract_onlyinclude(data_raw, wiki.Utl__bfr_mkr());
|
||||
Xop_ctx new_ctx = Xop_ctx.new_sub_(wiki, ctx);
|
||||
Xot_defn_tmpl tmpl = wiki.Parser_mgr().Main().Parse_text_to_defn_obj(new_ctx, new_ctx.Tkn_mkr(), wiki.Ns_mgr().Ns_template(), Bry_.Empty, new_data);
|
||||
tmpl.Root().Tmpl_compile(new_ctx, new_data, Xot_compile_data.Null);
|
||||
data_raw = new_data;
|
||||
root = tmpl.Root();
|
||||
}
|
||||
}
|
||||
int subs_len = root.Subs_len();
|
||||
for (int i = 0; i < subs_len; i++) {
|
||||
boolean result = root.Subs_get(i).Tmpl_evaluate(ctx, data_raw, caller, bfr);
|
||||
if (!result) rv = false;
|
||||
}
|
||||
page.Tmpl_stack_del();
|
||||
return rv;
|
||||
// }
|
||||
}
|
||||
public Xot_defn Clone(int id, byte[] name) {throw Err_.new_unimplemented();}
|
||||
boolean onlyInclude_exists;
|
||||
|
||||
@@ -38,7 +38,7 @@ class Xot_defn_trace_fxt {
|
||||
Xop_ctx ctx = fxt.Ctx();
|
||||
ctx.Defn_trace().Clear();
|
||||
byte[] src = Bry_.new_u8(raw);
|
||||
ctx.Page().Ttl_(Xoa_ttl.parse(fxt.Wiki(), Bry_.new_a7("test")));
|
||||
ctx.Page().Ttl_(Xoa_ttl.Parse(fxt.Wiki(), Bry_.new_a7("test")));
|
||||
Xop_root_tkn root = ctx.Tkn_mkr().Root(src);
|
||||
fxt.Parser().Parse_page_all_clear(root, ctx, ctx.Tkn_mkr(), src);
|
||||
ctx.Defn_trace().Print(src, tmp);
|
||||
|
||||
@@ -48,6 +48,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
val.Subs_get(j).Tmpl_compile(ctx, src, prep_data);
|
||||
}
|
||||
}
|
||||
private static final Xol_func_itm finder = new Xol_func_itm();
|
||||
@Override public boolean Tmpl_evaluate(Xop_ctx ctx, byte[] src, Xot_invk caller, Bry_bfr bfr) { // this="{{t|{{{0}}}}}" caller="{{t|1}}"
|
||||
boolean rv = false;
|
||||
Xot_defn defn = tmpl_defn; Xowe_wiki wiki = ctx.Wiki(); Xol_lang_itm lang = wiki.Lang();
|
||||
@@ -100,10 +101,17 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
if (ns_eval != null && !template_prefix_found) // do not transclude ns if Template prefix seen earlier; EX: {{Template:Wikipedia:A}} should not transclude "Wikipedia:A"; DATE:2013-04-03
|
||||
return SubEval(ctx, wiki, bfr, name_ary, caller, src);
|
||||
|
||||
Xol_func_itm finder = lang.Func_regy().Find_defn(name_ary, name_bgn, name_ary_len);
|
||||
defn = finder.Func();
|
||||
int finder_tid, finder_colon_pos, finder_subst_end;
|
||||
synchronized (finder) {
|
||||
lang.Func_regy().Find_defn(finder, name_ary, name_bgn, name_ary_len);
|
||||
defn = finder.Func();
|
||||
finder_tid = finder.Tid();
|
||||
finder_colon_pos = finder.Colon_pos();
|
||||
finder_subst_end = finder.Subst_end();
|
||||
}
|
||||
|
||||
int colon_pos = -1;
|
||||
switch (finder.Tid()) {
|
||||
switch (finder_tid) {
|
||||
case Xot_defn_.Tid_subst: // subst is added verbatim; EX: {{subst:!}} -> {{subst:!}}; logic below is to handle printing of arg which could be standardized if src[] was available for tmpl
|
||||
bfr.Add(Xop_curly_bgn_lxr.Hook).Add(name_ary);
|
||||
for (int i = 0; i < args_len; i++) {
|
||||
@@ -115,10 +123,10 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
bfr.Add(Xop_curly_end_lxr.Hook);
|
||||
return true; // NOTE: nothing else to do; return
|
||||
case Xot_defn_.Tid_safesubst:
|
||||
name_ary = Bry_.Mid(name_ary, finder.Subst_end(), name_ary_len); // chop off "safesubst:"
|
||||
name_ary = Bry_.Mid(name_ary, finder_subst_end, name_ary_len); // chop off "safesubst:"
|
||||
name_ary_len = name_ary.length;
|
||||
if (defn != Xot_defn_.Null) { // func found
|
||||
if (finder.Colon_pos() != -1) colon_pos = finder.Func().Name().length; // set colon_pos; SEE NOTE_1
|
||||
if (finder_colon_pos != -1) colon_pos = defn.Name().length; // set colon_pos; SEE NOTE_1
|
||||
}
|
||||
subst_found = true;
|
||||
break;
|
||||
@@ -129,7 +137,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
defn = Xot_defn_.Null;
|
||||
}
|
||||
else {
|
||||
colon_pos = finder.Colon_pos();
|
||||
colon_pos = finder_colon_pos;
|
||||
}
|
||||
break;
|
||||
case Xot_defn_.Tid_raw:
|
||||
@@ -137,7 +145,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
int raw_colon_pos = Bry_find_.Find_fwd(name_ary, Byte_ascii.Colon);
|
||||
if (raw_colon_pos == Bry_find_.Not_found) {} // colon missing; EX: {{raw}}; noop and assume template name; DATE:2014-02-11
|
||||
else { // colon present;
|
||||
name_ary = Bry_.Mid(name_ary, finder.Subst_end() + 1, name_ary_len); // chop off "raw"; +1 is for ":"; note that +1 is in bounds b/c raw_colon was found
|
||||
name_ary = Bry_.Mid(name_ary, finder_subst_end + 1, name_ary_len); // chop off "raw"; +1 is for ":"; note that +1 is in bounds b/c raw_colon was found
|
||||
name_ary_len = name_ary.length;
|
||||
Object ns_eval2 = wiki.Ns_mgr().Names_get_w_colon(name_ary, 0, name_ary_len); // match {{:Portal or {{:Wikipedia
|
||||
if (ns_eval2 != null) {
|
||||
@@ -147,7 +155,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
return SubEval(ctx, wiki, bfr, name_ary, caller, src);
|
||||
}
|
||||
}
|
||||
switch (finder.Tid()) {
|
||||
switch (finder_tid) {
|
||||
case Xot_defn_.Tid_msg:
|
||||
defn = Xot_defn_.Null; // null out defn to force template load below; DATE:2014-07-10
|
||||
break;
|
||||
@@ -174,7 +182,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
defn = wiki.Cache_mgr().Defn_cache().Get_by_key(name_ary);
|
||||
if (defn == null) {
|
||||
if (name_ary_len != 0 ) { // name_ary_len != 0 for direct template inclusions; PAGE:en.w:Human evolution and {{:Human evolution/Species chart}}; && ctx.Tmpl_whitelist().Has(name_ary)
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.Add(wiki.Ns_mgr().Ns_template().Name_db_w_colon(), name_ary));
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, Bry_.Add(wiki.Ns_mgr().Ns_template().Name_db_w_colon(), name_ary));
|
||||
if (ttl == null) { // ttl is not valid; just output orig; REF.MW:Parser.php|braceSubstitution|if ( !$found ) $text = $frame->virtualBracketedImplode( '{{', '|', '}}', $titleWithSpaces, $args );
|
||||
if (subst_found || template_prefix_found) { // if "subst:" or "Template:" found, use orig name; DATE:2014-03-31
|
||||
bfr.Add(Xop_curly_bgn_lxr.Hook).Add(name_ary_orig).Add(Xop_curly_end_lxr.Hook);
|
||||
@@ -207,7 +215,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
Xowd_page_itm page = lang.Vnt_mgr().Convert_mgr().Convert_ttl(wiki, wiki.Ns_mgr().Ns_template(), name_ary);
|
||||
if (page != Xowd_page_itm.Null) {
|
||||
name_ary = page.Ttl_page_db();
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.Add(wiki.Ns_mgr().Ns_template().Name_db_w_colon(), name_ary));
|
||||
Xoa_ttl ttl = Xoa_ttl.Parse(wiki, Bry_.Add(wiki.Ns_mgr().Ns_template().Name_db_w_colon(), name_ary));
|
||||
if (ttl == null) { // ttl is not valid; just output orig; REF.MW:Parser.php|braceSubstitution|if ( !$found ) $text = $frame->virtualBracketedImplode( '{{', '|', '}}', $titleWithSpaces, $args );
|
||||
bfr.Add(Xop_curly_bgn_lxr.Hook).Add(name_ary).Add(Xop_curly_end_lxr.Hook);
|
||||
return false;
|
||||
@@ -344,7 +352,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
}
|
||||
}
|
||||
private boolean Transclude(Xop_ctx ctx, Xowe_wiki wiki, Bry_bfr bfr, boolean template_prefix_found, byte[] name_ary, Xot_invk caller, byte[] src) {
|
||||
Xoa_ttl page_ttl = Xoa_ttl.parse(wiki, name_ary); if (page_ttl == null) return false; // ttl not valid; EX: {{:[[abc]]}}
|
||||
Xoa_ttl page_ttl = Xoa_ttl.Parse(wiki, name_ary); if (page_ttl == null) return false; // ttl not valid; EX: {{:[[abc]]}}
|
||||
byte[] transclude_src = null;
|
||||
if (page_ttl.Ns().Id_is_tmpl()) { // ttl is template; check tmpl_regy first before going to data_mgr
|
||||
Xot_defn_tmpl tmpl = (Xot_defn_tmpl)wiki.Cache_mgr().Defn_cache().Get_by_key(page_ttl.Page_db());
|
||||
@@ -407,7 +415,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
bfr.Add(name_ary).Add(Xop_tkn_.Lnki_end);
|
||||
}
|
||||
private boolean SubEval(Xop_ctx ctx, Xowe_wiki wiki, Bry_bfr bfr, byte[] name_ary, Xot_invk caller, byte[] src_for_tkn) {
|
||||
Xoa_ttl page_ttl = Xoa_ttl.parse(wiki, name_ary); if (page_ttl == null) return false; // ttl not valid; EX: {{:[[abc]]}}
|
||||
Xoa_ttl page_ttl = Xoa_ttl.Parse(wiki, name_ary); if (page_ttl == null) return false; // ttl not valid; EX: {{:[[abc]]}}
|
||||
Xot_defn_tmpl transclude_tmpl = null;
|
||||
switch (page_ttl.Ns().Id()) {
|
||||
case Xow_ns_.Tid__template: // ttl is template not in cache, or some other ns; do load
|
||||
|
||||
@@ -52,6 +52,7 @@ public class Xot_invk_wkr implements Xop_ctx_wkr, Xop_arg_wkr {
|
||||
invk.Args_add(ctx, nde);
|
||||
return true;
|
||||
}
|
||||
private static final Xol_func_itm finder = new Xol_func_itm();
|
||||
private static void AddNameArg(Xop_ctx ctx, byte[] src, Xot_invk_tkn invk, Arg_nde_tkn nde) {
|
||||
// make valTkn into a keyTkn; note that argBldr will only generate a valTkn
|
||||
Arg_itm_tkn key_tkn = nde.Val_tkn(), val_tkn = nde.Key_tkn();
|
||||
@@ -60,18 +61,26 @@ public class Xot_invk_wkr implements Xop_ctx_wkr, Xop_arg_wkr {
|
||||
|
||||
if (key_tkn.Itm_static() != Bool_.Y_byte) return; // dynamic tkn; can't identify func/name
|
||||
int colon_pos = -1, txt_bgn = key_tkn.Dat_bgn(), txt_end = key_tkn.Dat_end();
|
||||
Xol_func_itm finder = ctx.Wiki().Lang().Func_regy().Find_defn(src, txt_bgn, txt_end);
|
||||
Xot_defn finder_func = finder.Func();
|
||||
byte finder_typeId = finder.Tid();
|
||||
switch (finder_typeId) {
|
||||
|
||||
Xot_defn finder_func; byte finder_tid; int finder_colon_pos, finder_subst_bgn, finder_subst_end;;
|
||||
synchronized (finder) {
|
||||
ctx.Wiki().Lang().Func_regy().Find_defn(finder, src, txt_bgn, txt_end);
|
||||
finder_func = finder.Func();
|
||||
finder_tid = finder.Tid();
|
||||
finder_colon_pos = finder.Colon_pos();
|
||||
finder_subst_bgn = finder.Subst_bgn();
|
||||
finder_subst_end = finder.Subst_end();
|
||||
}
|
||||
|
||||
switch (finder_tid) {
|
||||
case Xot_defn_.Tid_func: // func
|
||||
colon_pos = finder.Colon_pos();
|
||||
colon_pos = finder_colon_pos;
|
||||
break;
|
||||
case Xot_defn_.Tid_subst: // subst/safesubst; mark invk_tkn
|
||||
case Xot_defn_.Tid_safesubst:
|
||||
int subst_bgn = finder.Subst_bgn(), subst_end = finder.Subst_end();
|
||||
invk.Tmpl_subst_props_(finder_typeId, subst_bgn, subst_end);
|
||||
if ((ctx.Parse_tid() == Xop_parser_.Parse_tid_tmpl && finder_typeId == Xot_defn_.Tid_subst) // NOTE: if subst, but in tmpl stage, do not actually subst; PAGE:en.w:Unreferenced; DATE:2013-01-31
|
||||
int subst_bgn = finder_subst_bgn, subst_end = finder_subst_end;
|
||||
invk.Tmpl_subst_props_(finder_tid, subst_bgn, subst_end);
|
||||
if ((ctx.Parse_tid() == Xop_parser_.Parse_tid_tmpl && finder_tid == Xot_defn_.Tid_subst) // NOTE: if subst, but in tmpl stage, do not actually subst; PAGE:en.w:Unreferenced; DATE:2013-01-31
|
||||
|| ctx.Page().Ttl().Ns().Id_is_tmpl()) { // also, if on tmpl page, never evaluate (questionable, but seems to be needed)
|
||||
}
|
||||
else {
|
||||
@@ -79,7 +88,7 @@ public class Xot_invk_wkr implements Xop_ctx_wkr, Xop_arg_wkr {
|
||||
key_tkn.Dat_ary_had_subst_y_();
|
||||
}
|
||||
if (finder_func != Xot_defn_.Null) {
|
||||
colon_pos = finder.Colon_pos();
|
||||
colon_pos = finder_colon_pos;
|
||||
txt_bgn = subst_end;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -167,7 +167,7 @@ public class Xot_invk_wkr__basic__tst {
|
||||
fxt.Test_parse_tmpl_str_test("{{{1}}}{{{2}}}" , "{{test|[[b=c|d}}" , "{{test|[[b=c|d}}");
|
||||
}
|
||||
@Test public void Err_tmp_empty() { // PURPOSE: {{{{R from misspelling}} }}
|
||||
fxt.Init_log_(Xop_ttl_log.Invalid_char).Test_parse_tmpl_str_test("{{{1}}}" , "{{ {{a}} }}" , "{{[[:Template:a]]}}");
|
||||
fxt.Test_parse_tmpl_str_test("{{{1}}}" , "{{ {{a}} }}" , "{{[[:Template:a]]}}");
|
||||
}
|
||||
@Test public void Mismatch_bgn() { // PURPOSE: handle {{{ }}; WP:Paris Commune; Infobox Former Country
|
||||
fxt.Init_defn_clear();
|
||||
|
||||
@@ -22,13 +22,13 @@ public class Xot_invk_wkr__missing__tst {
|
||||
@Test public void Missing() {
|
||||
fxt.Init_defn_clear();
|
||||
fxt.Init_defn_add("test_template", "{{[[Template:{{{1}}}|{{{1}}}]]}}");
|
||||
fxt.Init_log_(Xop_ttl_log.Invalid_char).Test_parse_tmpl_str("{{test_template|a}}", "{{[[Template:a|a]]}}");
|
||||
fxt.Test_parse_tmpl_str("{{test_template|a}}", "{{[[Template:a|a]]}}");
|
||||
fxt.Init_defn_clear();
|
||||
}
|
||||
@Test public void Missing__name_and_args() { // PURPOSE: missing title should return name + args; used to only return name; PAGE:en.w:Flag_of_Greenland; DATE:2016-06-21
|
||||
fxt.Init_defn_clear();
|
||||
fxt.Init_defn_add("test_template", "{{ {{{1}}} | a | b }}");
|
||||
fxt.Init_log_(Xop_ttl_log.Invalid_char).Test_parse_tmpl_str("{{test_template}}", "{{{{{1}}}| a | b }}"); // NOTE: this should include spaces (" {{{1}}} "), but for now, ignore
|
||||
fxt.Test_parse_tmpl_str("{{test_template}}", "{{{{{1}}}| a | b }}"); // NOTE: this should include spaces (" {{{1}}} "), but for now, ignore
|
||||
fxt.Init_defn_clear();
|
||||
}
|
||||
@Test public void Missing_foreign() {
|
||||
|
||||
@@ -42,5 +42,5 @@ class Xot_prm_wkr implements Xop_arg_wkr {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static final Xot_prm_wkr Instance = new Xot_prm_wkr(); Xot_prm_wkr() {}
|
||||
public static final Xot_prm_wkr Instance = new Xot_prm_wkr(); Xot_prm_wkr() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user