1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-09-13 21:54:44 -04:00
parent 2145f6382c
commit 5fe27b5b3b
649 changed files with 4726 additions and 3432 deletions

View File

@@ -16,6 +16,7 @@ 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.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.xowa.parsers.*;
public class Xop_vnt_eqgt_tkn extends Xop_tkn_itm_base {
public Xop_vnt_eqgt_tkn(int bgn, int end) {this.Tkn_ini_pos(false, bgn, end);}
@Override public byte Tkn_tid() {return Xop_tkn_itm_.Tid_vnt_eqgt;}

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.xowa.parsers.*;
class Xop_vnt_flag_parser {
private Xop_vnt_flag_lang_bldr flag_lang_bldr;
public Xop_vnt_flag_parser(Xol_vnt_mgr vnt_mgr) {flag_lang_bldr = new Xop_vnt_flag_lang_bldr(vnt_mgr);}
@@ -26,7 +27,7 @@ class Xop_vnt_flag_parser {
public int Rslt_tkn_pos() {return rslt_tkn_pos;} private int rslt_tkn_pos;
public int Rslt_pipe_last() {return rslt_pipe_last;} private int rslt_pipe_last;
public Xop_vnt_flag[] Rslt_flags() {return rslt_flags;} private Xop_vnt_flag[] rslt_flags;
public void Parse(Xowe_wiki wiki, Xop_vnt_tkn vnt_tkn, int pipe_tkn_count, byte[] src) {
public void Parse(Xowe_wiki wiki, Xoa_url page_url, Xop_vnt_tkn vnt_tkn, int pipe_tkn_count, byte[] src) {
this.Clear();
rslt_flags = new Xop_vnt_flag[pipe_tkn_count];
int rv_idx = 0;
@@ -52,7 +53,7 @@ class Xop_vnt_flag_parser {
case Xop_tkn_itm_.Tid_newLine: // skip ws
break;
default:
wiki.Appe().Usr_dlg().Log_many("", "", "unknown tkn in vnt flag; tid=~{0} txt=~{1}", sub.Tkn_tid(), String_.new_u8(src, sub.Src_bgn(), sub.Src_end()));
wiki.Appe().Usr_dlg().Log_many("", "", "unknown tkn in vnt flag; url=~{0} tid=~{1} txt=~{2}", page_url.To_str(), sub.Tkn_tid(), String_.new_u8(src, sub.Src_bgn(), sub.Src_end()));
flag_bfr.Add_mid(src, sub.Src_bgn(), sub.Src_end());
break;
}

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.xowa.html.*;
import gplx.xowa.parsers.*;
public class Xop_vnt_html_wtr {
public static void Write(Bry_bfr bfr, Xoh_html_wtr html_wtr, Xop_ctx ctx, Xoh_wtr_ctx hctx, Xoae_page page, byte[] src, Xop_vnt_tkn vnt) {
byte[] cur_lang_vnt = ctx.Wiki().Lang().Vnt_mgr().Cur_vnt();

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.xowa.parsers.*;
public class Xop_vnt_lxr_ {
public static void set_(Xowe_wiki wiki) {
Btrie_fast_mgr wiki_trie = wiki.Parser().Wtxt_trie();
@@ -75,7 +76,7 @@ class Xop_vnt_lxr_end implements Xop_lxr {
int rule_subs_bgn = 0;
int pipe_tkn_count = vnt_tkn.Vnt_pipe_tkn_count();
if (pipe_tkn_count > 0) {
flag_parser.Parse(wiki, vnt_tkn, pipe_tkn_count, src);
flag_parser.Parse(wiki, ctx.Cur_page().Url(), vnt_tkn, pipe_tkn_count, src);
vnt_flag_ary = flag_parser.Rslt_flags();
rule_subs_bgn = flag_parser.Rslt_tkn_pos();
vnt_tkn.Vnt_pipe_idx_last_(flag_parser.Rslt_pipe_last());

View File

@@ -16,7 +16,7 @@ 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.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import org.junit.*;
import org.junit.*; import gplx.xowa.parsers.*; import gplx.xowa.parsers.miscs.*;
public class Xop_vnt_lxr_tst {
private Xop_vnt_lxr_fxt fxt = new Xop_vnt_lxr_fxt();
@Before public void init() {fxt.Clear();}

View File

@@ -16,6 +16,7 @@ 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.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.xowa.parsers.*;
public class Xop_vnt_rule extends Xop_tkn_itm_base {
public Xop_vnt_rule(byte[] rule_macro, byte[] rule_lang, Xop_tkn_itm[] rule_subs) {this.rule_macro = rule_macro; this.rule_lang = rule_lang; this.rule_subs = rule_subs;}
@Override public byte Tkn_tid() {return Xop_tkn_itm_.Tid_vnt_rule;}

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.btries.*;
import gplx.xowa.parsers.*; import gplx.xowa.parsers.miscs.*;
class Xop_vnt_rules_parser {
private byte mode;
private Xop_vnt_tkn vnt_tkn;

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.vnts; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.xowa.html.*;
import gplx.xowa.parsers.*;
public class Xop_vnt_tkn extends Xop_tkn_itm_base {
public Xop_vnt_tkn(int bgn, int end) {
this.Tkn_ini_pos(false, bgn, end);