mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -26,7 +26,7 @@ class Gfs_parser_ctx {
|
||||
public Gfs_nde Cur_nde() {return cur_nde;} Gfs_nde cur_nde;
|
||||
public int Nxt_pos() {return nxt_pos;} private int nxt_pos;
|
||||
public Gfs_lxr Nxt_lxr() {return nxt_lxr;} Gfs_lxr nxt_lxr;
|
||||
public Bry_bfr Tmp_bfr() {return tmp_bfr;} private Bry_bfr tmp_bfr = Bry_bfr.new_();
|
||||
public Bry_bfr Tmp_bfr() {return tmp_bfr;} private Bry_bfr tmp_bfr = Bry_bfr_.New();
|
||||
public void Process_eos() {}
|
||||
public void Process_lxr(int nxt_pos, Gfs_lxr nxt_lxr) {this.nxt_pos = nxt_pos; this.nxt_lxr = nxt_lxr;}
|
||||
public void Process_null(int cur_pos) {this.nxt_pos = cur_pos; this.nxt_lxr = null;}
|
||||
@@ -55,10 +55,10 @@ class Gfs_parser_ctx {
|
||||
return nde;
|
||||
}
|
||||
public void Cur_nde_from_stack() {cur_nde = (Gfs_nde)nodes.Get_at_last();}
|
||||
public void Stack_add() {nodes.Add(cur_nde);} List_adp nodes = List_adp_.new_();
|
||||
public void Stack_add() {nodes.Add(cur_nde);} List_adp nodes = List_adp_.New();
|
||||
public void Stack_pop(int pos) {
|
||||
if (nodes.Count() < 2) err_mgr.Fail_nde_stack_empty(this, pos); // NOTE: need at least 2 items; 1 to pop and 1 to set as current
|
||||
List_adp_.DelAt_last(nodes);
|
||||
List_adp_.Del_at_last(nodes);
|
||||
Cur_nde_from_stack();
|
||||
}
|
||||
public Gfs_err_mgr Err_mgr() {return err_mgr;} Gfs_err_mgr err_mgr = new Gfs_err_mgr();
|
||||
@@ -85,7 +85,7 @@ class Gfs_err_mgr {
|
||||
tmp_fail_args.Add("excerpt_end", Fail_excerpt_end(src, src_len, pos));
|
||||
tmp_fail_args.Add("pos" , pos);
|
||||
}
|
||||
public static final String Fail_msg_invalid_lxr = "invalid character", Fail_msg_unknown_char = "unknown char", Fail_msg_eos = "end of stream", Fail_msg_nde_stack_empty = "node stack empty";
|
||||
public static final String Fail_msg_invalid_lxr = "invalid character", Fail_msg_unknown_char = "unknown char", Fail_msg_eos = "end of stream", Fail_msg_nde_stack_empty = "node stack empty";
|
||||
String Fail_msg(String type, Keyval_list fail_args) {
|
||||
tmp_fail_bfr.Add_str_u8(type).Add_byte(Byte_ascii.Colon);
|
||||
int len = fail_args.Count();
|
||||
@@ -98,7 +98,7 @@ class Gfs_err_mgr {
|
||||
}
|
||||
return tmp_fail_bfr.To_str_and_clear();
|
||||
}
|
||||
Bry_bfr tmp_fail_bfr = Bry_bfr.reset_(255);
|
||||
Bry_bfr tmp_fail_bfr = Bry_bfr_.Reset(255);
|
||||
Keyval_list tmp_fail_args = new Keyval_list();
|
||||
private static int excerpt_len = 50;
|
||||
String Fail_excerpt_bgn(byte[] src, int src_len, int pos) {
|
||||
@@ -121,5 +121,5 @@ class Gfs_err_mgr {
|
||||
default: bfr.Add_byte(b); break;
|
||||
}
|
||||
}
|
||||
} static final byte[] Esc_nl = Bry_.new_a7("\\n"), Esc_cr = Bry_.new_a7("\\r"), Esc_tab = Bry_.new_a7("\\t");
|
||||
} static final byte[] Esc_nl = Bry_.new_a7("\\n"), Esc_cr = Bry_.new_a7("\\r"), Esc_tab = Bry_.new_a7("\\t");
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ class Gfs_parser_fxt {
|
||||
byte[] src_bry = Bry_.new_u8(src_str);
|
||||
Gfs_nde root = parser.Parse(src_bry);
|
||||
Tfds.Eq_str_lines(To_str(null, expd), To_str(src_bry, root.Subs_to_ary()));
|
||||
} private Bry_bfr tmp_bfr = Bry_bfr.new_(), path_bfr = Bry_bfr.new_(); Gfs_parser parser = new Gfs_parser();
|
||||
} private Bry_bfr tmp_bfr = Bry_bfr_.New(), path_bfr = Bry_bfr_.New(); Gfs_parser parser = new Gfs_parser();
|
||||
public void Test_parse_fail(String src_str, String expd_err) {
|
||||
byte[] src_bry = Bry_.new_u8(src_str);
|
||||
try {parser.Parse(src_bry);}
|
||||
@@ -192,5 +192,5 @@ class Gfs_parser_fxt {
|
||||
bfr.Add(val);
|
||||
bfr.Add_byte_nl();
|
||||
}
|
||||
private static final byte[] Atr_name = Bry_.new_a7("name=");
|
||||
private static final byte[] Atr_name = Bry_.new_a7("name=");
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
|
||||
public class Gfs_wtr {
|
||||
public byte Quote_char() {return quote_char;} public Gfs_wtr Quote_char_(byte v) {quote_char = v; return this;} private byte quote_char = Byte_ascii.Apos;
|
||||
public Bry_bfr Bfr() {return bfr;} private Bry_bfr bfr = Bry_bfr.reset_(255);
|
||||
public Bry_bfr Bfr() {return bfr;} private Bry_bfr bfr = Bry_bfr_.Reset(255);
|
||||
public void Add_grp_bgn(byte[] key) {
|
||||
bfr.Add(key); // key
|
||||
bfr.Add_byte(Byte_ascii.Curly_bgn); // {
|
||||
|
||||
Reference in New Issue
Block a user