int main_init (int ac, char **av)
{
kpse_set_program_name(av[0], NULL);
+ //init_default_kanji(NULL, "sjis");
xputenv("engine", "yandytex");
if (sizeof(memory_word) != sizeof(halfword) * 2)
else
cur_val = 0;
- // find_effective_tail
+ find_effective_tail();
tx = tail;
if (!is_char_node(tx))
{
integer k;
halfword t;
-/* char cat; */ /* make this an int ? */
+/* char cat; */
int cat; /* make this an int ? 95/Jan/7 */
int l; // for pTeX
ASCII_code c, cc;
}
else
lab21:
- cur_cmd = cat_code(cur_chr);
+ cur_cmd = cat_code(cur_chr);
switch (state + cur_cmd)
{
break;
case any_state_plus(escape):
- {
+ {printf("\nescape. ");
if (loc > limit)
cur_cs = null_cs;
else
{
- k = loc;
+ k = loc;printf("%d. ", buffer[k]);
cur_chr = buffer[k];
incr(k);
if (multistrlen(buffer, limit + 1, k - 1) == 2)
{
- cat = kcat_code(kcatcodekey(fromBUFF(buffer, limit + 1, k-1)));
+ cat = kcat_code(kcatcodekey(fromBUFF(buffer, limit + 1, k - 1)));
incr(k);
}
else
}
else
{
- if (buffer[k] == cur_chr)
- if (cat == sup_mark)
- if (k < limit)
+ if (buffer[k] == cur_chr) if (cat == sup_mark) if (k < limit)
+ {
+ c = buffer[k + 1];
+
+ if (c < 128)
+ {
+ d = 2;
+
+ if (is_hex(c)) if (k + 2 <= limit)
{
- c = buffer[k + 1];
-
- if (c < 128) /* ? */
- {
- d = 2;
- if ((((c >= 48) && (c <= 57)) || ((c >= 97) && (c <= 102))))
- if (k + 2 <= limit)
- {
- cc = buffer[k + 2];
-
- if ((((cc >= 48) && (cc <= 57)) || ((cc >= 97) && (cc <= 102))))
- incr(d);
- }
-
- if (d > 2)
- {
- if (c <= 57)
- cur_chr = c - 48;
- else
- cur_chr = c - 87;
-
- if (cc <= 57) /* cc may be used without ... */
- cur_chr = 16 * cur_chr + cc - 48;
- else
- cur_chr = 16 * cur_chr + cc - 87;
-
- buffer[k - 1] = cur_chr;
- }
- else if (c < 64)
- buffer[k - 1] = c + 64;
- else
- buffer[k - 1] = c - 64;
+ cc = buffer[k + 2];
- limit = limit - d;
- first = first - d;
-
- while (k <= limit)
- {
- buffer[k] = buffer[k + d];
- incr(k);
- }
- goto lab26;
- }
+ if (is_hex(cc))
+ incr(d);
+ }
+
+ if (d > 2)
+ {
+ hex_to_cur_chr();
+ buffer[k - 1] = cur_chr;
+ }
+ else if (c < 64)
+ buffer[k - 1] = c + 64;
+ else
+ buffer[k - 1] = c - 64;
+
+ limit = limit - d;
+ first = first - d;
+
+ while (k <= limit)
+ {
+ buffer[k] = buffer[k + d];
+ incr(k);
}
+ goto lab26;
+ }
+ }
}
cur_cs = single_base + buffer[loc];
incr(loc);
{
case glue_node:
if ((subtype(tail) == kanji_skip_code + 1) ||
- (subtype(tail)=xkanji_skip_code+1))
+ (subtype(tail) == xkanji_skip_code+1))
{
link(p) = link(tail);
delete_glue_ref(glue_ptr(tail));
if ((cur_cmd == letter) || (cur_cmd == other_char))
q = new_character(f, cur_chr);
- else if ((cur_cmd=kanji) || (cur_cmd == kana) || (cur_cmd == other_kchar))
+ else if ((cur_cmd == kanji) || (cur_cmd == kana) || (cur_cmd == other_kchar))
{
if (direction == dir_tate)
f = cur_tfont;
} \
while (0)
//
+#define find_effective_tail() \
+do { \
+tx = tail; \
+if (is_char_node(tx)) \
+ if (type(tx) == disp_node) \
+ { tx = prev_node; \
+ if (!is_char_node(tx)) \
+ if (type(tx) == disp_node) \
+ {tx = head; q = link(head); \
+ while (q!=prev_node) \
+ { if (is_char_node(q)) tx = q; \
+ else if (type(q) != disp_node) tx = q;\
+ } \
+ q = link(q); \
+ } \
+ } \
+} while (0)
+//
#define check_effective_tail_pTeX(a)\
do \
{ \