1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.7.3.1'

This commit is contained in:
gnosygnu
2016-07-17 21:10:59 -04:00
parent b333db45f8
commit 7a851a41a5
290 changed files with 3048 additions and 2124 deletions

View File

@@ -16,23 +16,22 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.funcs; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.threads.poolables.*;
import gplx.xowa.parsers.tmpls.*;
public class Xol_func_itm {
public byte Tid() {return tid;} private byte tid = Xot_defn_.Tid_null;
public Xot_defn Func() {return func;} private Xot_defn func = Xot_defn_.Null;
public void Func_set(Xot_defn v, int colon_pos) {
if (tid == Xot_defn_.Tid_null) tid = Xot_defn_.Tid_func; // only set tid if subst did not set it
this.func = v;
this.colon_pos = colon_pos;
}
public int Colon_pos() {return colon_pos;} private int colon_pos = -1;
public int Subst_bgn() {return subst_bgn;} private int subst_bgn = -1;
public int Subst_end() {return subst_end;} private int subst_end = -1;
public void Subst_set_(byte tid, int bgn, int end) {this.tid = tid; this.subst_bgn = bgn; this.subst_end = end;}
public byte Tid() {return tid;} private byte tid = Xot_defn_.Tid_null;
public Xot_defn Func() {return func;} private Xot_defn func = Xot_defn_.Null;
public int Colon_pos() {return colon_pos;} private int colon_pos = -1;
public int Subst_bgn() {return subst_bgn;} private int subst_bgn = -1;
public int Subst_end() {return subst_end;} private int subst_end = -1;
public void Clear() {
tid = Xot_defn_.Tid_null;
func = Xot_defn_.Null;
colon_pos = subst_bgn = subst_end = -1;
}
public void Init_by_subst(byte tid, int bgn, int end) {this.tid = tid; this.subst_bgn = bgn; this.subst_end = end;}
public void Func_(Xot_defn v, int colon_pos) {
if (tid == Xot_defn_.Tid_null) tid = Xot_defn_.Tid_func; // only set tid if subst did not set it
this.func = v;
this.colon_pos = colon_pos;
}
}

View File

@@ -72,22 +72,22 @@ public class Xol_func_regy {
switch (defn_tid) {
case Xot_defn_.Tid_func:
if (match_pos == txt_end) // next char is ws (b/c match_pos == txt_end)
rv.Func_set(func, -1);
rv.Func_(func, -1);
else if (src[match_pos] == Pf_func_.Name_dlm) // next char is :
rv.Func_set(func, match_pos);
rv.Func_(func, match_pos);
else { // func is close, but not quite: ex: #ifx: or padlefts:
return;
}
break;
case Xot_defn_.Tid_safesubst:
case Xot_defn_.Tid_subst:
rv.Subst_set_(defn_tid, txt_bgn, match_pos);
rv.Init_by_subst(defn_tid, txt_bgn, match_pos);
if (match_pos < txt_end) txt_bgn = Bry_find_.Find_fwd_while_not_ws(src, match_pos, txt_end);
break;
case Xot_defn_.Tid_raw:
case Xot_defn_.Tid_msg:
case Xot_defn_.Tid_msgnw:
rv.Subst_set_(defn_tid, txt_bgn, match_pos);
rv.Init_by_subst(defn_tid, txt_bgn, match_pos);
if (match_pos + 1 < txt_end) // +1 to include ":" (keyword id "raw", not "raw:")
txt_bgn = Bry_find_.Find_fwd_while_not_ws(src, match_pos + 1, txt_end);
break;