mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.7.3.1
This commit is contained in:
@@ -31,7 +31,7 @@ public class GfmlLxr_ {
|
||||
public static final GfmlLxr Null = new GfmlLxr_null();
|
||||
public static final String CmdTknChanged_evt = "Changed";
|
||||
public static GfmlLxr as_(Object obj) {return obj instanceof GfmlLxr ? (GfmlLxr)obj : null;}
|
||||
public static GfmlLxr cast_(Object obj) {try {return (GfmlLxr)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, GfmlLxr.class, obj);}}
|
||||
public static GfmlLxr cast_(Object obj) {try {return (GfmlLxr)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, GfmlLxr.class, obj);}}
|
||||
}
|
||||
class GfmlLxr_null implements GfmlLxr {
|
||||
public String Key() {return "gfml.nullLxr";}
|
||||
@@ -95,7 +95,7 @@ class GfmlLxr_group implements GfmlLxr {
|
||||
}
|
||||
public GfmlLxr SubLxr() {throw Err_sublxr();}
|
||||
public void SubLxr_Add(GfmlLxr... lexer) {throw Err_sublxr();}
|
||||
Exc Err_sublxr() {return Exc_.new_unimplemented_w_msg("group lxr does not have subLxrs", "key", key, "output_tkn", outputTkn.Raw()).Stack_erase_1_();}
|
||||
Err Err_sublxr() {return Err_.new_unimplemented_w_msg("group lxr does not have subLxrs", "key", key, "output_tkn", outputTkn.Raw()).Trace_ignore_add_1_();}
|
||||
GfmlTrie trie = GfmlTrie.new_(); String_bldr sb = String_bldr_.new_(); boolean ignoreOutput;
|
||||
public static GfmlLxr_group new_(String key, String[] hooks, GfmlTkn outputTkn, boolean ignoreOutput) {
|
||||
GfmlLxr_group rv = new GfmlLxr_group();
|
||||
@@ -213,5 +213,5 @@ class GfmlLxr_frame extends GfmlLxr_singleton { GfmlFrame frame; GfmlLxr endLxr
|
||||
return rv;
|
||||
} GfmlLxr_frame() {}
|
||||
public static GfmlLxr_frame as_(Object obj) {return obj instanceof GfmlLxr_frame ? (GfmlLxr_frame)obj : null;}
|
||||
public static GfmlLxr_frame cast_(Object obj) {try {return (GfmlLxr_frame)obj;} catch(Exception exc) {throw Exc_.new_type_mismatch_w_exc(exc, GfmlLxr_frame.class, obj);}}
|
||||
public static GfmlLxr_frame cast_(Object obj) {try {return (GfmlLxr_frame)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, GfmlLxr_frame.class, obj);}}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ class GfmlTkn_composite implements GfmlTkn {
|
||||
public String Val() {return GfmlTknAry_.XtoVal(ary);}
|
||||
public GfmlBldrCmd Cmd_of_Tkn() {return GfmlBldrCmd_.Null;}
|
||||
public GfmlTkn[] SubTkns() {return ary;} GfmlTkn[] ary;
|
||||
public GfmlTkn MakeNew(String rawNew, String valNew) {throw Exc_.new_unimplemented_w_msg(".MakeNew cannot be invoked on GfmlTkn_composite (raw is available, but not val)", "tknType", tknType, "rawNew", rawNew, "valNew", valNew);}
|
||||
public GfmlTkn MakeNew(String rawNew, String valNew) {throw Err_.new_unimplemented_w_msg(".MakeNew cannot be invoked on GfmlTkn_composite (raw is available, but not val)", "tknType", tknType, "rawNew", rawNew, "valNew", valNew);}
|
||||
@gplx.Internal protected GfmlTkn_composite(String tknType, GfmlTkn[] ary) {this.tknType = tknType; this.ary = ary;}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GfmlTrie {
|
||||
return result;
|
||||
}
|
||||
public void Add(String symbol, Object data) {
|
||||
if (data == null) throw Exc_.new_("null objects cannot be registered", "symbol", symbol);
|
||||
if (data == null) throw Err_.new_wo_type("null objects cannot be registered", "symbol", symbol);
|
||||
|
||||
char[] ary = String_.XtoCharAry(symbol); int lastIndex = ary.length - 1;
|
||||
IntObjHash_base curLink = rootLink;
|
||||
|
||||
@@ -20,7 +20,7 @@ class IntObjHash_base {
|
||||
public int Count() {return count;} int count;
|
||||
public boolean Has(int key) {return Get_by(key) != null;}
|
||||
public Object Get_by(int key) {
|
||||
if (key < 0) throw Exc_.new_("key must be >= 0", "key", key);
|
||||
if (key < 0) throw Err_.new_wo_type("key must be >= 0", "key", key);
|
||||
if (key > maxKey) return null;
|
||||
Object[] subAry = FetchSubAry(key);
|
||||
return subAry == null ? null : subAry[subIdx];
|
||||
@@ -40,8 +40,8 @@ class IntObjHash_base {
|
||||
maxKey = -1;
|
||||
}
|
||||
void PutObjAtKey(int key, Object obj, boolean isAdd) {
|
||||
if (key < 0) throw Exc_.new_("key must be >= 0", "key", key);
|
||||
if (obj == null) throw Exc_.new_("Object cannot be null; call .Del on key instead", "key", key);
|
||||
if (key < 0) throw Err_.new_wo_type("key must be >= 0", "key", key);
|
||||
if (obj == null) throw Err_.new_wo_type("Object cannot be null; call .Del on key instead", "key", key);
|
||||
if (key > maxKey) ExpandRootAry(key);
|
||||
Object[] subAry = FetchSubAry(key);
|
||||
if (subAry == null) {
|
||||
@@ -49,8 +49,8 @@ class IntObjHash_base {
|
||||
rootAry[rootIdx] = subAry;
|
||||
}
|
||||
Object curVal = subAry[subIdx];
|
||||
if ( isAdd && curVal != null) throw Exc_.new_(".Add cannot be called on non-null vals; call .Set instead", "key", key, "val", curVal);
|
||||
if (!isAdd && curVal == null) throw Exc_.new_(".Set cannot be called on null vals; call .Add instead", "key", key);
|
||||
if ( isAdd && curVal != null) throw Err_.new_wo_type(".Add cannot be called on non-null vals; call .Set instead", "key", key, "val", curVal);
|
||||
if (!isAdd && curVal == null) throw Err_.new_wo_type(".Set cannot be called on null vals; call .Add instead", "key", key);
|
||||
subAry[subIdx] = obj;
|
||||
if (isAdd) count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user