mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -102,9 +102,9 @@ public class Php_evaluator implements Php_tkn_wkr {
|
||||
case Mode_val:
|
||||
Php_itm line_val = null;
|
||||
switch (tkn_tid) {
|
||||
case Php_tkn_.Tid_null: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_null._; break;
|
||||
case Php_tkn_.Tid_false: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_bool_false._; break;
|
||||
case Php_tkn_.Tid_true: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_bool_true._; break;
|
||||
case Php_tkn_.Tid_null: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_null.Instance; break;
|
||||
case Php_tkn_.Tid_false: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_bool_false.Instance; break;
|
||||
case Php_tkn_.Tid_true: Expect(Php_tkn_.Tid_semic, Mode_key_bgn); line_val = Php_itm_bool_true.Instance; break;
|
||||
case Php_tkn_.Tid_quote:
|
||||
Expect(Php_tkn_.Tid_semic, Mode_key_bgn);
|
||||
Php_tkn_quote tkn_quote = (Php_tkn_quote)tkn;
|
||||
@@ -138,9 +138,9 @@ public class Php_evaluator implements Php_tkn_wkr {
|
||||
break;
|
||||
case Mode_ary_subs:
|
||||
switch (tkn_tid) {
|
||||
case Php_tkn_.Tid_null: Ary_add_itm(Php_itm_null._); break;
|
||||
case Php_tkn_.Tid_false: Ary_add_itm(Php_itm_bool_false._); break;
|
||||
case Php_tkn_.Tid_true: Ary_add_itm(Php_itm_bool_true._); break;
|
||||
case Php_tkn_.Tid_null: Ary_add_itm(Php_itm_null.Instance); break;
|
||||
case Php_tkn_.Tid_false: Ary_add_itm(Php_itm_bool_false.Instance); break;
|
||||
case Php_tkn_.Tid_true: Ary_add_itm(Php_itm_bool_true.Instance); break;
|
||||
case Php_tkn_.Tid_quote:
|
||||
Php_tkn_quote tkn_quote = (Php_tkn_quote)tkn;
|
||||
Ary_add_itm(new Php_itm_quote(tkn_quote.Quote_text(src)));
|
||||
|
||||
@@ -23,18 +23,18 @@ public interface Php_itm {
|
||||
class Php_itm_null implements Php_itm, Php_itm_sub {
|
||||
public byte Itm_tid() {return Php_itm_.Tid_null;}
|
||||
public byte[] Val_obj_bry() {return null;}
|
||||
public static final Php_itm_null _ = new Php_itm_null(); Php_itm_null() {}
|
||||
public static final Php_itm_null Instance = new Php_itm_null(); Php_itm_null() {}
|
||||
}
|
||||
class Php_itm_bool_true implements Php_itm, Php_itm_sub {
|
||||
public byte Itm_tid() {return Php_itm_.Tid_bool_true;}
|
||||
public byte[] Val_obj_bry() {return Bry_true;}
|
||||
public static final Php_itm_bool_true _ = new Php_itm_bool_true(); Php_itm_bool_true() {}
|
||||
public static final Php_itm_bool_true Instance = new Php_itm_bool_true(); Php_itm_bool_true() {}
|
||||
private static final byte[] Bry_true = Bry_.new_a7("true");
|
||||
}
|
||||
class Php_itm_bool_false implements Php_itm, Php_itm_sub {
|
||||
public byte Itm_tid() {return Php_itm_.Tid_bool_false;}
|
||||
public byte[] Val_obj_bry() {return Bry_true;}
|
||||
public static final Php_itm_bool_false _ = new Php_itm_bool_false(); Php_itm_bool_false() {}
|
||||
public static final Php_itm_bool_false Instance = new Php_itm_bool_false(); Php_itm_bool_false() {}
|
||||
private static final byte[] Bry_true = Bry_.new_a7("false");
|
||||
}
|
||||
class Php_itm_var implements Php_itm, Php_itm_sub, Php_key {
|
||||
|
||||
@@ -132,7 +132,7 @@ class Php_parser_fxt {
|
||||
Tst_mgr tst_mgr = new Tst_mgr();
|
||||
Gfo_msg_log_chkr log_mgr_chkr = new Gfo_msg_log_chkr();
|
||||
public void Clear() {log_mgr_chkr.Clear(); tkn_wkr.Clear(); line_wkr.Clear();}
|
||||
public Php_tkn_chkr_base tkn_declaration() {return Php_tkn_declaration_chkr._;}
|
||||
public Php_tkn_chkr_base tkn_declaration() {return Php_tkn_declaration_chkr.Instance;}
|
||||
public Php_tkn_chkr_base tkn_txt(int bgn, int end) {return new Php_tkn_txt_chkr(bgn, end);}
|
||||
public Php_tkn_chkr_base tkn_ws(int bgn, int end) {return new Php_tkn_ws_chkr(bgn, end);}
|
||||
public Php_tkn_chkr_base tkn_generic(int bgn, int end, byte tid) {return new Php_tkn_generic_chkr(bgn, end, tid);}
|
||||
@@ -197,7 +197,7 @@ abstract class Php_tkn_chkr_base implements Tst_chkr {
|
||||
class Php_tkn_declaration_chkr extends Php_tkn_chkr_base {
|
||||
@Override public Class<?> TypeOf() {return Php_tkn_declaration.class;}
|
||||
@Override public byte Tkn_tid() {return Php_tkn_.Tid_declaration;}
|
||||
public static final Php_tkn_declaration_chkr _ = new Php_tkn_declaration_chkr();
|
||||
public static final Php_tkn_declaration_chkr Instance = new Php_tkn_declaration_chkr();
|
||||
}
|
||||
class Php_tkn_txt_chkr extends Php_tkn_chkr_base {
|
||||
public Php_tkn_txt_chkr(int src_bgn, int src_end) {this.Src_rng_(src_bgn, src_end);}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class Php_srl_parser {
|
||||
}
|
||||
Err err_(byte[] raw, int bgn, String fmt, Object... args) {return err_(raw, bgn, raw.length, fmt, args);}
|
||||
Err err_(byte[] raw, int bgn, int raw_len, String fmt, Object... args) {
|
||||
String msg = String_.Format(fmt, args) + " " + Int_.Xto_str(bgn) + " " + String_.new_u8__by_len(raw, bgn, 20);
|
||||
String msg = String_.Format(fmt, args) + " " + Int_.To_str(bgn) + " " + String_.new_u8__by_len(raw, bgn, 20);
|
||||
return Err_.new_wo_type(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class Php_srl_parser_fxt {
|
||||
Php_srl_itm_ary root = parser.Parse(raw);
|
||||
Php_srl_itm root_sub = root.Subs_get_at(0).Val();
|
||||
root_sub.Xto_bfr(tmp_bfr, 0);
|
||||
String actl = tmp_bfr.Xto_str_and_clear();
|
||||
String actl = tmp_bfr.To_str_and_clear();
|
||||
String expd = Xto_str(expd_ary, 0, expd_ary.length);
|
||||
Tfds.Eq_str_lines(expd, actl, actl);
|
||||
}
|
||||
@@ -107,6 +107,6 @@ class Php_srl_parser_fxt {
|
||||
Php_srl_itm itm = ary[i];
|
||||
itm.Xto_bfr(tmp_bfr, 0);
|
||||
}
|
||||
return tmp_bfr.Xto_str_and_clear();
|
||||
return tmp_bfr.To_str_and_clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Php_text_itm_parser {
|
||||
Php_text_itm itm = (Php_text_itm)tmp_list.Get_at(i);
|
||||
itm.Bld(tmp_bfr, raw);
|
||||
}
|
||||
rv = tmp_bfr.Xto_bry_and_clear();
|
||||
rv = tmp_bfr.To_bry_and_clear();
|
||||
break;
|
||||
}
|
||||
return rv;
|
||||
@@ -101,7 +101,7 @@ public class Php_text_itm_parser {
|
||||
case Byte_ascii.Dollar:
|
||||
if (txt_bgn != -1) {tmp_list.Add(new Php_text_itm_text(txt_bgn, i)); txt_bgn = -1;}
|
||||
if (i == raw_last) {
|
||||
//throw Err_mgr._.fmt_auto_(GRP_KEY, "dollar_is_last_char", String_.new_u8(raw));
|
||||
//throw Err_mgr.Instance.fmt_auto_(GRP_KEY, "dollar_is_last_char", String_.new_u8(raw));
|
||||
}
|
||||
int int_end = Find_fwd_non_int(raw, i + 1, raw_len); // +1 to search after $
|
||||
int int_val = Bry_.To_int_or(raw, i + 1, int_end, -1); // +1 to search after $
|
||||
@@ -109,7 +109,7 @@ public class Php_text_itm_parser {
|
||||
tmp_list.Add(new Php_text_itm_text(i, i + 1));
|
||||
continue;
|
||||
}
|
||||
//throw Err_mgr._.fmt_auto_(GRP_KEY, "invalid_arg", String_.new_u8(raw));
|
||||
//throw Err_mgr.Instance.fmt_auto_(GRP_KEY, "invalid_arg", String_.new_u8(raw));
|
||||
tmp_list.Add(new Php_text_itm_arg(i, int_end, int_val));
|
||||
rslt_val = Rslt_fmt;
|
||||
i = int_end - 1; // -1 b/c i++ in for loop
|
||||
@@ -125,7 +125,7 @@ public class Php_text_itm_parser {
|
||||
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_.Xto_int_hex(src, bgn, end); // +2; skip "\" + "u"
|
||||
int v = Int_.To_int_hex(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));
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@ class Php_text_itm_fxt {
|
||||
Php_text_itm itm = (Php_text_itm)list.Get_at(i);
|
||||
itm.Bld(bfr, raw);
|
||||
}
|
||||
Tfds.Eq(expd, bfr.Xto_str_and_clear());
|
||||
Tfds.Eq(expd, bfr.To_str_and_clear());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,5 +70,5 @@ class Php_tkn_quote extends Php_tkn_base {
|
||||
}
|
||||
class Php_tkn_declaration extends Php_tkn_base {
|
||||
@Override public byte Tkn_tid() {return Php_tkn_.Tid_declaration;}
|
||||
public static final Php_tkn_declaration _ = new Php_tkn_declaration();
|
||||
public static final Php_tkn_declaration Instance = new Php_tkn_declaration();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.langs.phps; import gplx.*; import gplx.langs.*;
|
||||
class Php_tkn_factory {
|
||||
public Php_tkn_generic Generic(int bgn, int end, byte tid) {return new Php_tkn_generic(bgn, end, tid);}
|
||||
public Php_tkn_txt Txt(int bgn, int end) {return new Php_tkn_txt(bgn, end);}
|
||||
public Php_tkn Declaration(int bgn, int end) {return Php_tkn_declaration._;}
|
||||
public Php_tkn Declaration(int bgn, int end) {return Php_tkn_declaration.Instance;}
|
||||
public Php_tkn_ws Ws(int bgn, int end, byte ws_tid) {return new Php_tkn_ws(bgn, end, ws_tid);}
|
||||
public Php_tkn_var Var(int bgn, int end) {return new Php_tkn_var(bgn, end);}
|
||||
public Php_tkn_num Num(int bgn, int end) {return new Php_tkn_num(bgn, end);}
|
||||
|
||||
Reference in New Issue
Block a user