mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.5.4.1
This commit is contained in:
@@ -23,7 +23,7 @@ public class GfmlBldr {
|
||||
@gplx.Internal protected GfmlFrame_nde CurNdeFrame() {return curNdeFrame;} GfmlFrame_nde curNdeFrame;
|
||||
@gplx.Internal protected GfmlNde CurNde() {return curNdeFrame.CurNde();}
|
||||
@gplx.Internal protected GfmlTypeMgr TypeMgr() {return typeMgr;} GfmlTypeMgr typeMgr = GfmlTypeMgr.new_();
|
||||
@gplx.Internal protected HashAdp Vars() {return vars;} HashAdp vars = HashAdp_.new_();
|
||||
@gplx.Internal protected Hash_adp Vars() {return vars;} Hash_adp vars = Hash_adp_.new_();
|
||||
@gplx.Internal protected int StreamPos() {return streamPos;} int streamPos;
|
||||
@gplx.Internal protected void ThrowErrors_set(boolean v) {throwErrors = v;} private boolean throwErrors = true;
|
||||
@gplx.Internal protected int PrvSymType() {return prvSymType;} @gplx.Internal protected void PrvSymType_set(int v) {prvSymType = v;} int prvSymType = GfmlNdeSymType.Null;
|
||||
|
||||
@@ -29,8 +29,8 @@ class GfmlBldrCmd_null implements GfmlBldrCmd {
|
||||
}
|
||||
class GfmlBldrCmdRegy {
|
||||
public void Add(GfmlBldrCmd cmd) {hash.Add(cmd.Key(), cmd);}
|
||||
public GfmlBldrCmd GetOrFail(String key) {return (GfmlBldrCmd)hash.FetchOrFail(key);}
|
||||
HashAdp hash = HashAdp_.new_();
|
||||
public GfmlBldrCmd GetOrFail(String key) {return (GfmlBldrCmd)hash.Get_by_or_fail(key);}
|
||||
Hash_adp hash = Hash_adp_.new_();
|
||||
public static GfmlBldrCmdRegy new_() {
|
||||
GfmlBldrCmdRegy rv = new GfmlBldrCmdRegy();
|
||||
rv.Add(GfmlBldrCmd_elemKey_set._);
|
||||
|
||||
@@ -114,7 +114,7 @@ class GfmlBldrCmd_whitespace implements GfmlBldrCmd {
|
||||
public String Key() {return "gfml.whitespace_exec";}
|
||||
public void Exec(GfmlBldr bldr, GfmlTkn tkn) {
|
||||
if (bldr.CurNdeFrame().waitingTkns.Count() > 0) {
|
||||
GfmlObj t = (GfmlObj)bldr.CurNdeFrame().waitingTkns.FetchAt(bldr.CurNdeFrame().waitingTkns.Count() - 1);
|
||||
GfmlObj t = (GfmlObj)bldr.CurNdeFrame().waitingTkns.Get_at(bldr.CurNdeFrame().waitingTkns.Count() - 1);
|
||||
if (t.ObjType() == GfmlObj_.Type_nde)
|
||||
bldr.CurNdeFrame().IdxNdeBgn_set(bldr.CurNdeFrame().WaitingTkns().Count() + 1);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ class GfmlFrame_nde_ {
|
||||
@gplx.Internal protected static void TransferToNde(GfmlObjList waitingTkns, GfmlNde nde, int bgn) {
|
||||
int end = waitingTkns.Count();
|
||||
for (int i = bgn; i < end; i++) {
|
||||
GfmlObj tkn = waitingTkns.FetchAt(i);
|
||||
GfmlObj tkn = waitingTkns.Get_at(i);
|
||||
nde.SubObjs_Add(tkn);
|
||||
}
|
||||
if (bgn != end) // ignore if bgn == end
|
||||
@@ -218,7 +218,7 @@ class GfmlFrame_nde_ {
|
||||
int len = end - bgn;
|
||||
if (len <= 0 || end == -1) return; // -1 b/c calling proc passes end - 1, and end may be 0
|
||||
for (int i = 0; i < len; i++)
|
||||
trg.SubObjs_Add(src.FetchAt(i + bgn));
|
||||
trg.SubObjs_Add(src.Get_at(i + bgn));
|
||||
src.Del_range(bgn, end - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class GfmlFrame_ndeTknMgr {
|
||||
k = bldr.TypeMgr().FldPool().Keyed_PopNextAsTkn();
|
||||
GfmlAtr atr = GfmlAtr.string_(k, v);
|
||||
GfmlFrame_nde_.TransferToAtr(frame.waitingTkns, atr, idxAtrBgn, idxAtrEnd);
|
||||
frame.waitingTkns.AddAt(atr, idxAtrBgn);
|
||||
frame.waitingTkns.Add_at(atr, idxAtrBgn);
|
||||
this.IdxAtr_clear();
|
||||
}
|
||||
GfmlFrame_nde frame; GfmlBldr bldr;
|
||||
|
||||
@@ -31,13 +31,13 @@ class GfmlStringHighlighter {
|
||||
}
|
||||
public String[] Gen() {
|
||||
String_bldr posBfr = String_bldr_.new_(), rawBfr = String_bldr_.new_(), symBfr = String_bldr_.new_();
|
||||
ListAdp symList = ListAdp_.new_();
|
||||
List_adp symList = List_adp_.new_();
|
||||
int bgnPos = 0, endPos = 0;
|
||||
int rawLen = String_.Len(raw); int rawLenDigits = Int_.DigitCount(rawLen);
|
||||
int rawBfrBgn = -1, marksLastIdx = marks.LastIndex();
|
||||
int rawBfrBgn = -1, marksLastIdx = marks.Idx_last();
|
||||
for (int i = 0; i < marks.Count(); i++) {
|
||||
GfmlStringHighlighterMarker curMark = (GfmlStringHighlighterMarker)marks.FetchAt(i);
|
||||
GfmlStringHighlighterMarker nxtMark = i == marksLastIdx ? GfmlStringHighlighterMarker.Null : (GfmlStringHighlighterMarker)marks.FetchAt(i + 1);
|
||||
GfmlStringHighlighterMarker curMark = (GfmlStringHighlighterMarker)marks.Get_at(i);
|
||||
GfmlStringHighlighterMarker nxtMark = i == marksLastIdx ? GfmlStringHighlighterMarker.Null : (GfmlStringHighlighterMarker)marks.Get_at(i + 1);
|
||||
// bgnPos
|
||||
bgnPos = XtoBgnPos(curMark.Pos(), endPos);
|
||||
if (i == 0) rawBfrBgn = bgnPos;
|
||||
@@ -79,17 +79,17 @@ class GfmlStringHighlighter {
|
||||
rawBfr.Add_at(0, " ");
|
||||
symBfr.Add_at(0, " ");
|
||||
}
|
||||
ListAdp rv = ListAdp_.new_();
|
||||
List_adp rv = List_adp_.new_();
|
||||
rv.Add(posBfr.XtoStr());
|
||||
rv.Add(rawBfr.XtoStr());
|
||||
rv.Add(symBfr.XtoStr());
|
||||
if (symList.Count() > 0)
|
||||
rv.Add("");
|
||||
for (int i = 0; i < symList.Count(); i++)
|
||||
rv.Add((String)symList.FetchAt(i));
|
||||
return rv.XtoStrAry();
|
||||
rv.Add((String)symList.Get_at(i));
|
||||
return rv.To_str_ary();
|
||||
}
|
||||
ListAdp marks = ListAdp_.new_();
|
||||
List_adp marks = List_adp_.new_();
|
||||
public static GfmlStringHighlighter new_() {
|
||||
GfmlStringHighlighter rv = new GfmlStringHighlighter();
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user