OSDN Git Service

binding with libharu.
[putex/putex.git] / src / texsourc / tex2.c
1 #ifdef _WINDOWS
2   #define NOCOMM
3   #define NOSOUND
4   #define NODRIVERS
5   #define STRICT
6   #pragma warning(disable:4115) // kill rpcasync.h complaint
7   #include <windows.h>
8   #define MYLIBAPI __declspec(dllexport)
9 #endif
10
11 #include "texwin.h"
12
13 #pragma warning(disable:4996)
14 #pragma warning(disable:4131) // old style declarator
15 #pragma warning(disable:4135) // conversion between different integral types 
16 #pragma warning(disable:4127) // conditional expression is constant
17
18 #include <setjmp.h>
19
20 #define EXTERN extern
21
22 #include "texd.h"
23
24 #pragma warning(disable:4244)       /* 96/Jan/10 */
25
26 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
27
28 /* following bit used to be end of tex1.c */
29
30 #ifdef STAT
31 void restore_trace_(halfword p, char * s)
32 {
33   begin_diagnostic();
34   print_char('{');
35   print_string(s);
36   print_char(' ');
37   show_eqtb(p); 
38   print_char('}');
39   end_diagnostic(false);
40 }
41 #endif /* STAT */
42 void unsave (void) 
43 {/* 30 */  
44   halfword p; 
45   quarterword l; 
46   halfword t; 
47   if (cur_level > 1)
48   {
49     decr(cur_level); 
50     while (true) {
51       decr(save_ptr); 
52       if (save_stack[save_ptr].hh.b0 == 3)
53       goto lab30; 
54       p = save_stack[save_ptr].hh.v.RH; 
55       if (save_stack[save_ptr].hh.b0 == 2)
56       {
57   t = cur_tok; 
58   cur_tok = p; 
59   back_input(); 
60   cur_tok = t; 
61       } 
62       else {
63   if (save_stack[save_ptr].hh.b0 == 0)
64   {
65     l = save_stack[save_ptr].hh.b1; 
66     decr(save_ptr); 
67   } 
68   else save_stack[save_ptr]= eqtb[(hash_size + 781)]; 
69                     /* undefine_control_sequence */
70   if (p < (hash_size + 3163))
71   if (eqtb[p].hh.b1 == 1)
72   {
73     eq_destroy(save_stack[save_ptr]); 
74   ;
75 #ifdef STAT
76     if (eqtb[(hash_size + 3200)].cint > 0)
77     restore_trace(p, "retaining");
78 #endif /* STAT */
79   } 
80   else {
81     eq_destroy(eqtb[p]); 
82     eqtb[p]= save_stack[save_ptr]; 
83   ;
84 #ifdef STAT
85     if (eqtb[(hash_size + 3200)].cint > 0)
86     restore_trace(p, "restoring");
87 #endif /* STAT */
88   } else if (xeq_level[p]!= 1)
89   {
90     eqtb[p]= save_stack[save_ptr]; 
91     xeq_level[p]= l;     /* l may be used without having been ... */
92   ;
93 #ifdef STAT
94     if (eqtb[(hash_size + 3200)].cint > 0)
95     restore_trace(p, "restoring");
96 #endif /* STAT */
97   } 
98   else {
99   ;
100 #ifdef STAT
101     if (eqtb[(hash_size + 3200)].cint > 0)
102     restore_trace(p, "retaining");
103 #endif /* STAT */
104   } 
105       } 
106     } 
107     lab30: cur_group = save_stack[save_ptr].hh.b1; 
108     cur_boundary = save_stack[save_ptr].hh.v.RH; 
109   } 
110   else {
111     confusion("curlevel");
112     return;       // abort_flag set
113   }
114
115 /* This is where the old tex2.c used to start */
116 void prepare_mag (void) 
117 {
118   if ((mag_set > 0)&&(eqtb[(hash_size + 3180)].cint != mag_set)) 
119   {
120     print_err("Incompatible magnification(");
121     print_int(eqtb[(hash_size + 3180)].cint); 
122     print_string(");");
123     print_nl(" the previous value will be retained");
124     help2("I can handle only one magnification ratio per job.",
125         "So I've reverted to the magnification you used earlier on this run.");
126     int_error(mag_set); 
127     geq_word_define((hash_size + 3180), mag_set); 
128   } 
129   if ((eqtb[(hash_size + 3180)].cint <= 0)||
130     (eqtb[(hash_size + 3180)].cint > 32768L)) 
131   {
132     print_err("Illegal magnification has been changed to 1000");
133     help1("The magnification ratio must be between 1 and 32768.");
134     int_error(eqtb[(hash_size + 3180)].cint); 
135     geq_word_define((hash_size + 3180), 1000); 
136   } 
137   mag_set = eqtb[(hash_size + 3180)].cint; 
138
139 void token_show_ (halfword p)  
140 {
141 /* begin if p<>null then show_token_list(link(p),null,10000000); l.6289 */
142   if (p != 0)
143   show_token_list(mem[p].hh.v.RH, 0, 10000000L); 
144
145 void print_meaning (void) 
146 {
147   print_cmd_chr(cur_cmd, cur_chr); 
148   if (cur_cmd >= 111)
149   {
150     print_char(58); /* : */
151     print_ln(); 
152     token_show(cur_chr); 
153   } 
154   else if (cur_cmd == 110)
155   {
156     print_char(58); /* : */
157     print_ln(); 
158     token_show(cur_mark[cur_chr]); 
159   } 
160
161 void show_cur_cmd_chr (void) 
162
163   begin_diagnostic(); 
164   print_nl("{");
165   if (mode != shown_mode)
166   {
167     print_mode(mode); 
168     print_string(": ");
169     shown_mode = mode; 
170   } 
171   print_cmd_chr(cur_cmd, cur_chr); 
172   print_char(125);  /* } */
173   end_diagnostic(false); 
174
175 void show_context (void) 
176 {/* 30 */ 
177   char old_setting; 
178   integer nn; 
179   bool bottomline; 
180   integer i; 
181   integer j; 
182   integer l; 
183   integer m; 
184   integer n; 
185   integer p; 
186   integer q; 
187   base_ptr = input_ptr; 
188   input_stack[base_ptr] = cur_input; 
189   nn = -1; 
190   bottomline = false; 
191   while(true){
192     cur_input = input_stack[base_ptr]; 
193     if ((cur_input.state_field != 0)) 
194     if ((cur_input.name_field > 17)||(base_ptr == 0)) 
195     bottomline = true; 
196     if ((base_ptr == input_ptr)|| bottomline ||
197     (nn < eqtb[(hash_size + 3217)].cint)) 
198     {
199 /* begin if (base_ptr=input_ptr) or (state<>token_list) or
200    (token_type<>backed_up) or (loc<>null) then
201     {we omit backed-up token lists that have already been read} l.6761 */
202       if ((base_ptr == input_ptr)||(cur_input.state_field != 0)||(
203       cur_input.index_field != 3)||(cur_input.loc_field != 0)) 
204       {
205   tally = 0; 
206   old_setting = selector;  
207   if (cur_input.state_field != 0)
208   {
209     if (cur_input.name_field <= 17)
210     if ((cur_input.name_field == 0)) 
211       if (base_ptr == 0)print_nl("<*>");   /* <*> */
212       else print_nl("<insert> "); /*  */
213     else {
214       print_nl("<read ");    /* <read  */
215       if (cur_input.name_field == 17)
216       print_char(42);   /* * */
217       else print_int(cur_input.name_field - 1); 
218       print_char(62);   /* > */
219     } 
220     else {
221 /*      print_nl(574); */
222 /*      print_int(line); */
223 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
224       if (c_style_flag) {         /* 94/Mar/21 */
225         print_ln();         /* new line */
226         /* show current input file name - ignore if from terminal */
227         if (cur_input.name_field > 17)  /* redundant ? */
228           print(cur_input.name_field);
229         print_char(40);       /*(*/
230         print_int(line);      /* line number */
231         print_char(41);       /*)*/
232         print_char(32);       /*   */
233         print_char(58);       /* : */
234       }
235       else {
236         print_nl("l.");        /* l. ? 573 ????? 98/Dec/8 check ! */
237         print_int(line);      /* line number */
238       }
239 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
240     } 
241     print_char(32);   /*   */
242     {
243       l = tally; 
244       tally = 0; 
245       selector = 20; 
246       trick_count = 1000000L; 
247     } 
248     if (buffer[cur_input.limit_field]== eqtb[(hash_size + 3211)].cint)
249     j = cur_input.limit_field; 
250     else j = cur_input.limit_field + 1; 
251     if (j > 0)
252     {
253       register integer for_end; 
254       i = cur_input.start_field; 
255       for_end = j - 1; 
256       if (i <= for_end) do 
257       {
258         if (i == cur_input.loc_field)
259         {
260           first_count = tally; 
261           trick_count = tally + 1 + error_line - half_error_line; 
262           if (trick_count < error_line)
263             trick_count = error_line; 
264         } 
265         print(buffer[i]); 
266       } 
267       while(i++ < for_end);
268     } 
269   } 
270   else {
271       
272     switch(cur_input.index_field)
273     {case 0 : 
274       print_nl("<argument> "); /*  */  
275     break; 
276     case 1 : 
277     case 2 : 
278       print_nl("<template> "); /*  */
279       break; 
280     case 3 : 
281       if (cur_input.loc_field == 0)
282       print_nl("<recently read> ");  /*   */
283       else print_nl("<to be read again> "); /*  */
284       break; 
285     case 4 : 
286       print_nl("<inserted text> "); /*  */
287       break; 
288     case 5 : 
289       {
290         print_ln(); 
291         print_cs(cur_input.name_field); 
292       } 
293       break; 
294     case 6 : 
295       print_nl("<output> "); /*  */
296       break; 
297     case 7 : 
298       print_nl("<everypar> "); /*  */
299       break; 
300     case 8 : 
301       print_nl("<everymath> "); /*  */
302       break; 
303     case 9 : 
304       print_nl("<everydisplay> "); /*  */
305       break; 
306     case 10 : 
307       print_nl("<everyhbox> "); /*  */
308       break; 
309     case 11 : 
310       print_nl("<everyvbox> "); /*  */
311       break; 
312     case 12 : 
313       print_nl("<everyjob> "); /*  */
314       break; 
315     case 13 : 
316       print_nl("<everycr> "); /*  */
317       break; 
318     case 14 : 
319       print_nl("<mark> "); /*  */
320       break; 
321     case 15 : 
322       print_nl("<write> "); /*  */
323       break; 
324       default: 
325       print_nl("?");  /* ? */
326       break; 
327     } 
328     {
329       l = tally; 
330       tally = 0; 
331       selector = 20; 
332       trick_count = 1000000L; 
333     } 
334     if (cur_input.index_field < 5)
335     show_token_list(cur_input.start_field, cur_input.loc_field, 100000L 
336   ); 
337     else show_token_list(mem[cur_input.start_field].hh.v.RH, 
338     cur_input.loc_field, 100000L); 
339   } 
340   selector = old_setting; 
341   if (trick_count == 1000000L)
342   {
343     first_count = tally; 
344     trick_count = tally + 1 + error_line - half_error_line; 
345     if (trick_count < error_line)
346       trick_count = error_line; 
347   } 
348   if (tally < trick_count)
349     m = tally - first_count; 
350   else m = trick_count - first_count; 
351   if (l + first_count <= half_error_line){
352     p = 0; 
353     n = l + first_count; 
354   } 
355   else {
356     print_string("...");
357     p = l + first_count - half_error_line + 3; 
358     n = half_error_line; 
359   } 
360   {
361     register integer for_end; 
362     q = p; 
363     for_end = first_count - 1; 
364     if (q  <= for_end) do 
365       print_char(trick_buf[q % error_line]); 
366     while(q++ < for_end);
367   } 
368   print_ln(); 
369   {
370     register integer for_end; 
371     q = 1; 
372     for_end = n; 
373     if (q <= for_end) 
374       do print_char(32);    /*   */
375     while(q++ < for_end);
376   } 
377   if (m + n <= error_line)
378   p = first_count + m; 
379   else p = first_count +(error_line - n - 3); 
380   {
381     register integer for_end; 
382     q = first_count; 
383     for_end = p - 1; 
384     if (q  <= for_end) do 
385       print_char(trick_buf[q % error_line]); 
386     while(q++ < for_end);
387   } 
388   if (m + n > error_line)
389     print_string("...");
390   incr(nn); 
391       } 
392     } 
393     else if (nn == eqtb[(hash_size + 3217)].cint)
394     {
395       print_nl("...");      /*  */
396       incr(nn); 
397     } 
398     if (bottomline)
399     goto lab30; 
400     decr(base_ptr); 
401   } 
402   lab30: cur_input = input_stack[input_ptr]; 
403 }
404 #pragma optimize("g", off)          /* 98/Dec/10 experiment */
405 void begin_token_list_ (halfword p, quarterword t)
406 {
407   {
408     if (input_ptr > max_in_stack)
409     {
410       max_in_stack = input_ptr; 
411 #ifdef ALLOCATEINPUTSTACK
412     if (input_ptr == current_stack_size)
413       input_stack = realloc_input_stack (increment_stack_size);
414     if (input_ptr == current_stack_size){    /* check again after allocation */
415       overflow("input stack size", current_stack_size);
416       return;     // abort_flag set
417     }
418 #else
419     if (input_ptr == stack_size) { /* input stack - not dynamic */
420       overflow("input stack size", stack_size);
421       return;     // abort_flag set
422     }
423 #endif
424     } 
425     input_stack[input_ptr]= cur_input; 
426     incr(input_ptr); 
427   } 
428   cur_input.state_field = 0; 
429   cur_input.start_field = p; 
430   cur_input.index_field = t; 
431   if (t >= 5)
432   {
433     incr(mem[p].hh.v.LH); 
434     if (t == 5)
435     cur_input.limit_field = param_ptr; 
436     else {
437   
438       cur_input.loc_field = mem[p].hh.v.RH; 
439       if (eqtb[(hash_size + 3193)].cint > 1)
440       {
441   begin_diagnostic(); 
442   print_nl("");   /* */
443   switch(t)
444   {case 14 : 
445     print_esc("mark");
446     break; 
447   case 15 : 
448     print_esc("write");
449     break; 
450     default: 
451     print_cmd_chr(72, t + (hash_size + 1307));  /* H */
452     break; 
453   } 
454   print_string("->");
455   token_show(p); 
456   end_diagnostic(false); 
457       } 
458     } 
459   } 
460   else cur_input.loc_field = p; 
461
462 #pragma optimize("", on)          /* 98/Dec/10 experiment */
463 void end_token_list (void) 
464
465   if (cur_input.index_field >= 3)
466   {
467     if (cur_input.index_field <= 4)
468     flush_list(cur_input.start_field); 
469     else {
470       delete_token_ref(cur_input.start_field); 
471       if (cur_input.index_field == 5)
472       while(param_ptr > cur_input.limit_field){
473       decr(param_ptr); 
474       flush_list(param_stack[param_ptr]); 
475       } 
476     } 
477   } 
478   else if (cur_input.index_field == 1)
479   if (align_state > 500000L)align_state = 0; 
480   else {
481     fatal_error("(interwoven alignment preambles are not allowed)"); /*  */
482     return;     // abort_flag set
483   }
484   {
485     decr(input_ptr); 
486     cur_input = input_stack[input_ptr]; 
487   } 
488   {
489     if (interrupt != 0){
490     pause_for_instructions();
491   }
492   } 
493 }
494 void back_input (void) 
495
496   halfword p; 
497   while((cur_input.state_field == 0)&&(cur_input.loc_field == 0)) {
498     end_token_list();
499   }
500   p = get_avail(); 
501   mem[p].hh.v.LH = cur_tok; 
502   if (cur_tok < 768)
503     if (cur_tok < 512)
504       decr(align_state); 
505     else incr(align_state); 
506   {
507     if (input_ptr > max_in_stack)
508     {
509       max_in_stack = input_ptr; 
510 #ifdef ALLOCATEINPUTSTACK
511       if (input_ptr == current_stack_size)
512         input_stack = realloc_input_stack (increment_stack_size);
513       if (input_ptr == current_stack_size){  /* check again after allocation */
514         overflow("input stack size", current_stack_size);
515         return;     // abort_flag set
516       }
517 #else
518       if (input_ptr == stack_size) { /* stack size - not dynamic */
519         overflow("input stack size", stack_size);
520         return;     // abort_flag set
521       }
522 #endif
523     } 
524     input_stack[input_ptr]= cur_input; 
525     incr(input_ptr); 
526   } 
527   cur_input.state_field = 0; 
528   cur_input.start_field = p; 
529   cur_input.index_field = 3; 
530   cur_input.loc_field = p; 
531
532 void back_error (void) 
533
534   OK_to_interrupt = false; 
535   back_input(); 
536   OK_to_interrupt = true; 
537   error(); 
538
539 void ins_error (void) 
540
541     OK_to_interrupt = false; 
542   back_input(); 
543   cur_input.index_field = 4; 
544   OK_to_interrupt = true; 
545   error(); 
546
547 void begin_file_reading (void) 
548
549     if (in_open == max_in_open){
550       overflow("text input levels", max_in_open); /* text input levels - NOT DYNAMIC */
551     return;     // abort_flag set
552   }
553 #ifdef ALLOCATEBUFFER
554     if (first == current_buf_size)
555     buffer = realloc_buffer (increment_buf_size);
556   if (first == current_buf_size) {   /* check again after allocation */
557     overflow("buffer size", current_buf_size);
558     return;     // abort_flag set
559   }
560 #else
561   if (first == buf_size){
562     overflow("buffer size", buf_size);  /* buffer size - not dynamic */
563     return;     // abort_flag set
564   }
565 #endif
566
567   incr(in_open); 
568   if (in_open > high_in_open)     /* 1999 Jan 17 */
569     high_in_open = in_open;
570   {
571     if (input_ptr > max_in_stack)
572     {
573       max_in_stack = input_ptr; 
574 #ifdef ALLOCATEINPUTSTACK
575     if (input_ptr == current_stack_size)
576       input_stack = realloc_input_stack (increment_stack_size);
577     if (input_ptr == current_stack_size){
578       overflow("input stack size", current_stack_size);  /* check again after allocation */
579       return;     // abort_flag set
580     }
581 #else
582     if (input_ptr == stack_size){
583       overflow("input stack size", stack_size);    /* input stack - not dynamic */
584       return;     // abort_flag set
585     }
586 #endif
587     } 
588     input_stack[input_ptr]= cur_input; 
589     incr(input_ptr); 
590   } 
591   cur_input.index_field = in_open; 
592   line_stack[cur_input.index_field]= line; 
593   cur_input.start_field = first; 
594   cur_input.state_field = 1; 
595   cur_input.name_field = 0; 
596
597 void end_file_reading (void) 
598
599   first = cur_input.start_field; 
600   line = line_stack[cur_input.index_field]; 
601   if (cur_input.name_field > 17)
602     (void) a_close(input_file[cur_input.index_field]); 
603   {
604     decr(input_ptr); 
605     cur_input = input_stack[input_ptr]; 
606   } 
607   decr(in_open); 
608
609 /* called only form tex0.c */
610 void clear_for_error_prompt (void) 
611 {
612   while((cur_input.state_field != 0)&&
613      (cur_input.name_field == 0)&&
614      (input_ptr > 0)&&
615      (cur_input.loc_field > cur_input.limit_field)) 
616   end_file_reading(); 
617   print_ln(); 
618
619 void check_outer_validity (void) 
620
621   halfword p; 
622   halfword q; 
623   if (scanner_status != 0)
624   {
625     deletions_allowed = false; 
626     if (cur_cs != 0)
627     {
628       if ((cur_input.state_field == 0)||(cur_input.name_field < 1)||
629       (cur_input.name_field > 17)) 
630       {
631 /*     begin p:=get_avail; info(p):=cs_token_flag+cur_cs; */
632   p = get_avail(); 
633   mem[p].hh.v.LH = 4095 + cur_cs; 
634   begin_token_list(p, 3); 
635       } 
636       cur_cmd = 10; 
637       cur_chr = 32; 
638     } 
639     if (scanner_status > 1)
640     {
641       runaway(); 
642       if (cur_cs == 0)
643         print_err("File ended");
644       else {
645   cur_cs = 0;
646   print_err("Forbidden control sequence found");
647       } 
648       print_string(" while scanning ");
649       p = get_avail(); 
650       switch(scanner_status)
651       {case 2 : 
652   {
653     print_string("definition");
654     mem[p].hh.v.LH = 637; 
655   } 
656   break; 
657       case 3 : 
658   {
659     print_string("use");
660     mem[p].hh.v.LH = par_token; 
661     long_state = 113; 
662   } 
663   break; 
664       case 4 : 
665   {
666     print_string("preamble");
667     mem[p].hh.v.LH = 637; 
668     q = p; 
669     p = get_avail(); 
670     mem[p].hh.v.RH = q; 
671 /*    mem[p].hh.v.LH = (hash_size + 4610);  */
672 /*    mem[p].hh.v.LH = (hash_size + 4095 + 515);  */
673     mem[p].hh.v.LH = (hash_size + hash_extra + 4095 + 515); /*96/Jan/10*/
674     align_state = -1000000L; 
675   } 
676   break; 
677       case 5 : 
678   {
679     print_string("text");
680     mem[p].hh.v.LH = 637; 
681   } 
682   break; 
683       } 
684       begin_token_list(p, 4); 
685       print_string(" of ");
686       sprint_cs(warning_index);
687       help4("I suspect you have forgotten a `}', causing me",
688           "to read past where you wanted me to stop.",
689           "I'll try to recover; but if the error is serious,",
690           "you'd better type `E' or `X' now and fix your file.");
691       error(); 
692     } 
693     else {
694   print_err("Incomplete ");
695       print_cmd_chr(105, cur_if); /* i */
696       print_string("; all text was ignored after line ");
697       print_int(skip_line);
698       help3("A forbidden control sequence occurred in skipped text.",
699           "This kind of error happens when you say `\\if...' and forget",
700           "the matching `\\fi'. I've inserted a `\\fi'; this might work.");
701       if (cur_cs != 0)
702       cur_cs = 0; 
703       else help_line[2]= "The file ended while I was skipping conditional text.";
704 /*      cur_tok = (hash_size + 4613);  */
705 /*      cur_tok = (hash_size + 4095 + 518);  */
706       cur_tok = (hash_size + hash_extra + 4095 + 518); /* 96/Jan/10 */
707       ins_error(); 
708   }
709     deletions_allowed = true; 
710   }
711
712 /*****************************************************************************/
713 /* get_next() moved from here to end for pragma optimize reasons 96/Sep/12 */
714 void get_next(void);
715 /*****************************************************************************/
716 void firm_up_the_line (void) 
717
718   integer k; 
719   cur_input.limit_field = last; 
720   if (eqtb[(hash_size + 3191)].cint > 0)
721     if (interaction > 1) {
722     ; 
723       print_ln(); 
724       if (cur_input.start_field < cur_input.limit_field) {
725         register integer for_end; 
726         k = cur_input.start_field; 
727         for_end = cur_input.limit_field - 1; 
728         if (k <= for_end) do print(buffer[k]); 
729         while(k++ < for_end);
730       } 
731       first = cur_input.limit_field; 
732       {
733       ; 
734         print_string("=>");
735         term_input(615, 0); 
736       } 
737       if (last > first){
738         {
739           register integer for_end; 
740           k = first; 
741           for_end = last - 1; 
742           if (k <= for_end) do 
743             buffer[k + cur_input.start_field - first]= buffer[k]; 
744           while(k++ < for_end);
745         } 
746         cur_input.limit_field = cur_input.start_field + last - first; 
747       } 
748     } 
749
750 void get_token (void) 
751
752   no_new_control_sequence = false; 
753   get_next(); 
754   no_new_control_sequence = true; 
755   if (cur_cs == 0)cur_tok =(cur_cmd * 256)+ cur_chr; 
756   else cur_tok = 4095 + cur_cs; 
757
758 void macro_call (void) 
759 {/* 10 22 30 31 40 */ 
760   halfword r; 
761   halfword p; 
762   halfword q; 
763   halfword s; 
764   halfword t; 
765   halfword u, v; 
766   halfword rbraceptr; 
767   small_number n; 
768   halfword unbalance; 
769   halfword m; 
770   halfword refcount; 
771   small_number savescannerstatus; 
772   halfword savewarningindex; 
773   ASCII_code matchchr; 
774
775   savescannerstatus = scanner_status;  
776   savewarningindex = warning_index; 
777   warning_index = cur_cs; 
778   refcount = cur_chr; 
779   r = mem[refcount].hh.v.RH; 
780   n = 0; 
781   if (eqtb[(hash_size + 3193)].cint > 0)
782   {
783     begin_diagnostic(); 
784     print_ln(); 
785     print_cs(warning_index); 
786     token_show(refcount); 
787     end_diagnostic(false); 
788   } 
789   if (mem[r].hh.v.LH != 3584)
790   {
791     scanner_status = 3; 
792     unbalance = 0; 
793     long_state = eqtb[cur_cs].hh.b0; 
794     if (long_state >= 113)
795     long_state = long_state - 2; 
796     do {
797   mem[temp_head].hh.v.RH = 0; /* repeat link(temp_head):=null; */
798       if ((mem[r].hh.v.LH > 3583)||(mem[r].hh.v.LH < 3328)) 
799       s = 0; /* s:=null l.7984 */
800       else {
801   matchchr = mem[r].hh.v.LH - 3328; 
802   s = mem[r].hh.v.RH; 
803   r = s; 
804   p = temp_head; 
805   m = 0; 
806       } 
807       lab22: get_token(); 
808       if (cur_tok == mem[r].hh.v.LH)
809       {
810   r = mem[r].hh.v.RH; 
811   if ((mem[r].hh.v.LH >= 3328)&&(mem[r].hh.v.LH <= 3584 
812   ))
813   {
814     if (cur_tok < 512)
815     decr(align_state); 
816     goto lab40; 
817   } 
818   else goto lab22; 
819       } 
820       if (s != r)
821       if (s == 0)
822       {
823                   print_err("Use of ");
824   sprint_cs(warning_index); 
825   print_string(" doesn't match its definition");
826   help4("If you say, e.g., `\\def\\a1{...}', then you must always",
827       "put `1' after `\\a', since control sequence names are",
828       "made up of letters only. The macro here has not been",
829       "followed by the required stuff, so I'm ignoring it."); 
830   error(); 
831   goto lab10; 
832       } 
833       else {
834   t = s; 
835   do {
836       { 
837       q = get_avail(); 
838       mem[p].hh.v.RH = q; 
839       mem[q].hh.v.LH = mem[t].hh.v.LH; 
840       p = q; 
841     } 
842     incr(m); 
843     u = mem[t].hh.v.RH; 
844     v = s; 
845     while(true){
846       if (u == r)
847       if (cur_tok != mem[v].hh.v.LH)
848       goto lab30; 
849       else {
850     
851         r = mem[v].hh.v.RH; 
852         goto lab22; 
853       } 
854       if (mem[u].hh.v.LH != mem[v].hh.v.LH)
855       goto lab30; 
856       u = mem[u].hh.v.RH; 
857       v = mem[v].hh.v.RH; 
858     } 
859     lab30: t = mem[t].hh.v.RH; 
860   } while(!(t == r)); 
861   r = s; 
862       } 
863       if (cur_tok == par_token)
864       if (long_state != 112)
865       {
866   if (long_state == 111)
867   {
868     runaway();
869         print_err("Paragraph ended before ");
870     sprint_cs(warning_index); 
871     print_string("was complete");
872     help3("I suspect you've forgotten a `}', causing me to apply this",
873         "control sequence to too much text. How can we recover?",
874         "My plan is to forget the whole thing and hope for the best."); 
875     back_error(); 
876   } 
877   pstack[n]= mem[temp_head].hh.v.RH; 
878   align_state = align_state - unbalance; 
879   {
880     register integer for_end; 
881     m = 0; 
882     for_end = n; 
883     if (m <= for_end) do 
884       flush_list(pstack[m]); 
885     while(m++ < for_end);
886   } 
887   goto lab10; 
888       } 
889       if (cur_tok < 768)
890       if (cur_tok < 512)
891       {
892   unbalance = 1; 
893   while(true){
894     {
895       {
896         q = avail; 
897         if (q == 0)
898         q = get_avail(); 
899         else {
900       
901     avail = mem[q].hh.v.RH; 
902     mem[q].hh.v.RH = 0; 
903   ;
904 #ifdef STAT
905     incr(dyn_used); 
906 #endif /* STAT */
907         } 
908       } 
909       mem[p].hh.v.RH = q; 
910       mem[q].hh.v.LH = cur_tok; 
911       p = q; 
912     } 
913     get_token(); 
914     if (cur_tok == par_token)
915     if (long_state != 112)
916     {
917       if (long_state == 111)
918       {
919         runaway();
920         print_err("Paragraph ended before ");
921         sprint_cs(warning_index); 
922         print_string(" was complete");
923         help3("I suspect you've forgotten a `}', causing me to apply this",
924             "control sequence to too much text. How can we recover?",
925             "My plan is to forget the whole thing and hope for the best.");
926         back_error(); 
927       } 
928       pstack[n]= mem[temp_head].hh.v.RH; 
929       align_state = align_state - unbalance; 
930       {
931       register integer for_end; 
932       m = 0; 
933       for_end = n; 
934       if (m <= for_end) do 
935         flush_list(pstack[m]); 
936       while(m++ < for_end);
937     } 
938       goto lab10; 
939     } 
940     if (cur_tok < 768)
941     if (cur_tok < 512)
942     incr(unbalance); 
943     else {
944         
945       decr(unbalance); 
946       if (unbalance == 0)
947       goto lab31; 
948     } 
949   } 
950   lab31: rbraceptr = p; 
951   {
952     q = get_avail(); 
953     mem[p].hh.v.RH = q; 
954     mem[q].hh.v.LH = cur_tok; 
955     p = q; 
956   } 
957       } 
958       else {
959   back_input();
960   print_err("Argument of ");
961   sprint_cs(warning_index); 
962   print_string(" has an extra }");
963   help6("I've run across a `}' that doesn't seem to match anything.",
964           "For example, `\\def\\a#1{...}' and `\\a}' would produce",
965           "this error. If you simply proceed now, the `\\par' that",
966           "I've just inserted will cause me to report a runaway",
967           "argument that might be the root of the problem. But if",
968           "your `}' was spurious, just type `2' and it will go away.");
969   incr(align_state); 
970   long_state = 111; 
971   cur_tok = par_token; 
972 /* 420 in tex82.bug */
973   ins_error();
974   goto lab22;
975       } 
976       else {
977   if (cur_tok == 2592)
978   if (mem[r].hh.v.LH <= 3584)
979   if (mem[r].hh.v.LH >= 3328)
980   goto lab22; 
981   {
982     q = get_avail(); 
983     mem[p].hh.v.RH = q;   /* p may be used without having ... */
984     mem[q].hh.v.LH = cur_tok; 
985     p = q; 
986   } 
987       } 
988       incr(m);          /* m may be used without having been ... */
989       if (mem[r].hh.v.LH > 3584)
990       goto lab22; 
991       if (mem[r].hh.v.LH < 3328)
992       goto lab22; 
993       lab40: if (s != 0)
994       {
995   if ((m == 1)&&(mem[p].hh.v.LH < 768)&&(p != temp_head 
996   ))
997   {
998     mem[rbraceptr].hh.v.RH = 0; /* rbraceptr may be used without ... */
999     {
1000       mem[p].hh.v.RH = avail; 
1001       avail = p; 
1002   ;
1003 #ifdef STAT
1004       decr(dyn_used); 
1005 #endif /* STAT */
1006     } 
1007     p = mem[temp_head].hh.v.RH; 
1008     pstack[n]= mem[p].hh.v.RH; 
1009     {
1010       mem[p].hh.v.RH = avail; 
1011       avail = p; 
1012   ;
1013 #ifdef STAT
1014       decr(dyn_used); 
1015 #endif /* STAT */
1016     } 
1017   } 
1018   else pstack[n]= mem[temp_head].hh.v.RH; 
1019   incr(n); 
1020   if (eqtb[(hash_size + 3193)].cint > 0)
1021   {
1022     begin_diagnostic(); 
1023     print_nl(matchchr); /* matchchar may be used without ... */
1024     print_int(n); 
1025     print_string("<-");
1026     show_token_list(pstack[n - 1], 0, 1000); 
1027     end_diagnostic(false); 
1028   } 
1029       } 
1030     } while(!(mem[r].hh.v.LH == 3584)); 
1031   } 
1032 /* while (state=token_list)and(loc=null) do end_token_list; l.7956 */
1033   while((cur_input.state_field == 0)&&(cur_input.loc_field == 0)) 
1034   end_token_list(); 
1035   begin_token_list(refcount, 5); 
1036   cur_input.name_field = warning_index; 
1037   cur_input.loc_field = mem[r].hh.v.RH; 
1038   if (n > 0)
1039   {
1040     if (param_ptr + n > max_param_stack)
1041     {
1042       max_param_stack = param_ptr + n; 
1043 #ifdef ALLOCATEPARAMSTACK
1044     if (max_param_stack > current_param_size)
1045       param_stack = realloc_param_stack (increment_param_size);
1046     if (max_param_stack > current_param_size){ /* check again after allocation */
1047       overflow("parameter stack size", current_param_size);
1048       return;     // abort_flag set
1049     }
1050 #else
1051     if (max_param_stack > param_size){
1052       overflow("parameter stack size", param_size); /* parameter stack - not dynamic */
1053       return;     // abort_flag set
1054     }
1055 #endif
1056     } 
1057     {
1058     register integer for_end; 
1059     m = 0; 
1060     for_end = n - 1; 
1061     if (m <= for_end) 
1062       do param_stack[param_ptr + m]= pstack[m]; 
1063     while(m++ < for_end);
1064   } 
1065     param_ptr = param_ptr + n; 
1066   } 
1067   lab10: scanner_status = savescannerstatus; 
1068   warning_index = savewarningindex; 
1069 }
1070 void insert_relax (void) 
1071 {
1072 /* begin cur_tok:=cs_token_flag+cur_cs; back_input; */
1073   cur_tok = 4095 + cur_cs; 
1074   back_input(); 
1075 /* cur_tok:=cs_token_flag+frozen_relax; back_input; token_type:=inserted; */
1076 /*  cur_tok = (hash_size + 4616);  */
1077 /*  cur_tok = (hash_size + 4095 + 521);  */
1078   cur_tok = (hash_size + hash_extra + 4095 + 521);  /* 96/Jan/10 */
1079   back_input(); 
1080   cur_input.index_field = 4; 
1081
1082 void expand (void) 
1083 {
1084   halfword t; 
1085   halfword p, q, r; 
1086   integer j; 
1087   integer cvbackup; 
1088   small_number cvlbackup, radixbackup, cobackup; 
1089   halfword backupbackup; 
1090   small_number savescannerstatus; 
1091
1092   cvbackup = cur_val; 
1093   cvlbackup = cur_val_level;  
1094   radixbackup = radix;  
1095   cobackup = cur_order;  
1096   backupbackup = mem[mem_top - 13].hh.v.RH; 
1097   if (cur_cmd < 111)
1098   {
1099     if (eqtb[(hash_size + 3199)].cint > 1)
1100     show_cur_cmd_chr(); 
1101     switch(cur_cmd)
1102     {case 110 : 
1103       {
1104 /* begin if cur_mark[cur_chr]<>null then l.7881 */
1105   if (cur_mark[cur_chr]!= 0)
1106   begin_token_list(cur_mark[cur_chr], 14); 
1107       } 
1108       break; 
1109     case 102 : 
1110       {
1111   get_token(); 
1112   t = cur_tok; 
1113   get_token(); 
1114   if (cur_cmd > 100){
1115     expand();
1116   }
1117   else back_input(); 
1118   cur_tok = t; 
1119   back_input(); 
1120       } 
1121       break; 
1122     case 103 : 
1123       {
1124   savescannerstatus = scanner_status;  
1125   scanner_status = 0; 
1126   get_token(); 
1127   scanner_status = savescannerstatus; 
1128   t = cur_tok; 
1129   back_input(); 
1130   if (t >= 4095)   /* if t>=cs_token_flag then */
1131   {
1132 /*   begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; */
1133     p = get_avail(); 
1134 /*    mem[p].hh.v.LH = (hash_size + 4618);  */
1135 /*    mem[p].hh.v.LH = (hash_size + 4095 + 523); */
1136     mem[p].hh.v.LH = (hash_size + hash_extra + 4095 + 523); /*96/Jan/10*/
1137     mem[p].hh.v.RH = cur_input.loc_field; 
1138     cur_input.start_field = p; 
1139     cur_input.loc_field = p; 
1140   } 
1141       } 
1142       break; 
1143     case 107 : 
1144       {
1145   r = get_avail(); 
1146   p = r; 
1147   do {
1148       get_x_token(); 
1149     if (cur_cs == 0){
1150       q = get_avail(); 
1151       mem[p].hh.v.RH = q; 
1152       mem[q].hh.v.LH = cur_tok; 
1153       p = q; 
1154     } 
1155   } while(!(cur_cs != 0)); 
1156   if (cur_cmd != 67)
1157   {
1158           print_err("Missing ");
1159     print_esc("endcsname");
1160     print_string(" inserted");
1161     help2("The control sequence marked <to be read again> should",
1162         "not appear between \\csname and \\endcsname.");
1163     back_error(); 
1164   } 
1165   j = first; 
1166   p = mem[r].hh.v.RH; 
1167   while(p != 0){  /* while p<>null do l.7742 */
1168       
1169     if (j >= max_buf_stack)
1170     {
1171       max_buf_stack = j + 1; 
1172 #ifdef ALLOCATEBUFFER
1173     if (max_buf_stack == current_buf_size)
1174       buffer = realloc_buffer (increment_buf_size);
1175     if (max_buf_stack == current_buf_size){  /* check again after allocation */
1176       overflow("buffer size", current_buf_size);
1177       return;     // abort_flag set
1178     }
1179 #else
1180     if (max_buf_stack == buf_size){
1181       overflow("buffer size", buf_size); /* buffer size - not dynamic */
1182       return;     // abort_flag set
1183     }
1184 #endif
1185     } 
1186     buffer[j]= mem[p].hh.v.LH % 256; 
1187 /*    buffer[j]= mem[p].hh.v.LH & 255; */ /* last 8 bits */
1188     incr(j); 
1189     p = mem[p].hh.v.RH; 
1190   } 
1191   if (j > first + 1)
1192   {
1193     no_new_control_sequence = false; 
1194     cur_cs = id_lookup(first, j - first); 
1195     no_new_control_sequence = true; 
1196   } 
1197   else if (j == first)
1198   cur_cs = 513; 
1199 /* else cur_cs:=single_base+buffer[first] {the list has length one} */
1200   else cur_cs = 257 + buffer[first]; 
1201   flush_list(r); 
1202   if (eqtb[cur_cs].hh.b0 == 101)
1203   {
1204     eq_define(cur_cs, 0, 256); 
1205   } 
1206   cur_tok = cur_cs + 4095; 
1207   back_input(); 
1208       } 
1209       break; 
1210     case 108 : 
1211       conv_toks(); 
1212       break; 
1213     case 109 : 
1214       ins_the_toks(); 
1215       break; 
1216     case 105 : 
1217       conditional(); 
1218       break; 
1219     case 106 : 
1220       if (cur_chr > if_limit)
1221       if (if_limit == 1)
1222       insert_relax(); 
1223       else {
1224     print_err("Extra ");
1225   print_cmd_chr(106, cur_chr);  /* j */
1226   help1("I'm ignoring this; it doesn't match any \\if.");
1227   error(); 
1228       } 
1229       else {
1230     
1231   while(cur_chr != 2)pass_text(); 
1232   {
1233     p = cond_ptr; 
1234     if_line = mem[p + 1].cint; 
1235     cur_if = mem[p].hh.b1; 
1236     if_limit = mem[p].hh.b0; 
1237     cond_ptr = mem[p].hh.v.RH; 
1238     free_node(p, 2); 
1239   } 
1240       } 
1241       break; 
1242     case 104 : 
1243       if (cur_chr > 0)force_eof = true; 
1244       else if (name_in_progress)insert_relax(); 
1245       else start_input(); 
1246       break; 
1247       default: 
1248       {
1249                   print_err("Undefined control sequence");
1250                   help5("The control sequence at the end of the top line",
1251                           "of your error message was never \\def'ed. If you have",
1252                           "misspelled it (e.g., `\\hobx'), type `I' and the correct",
1253                           "spelling (e.g., `I\\hbox'). Otherwise just continue,",
1254                           "and I'll forget about whatever was undefined."); 
1255   error(); 
1256       } 
1257       break; 
1258     } 
1259   } 
1260   else if (cur_cmd < 115){
1261     macro_call();
1262   }
1263   else {
1264       
1265 /*    cur_tok = (hash_size + 4615);  */
1266 /*    cur_tok = (hash_size + 4095 + 520);  */
1267     cur_tok = (hash_size + hash_extra + 4095 + 520); /* 96/Jan/10 */
1268     back_input(); 
1269   } 
1270   cur_val = cvbackup; 
1271   cur_val_level = cvlbackup; 
1272   radix = radixbackup; 
1273   cur_order = cobackup; 
1274   mem[mem_top - 13].hh.v.RH = backupbackup; 
1275
1276 void get_x_token (void) 
1277 {/* 20 30 */ 
1278
1279 lab20:
1280   get_next(); 
1281   if (cur_cmd <= 100) goto lab30; 
1282   if (cur_cmd >= 111)
1283     if (cur_cmd < 115){
1284       macro_call();
1285     }
1286     else {
1287 /*      cur_cs = (hash_size + 520);  */
1288       cur_cs = (hash_size + hash_extra + 520);  /* 96/Jan/10 */
1289       cur_cmd = 9; 
1290       goto lab30; 
1291     } 
1292   else {
1293     expand();
1294   }
1295   goto lab20; 
1296 lab30: if (cur_cs == 0)
1297        cur_tok =(cur_cmd * 256)+ cur_chr; 
1298      else cur_tok = 4095 + cur_cs; 
1299
1300 void x_token (void) 
1301 {
1302   while(cur_cmd > 100){
1303     expand(); 
1304     get_next(); 
1305   } 
1306   if (cur_cs == 0)
1307   cur_tok =(cur_cmd * 256)+ cur_chr; 
1308   else cur_tok = 4095 + cur_cs; 
1309
1310 void scan_left_brace (void) 
1311
1312   do {
1313       get_x_token(); 
1314   } while(!((cur_cmd != 10)&&(cur_cmd != 0))); 
1315   if (cur_cmd != 1)
1316   {
1317         print_err("Missing { inserted"); 
1318         help4("A left brace was mandatory here, so I've put one in.",
1319                 "You might want to delete and/or insert some corrections",
1320                 "so that I will find a matching right brace soon.",
1321                 "(If you're confused by all this, try typing `I}' now.)");
1322     back_error(); 
1323     cur_tok = 379; 
1324     cur_cmd = 1; 
1325     cur_chr = 123; 
1326     incr(align_state); 
1327   } 
1328
1329 void scan_optional_equals (void) 
1330 {
1331   do {
1332       get_x_token(); 
1333   } while(!(cur_cmd != 10)); 
1334   if (cur_tok != 3133)back_input(); 
1335
1336 bool scan_keyword_(char * s)
1337 {/* 10 */ register bool Result; 
1338   halfword p; 
1339   halfword q; 
1340   char * k; 
1341   p = mem_top - 13; 
1342   mem[p].hh.v.RH = 0; 
1343   k = s; 
1344   while(*k) {
1345     get_x_token(); 
1346     if ((cur_cs == 0) && ((cur_chr == (*k))||(cur_chr == (*k)- 32))) {
1347       {
1348   q = get_avail(); 
1349   mem[p].hh.v.RH = q; 
1350   mem[q].hh.v.LH = cur_tok; 
1351   p = q; 
1352       } 
1353       incr(k); 
1354     } 
1355     else if ((cur_cmd != 10)||(p != mem_top - 13)) 
1356     {
1357       back_input(); 
1358       if (p != mem_top - 13)
1359       begin_token_list(mem[mem_top - 13].hh.v.RH, 3); 
1360       Result = false; 
1361       return(Result); 
1362     } 
1363   } 
1364   flush_list(mem[mem_top - 13].hh.v.RH); 
1365   Result = true; 
1366   return Result; 
1367
1368 void mu_error (void) 
1369
1370   print_err("Incompatible glue units");
1371   help1("I'm going to assume that 1mu=1pt when they're mixed."); 
1372   error(); 
1373
1374 void scan_eight_bit_int (void) 
1375
1376     scan_int(); 
1377   if ((cur_val < 0)||(cur_val > 255)) 
1378   {
1379           print_err("Bad register code");
1380           help2("A register number must be between 0 and 255.",
1381                   "I changed this one to zero.");
1382     int_error(cur_val); 
1383     cur_val = 0; 
1384   } 
1385
1386 void scan_char_num (void) 
1387 {
1388     scan_int(); 
1389   if ((cur_val < 0)||(cur_val > 255)) 
1390   {
1391           print_err("Bad character code");
1392           help2("A character number must be between 0 and 255.",
1393                   "I changed this one to zero.");
1394     int_error(cur_val); 
1395     cur_val = 0; 
1396   } 
1397
1398 void scan_four_bit_int (void) 
1399 {
1400     scan_int(); 
1401   if ((cur_val < 0)||(cur_val > 15)) 
1402   {
1403           print_err("Bad number");
1404           help2("Since I expected to read a number between 0 and 15,",
1405                   "I changed this one to zero.");
1406     int_error(cur_val); 
1407     cur_val = 0; 
1408   } 
1409
1410 void scan_fifteen_bit_int (void) 
1411
1412     scan_int(); 
1413   if ((cur_val < 0)||(cur_val > 32767)) 
1414   {
1415           print_err("Bad mathchar");
1416           help2("A mathchar number must be between 0 and 32767.",
1417                   "I changed this one to zero.");
1418     int_error(cur_val); 
1419     cur_val = 0; 
1420   } 
1421
1422 void scan_twenty_seven_bit_int (void) 
1423
1424     scan_int(); 
1425   if ((cur_val < 0)||(cur_val > 134217727L)) /* 2^27 - 1 */
1426   {
1427           print_err("Bad delimiter code");
1428           help2("A numeric delimiter code must be between 0 and 2^{27}-1.",
1429                   "I changed this one to zero.");
1430     int_error(cur_val); 
1431     cur_val = 0; 
1432   } 
1433
1434 void scan_font_ident (void) 
1435 {
1436   internal_font_number f; 
1437   halfword m; 
1438   do {
1439       get_x_token(); 
1440   } while(!(cur_cmd != 10)); 
1441   if (cur_cmd == 88)
1442   f = eqtb[(hash_size + 1834)].hh.v.RH; 
1443   else if (cur_cmd == 87)
1444   f = cur_chr; 
1445   else if (cur_cmd == 86)
1446   {
1447     m = cur_chr; 
1448     scan_four_bit_int(); 
1449     f = eqtb[m + cur_val].hh.v.RH; 
1450   } 
1451   else {
1452       print_err("Missing font identifier");
1453           help2("I was looking for a control sequence whose",
1454                   "current meaning has been defined by \\font.");
1455     back_error(); 
1456     f = 0; 
1457   }
1458   cur_val = f; 
1459
1460 void find_font_dimen_(bool writing)
1461
1462   internal_font_number f; 
1463   integer n; 
1464   scan_int(); 
1465   n = cur_val; 
1466   scan_font_ident(); 
1467   f = cur_val; 
1468 /*  if (n <= 0)*/            /* change 98/Oct/5 */
1469   if (n < 0 || (n == 0 && font_dimen_zero == 0))
1470     cur_val = fmem_ptr; 
1471   else {
1472 /* else  begin if writing and(n<=space_shrink_code)and@|
1473     (n>=space_code)and(font_glue[f]<>null) then
1474     begin delete_glue_ref(font_glue[f]); l.11225 */
1475     if (writing &&(n <= 4)&&(n >= 2)&&(font_glue[f]!= 0)) 
1476     {
1477     delete_glue_ref(font_glue[f]); 
1478     font_glue[f]= 0;  /* font_glue[f]:=null */
1479     } 
1480     if (n > font_params[f])
1481     if (f < font_ptr)
1482       cur_val = fmem_ptr; 
1483     else {
1484       do {
1485 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1486  #ifdef ALLOCATEFONT
1487         if (fmem_ptr == current_font_mem_size) { /* 93/Nov/28 ??? */
1488           font_info = realloc_font_info(increment_font_mem_size);
1489         }
1490         if (fmem_ptr == current_font_mem_size){    /* 94/Jan/24 */
1491           overflow("font memory", current_font_mem_size); /* font memory */
1492           return;     // abort_flag set
1493         }
1494 #else
1495 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1496         if (fmem_ptr == font_mem_size){
1497           overflow("font memory", font_mem_size); /* font memory */
1498           return;     // abort_flag set
1499         }
1500 #endif
1501         font_info[fmem_ptr].cint = 0; 
1502         incr(fmem_ptr); 
1503         incr(font_params[f]); 
1504       } while(!(n == font_params[f])); 
1505       cur_val = fmem_ptr - 1; 
1506     } 
1507 /*  else cur_val = n + param_base[f];   */      /* 98/Oct/5 */
1508   else if (n > 0) cur_val = n + param_base[f];    /* 98/Oct/5 */
1509   else cur_val = &font_check[f] - &font_info[0]; /* 98/Oct/5 */
1510 /*  checksum =  (((font_check[f].b0) << 8 | font_check[f].b1) << 8 |
1511         font_check[f].b2) << 8 | font_check[f].b3; */
1512   } 
1513 /* compiler error: '-' : incompatible types - from 'union fmemoryword *' to 'struct fourunsignedchars *' */
1514   if (cur_val == fmem_ptr){
1515           print_err("Font ");
1516 /*    print_esc(hash[(hash_size + 524) + f].v.RH); */
1517     //print_esc(hash[(hash_size + hash_extra + 524) + f].v.RH); /*96/Jan/10*/
1518           print_esc("");print(hash[(hash_size + hash_extra + 524) + f].v.RH);
1519     print_string(" has only ");
1520     print_int(font_params[f]); 
1521     print_string(" fontdimen parameters");
1522         help2("To increase the number of font parameters, you must",
1523                 "use \\fontdimen immediately after the \\font is loaded.");
1524     error(); 
1525   }
1526
1527
1528 /* NOTE: the above use of /fontdimen0 to access the checksum is a kludge */
1529 /* In future would be better to do this by allocating one more slot for */
1530 /* for parameters when a font is read rather than carry checksum separately */
1531 /* The above gets the value byte order reversed ... 98/Oct/5 */
1532
1533 void scan_something_internal_(small_number level, bool negative)
1534
1535   halfword m; 
1536   integer p; 
1537   m = cur_chr; 
1538   switch(cur_cmd)
1539   {case 85 : 
1540     {
1541       scan_char_num(); 
1542       if (m == (hash_size + 2907))
1543       {
1544   cur_val = eqtb[(hash_size + 2907) + cur_val].hh.v.RH; 
1545   cur_val_level = 0; 
1546       } 
1547       else if (m < (hash_size + 2907))
1548       {
1549   cur_val = eqtb[m + cur_val].hh.v.RH; 
1550   cur_val_level = 0; 
1551       } 
1552       else {
1553     
1554   cur_val = eqtb[m + cur_val].cint; 
1555   cur_val_level = 0; 
1556       } 
1557     } 
1558     break; 
1559   case 71 : 
1560   case 72 : 
1561   case 86 : 
1562   case 87 : 
1563   case 88 : 
1564     if (level != 5)
1565     {
1566                 print_err("Missing number, treated as zero");
1567                 help3("A number should have been here; I inserted `0'.",
1568                         "(If you can't figure out why I needed to see a number,",
1569                         "look up `weird error' in the index to The TeXbook.)"); 
1570       back_error(); 
1571       {
1572       cur_val = 0; 
1573       cur_val_level = 1; 
1574       } 
1575     } 
1576     else if (cur_cmd <= 72)
1577     {
1578       if (cur_cmd < 72)
1579       {
1580   scan_eight_bit_int(); 
1581   m = (hash_size + 1322) + cur_val; 
1582       } 
1583       {
1584   cur_val = eqtb[m].hh.v.RH; 
1585   cur_val_level = 5; 
1586       } 
1587     } 
1588     else {
1589   
1590       back_input(); 
1591       scan_font_ident(); 
1592       {
1593 /*  cur_val = (hash_size + 524) + cur_val;  */
1594   cur_val = (hash_size + hash_extra + 524) + cur_val; /* 96/Jan/10 */
1595   cur_val_level = 4; 
1596       } 
1597     } 
1598     break; 
1599   case 73 : 
1600     {
1601       cur_val = eqtb[m].cint; 
1602       cur_val_level = 0; 
1603     } 
1604     break; 
1605   case 74 : 
1606     {
1607       cur_val = eqtb[m].cint; 
1608       cur_val_level = 1; 
1609     } 
1610     break; 
1611   case 75 : 
1612     {
1613       cur_val = eqtb[m].hh.v.RH; 
1614       cur_val_level = 2; 
1615     } 
1616     break; 
1617   case 76 : 
1618     {
1619       cur_val = eqtb[m].hh.v.RH; 
1620       cur_val_level = 3; 
1621     } 
1622     break; 
1623   case 79 : 
1624     if (abs(mode)!= m)
1625     {
1626                 print_err("Improper ");
1627       print_cmd_chr(79, m); /* O */
1628           help4("You can refer to \\spacefactor only in horizontal mode;",
1629                   "you can refer to \\prevdepth only in vertical mode; and",
1630                   "neither of these is meaningful inside \\write. So",
1631                   "I'm forgetting what you said and using zero instead.");
1632       error(); 
1633       if (level != 5) {
1634       cur_val = 0; 
1635       cur_val_level = 1; 
1636       } 
1637       else {
1638     
1639   cur_val = 0; 
1640   cur_val_level = 0; 
1641       } 
1642     } 
1643     else if (m == 1)
1644     {
1645       cur_val = cur_list.aux_field.cint; 
1646       cur_val_level = 1; 
1647     } 
1648     else {
1649   
1650       cur_val = space_factor; 
1651       cur_val_level = 0; 
1652     } 
1653     break; 
1654   case 80 : 
1655     if (mode == 0)
1656     {
1657       cur_val = 0; 
1658       cur_val_level = 0; 
1659     } 
1660     else {
1661   
1662       nest[nest_ptr]= cur_list; 
1663       p = nest_ptr; 
1664       while(abs(nest[p].mode_field)!= 1)decr(p); 
1665       {
1666   cur_val = nest[p].pg_field; 
1667   cur_val_level = 0; 
1668       } 
1669     } 
1670     break; 
1671   case 82 : 
1672     {
1673       if (m == 0)
1674       cur_val = dead_cycles; 
1675       else cur_val = insert_penalties; 
1676       cur_val_level = 0; 
1677     } 
1678     break; 
1679   case 81 : 
1680     {
1681       if ((page_contents == 0)&&(! output_active)) 
1682       if (m == 0)
1683       cur_val = 1073741823L;  /* 2^30 - 1 */
1684       else cur_val = 0; 
1685       else cur_val = page_so_far[m]; 
1686       cur_val_level = 1; 
1687     } 
1688     break; 
1689   case 84 : 
1690     {
1691       if (eqtb[(hash_size + 1312)].hh.v.RH == 0)
1692       cur_val = 0; 
1693       else cur_val = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH; 
1694       cur_val_level = 0; 
1695     } 
1696     break; 
1697   case 83 : 
1698     {
1699       scan_eight_bit_int(); 
1700       if (eqtb[(hash_size + 1578) + cur_val].hh.v.RH == 0)
1701       cur_val = 0; 
1702       else cur_val = mem[eqtb[(hash_size + 1578) + cur_val].hh.v.RH + m].cint; 
1703       cur_val_level = 1; 
1704     } 
1705     break; 
1706   case 68 : 
1707   case 69 : 
1708     {
1709       cur_val = cur_chr; 
1710       cur_val_level = 0; 
1711     } 
1712     break; 
1713   case 77 : 
1714     {
1715       find_font_dimen(false); 
1716       font_info[fmem_ptr].cint = 0; 
1717       {
1718   cur_val = font_info[cur_val].cint; 
1719   cur_val_level = 1; 
1720       } 
1721     } 
1722     break; 
1723   case 78 : 
1724     {
1725       scan_font_ident(); 
1726       if (m == 0){
1727   cur_val = hyphen_char[cur_val]; 
1728   cur_val_level = 0; 
1729       } 
1730       else {
1731     
1732   cur_val = skew_char[cur_val]; 
1733   cur_val_level = 0; 
1734       } 
1735     } 
1736     break; 
1737   case 89 : 
1738     {
1739       scan_eight_bit_int(); 
1740       switch(m)
1741       {case 0 : 
1742   cur_val = eqtb[(hash_size + 3218) + cur_val].cint; 
1743   break; 
1744       case 1 : 
1745   cur_val = eqtb[(hash_size + 3751) + cur_val].cint; 
1746   break; 
1747       case 2 : 
1748   cur_val = eqtb[(hash_size + 800) + cur_val].hh.v.RH; 
1749   break; 
1750       case 3 : 
1751   cur_val = eqtb[(hash_size + 1056) + cur_val].hh.v.RH; 
1752   break; 
1753       } 
1754       cur_val_level = m; 
1755     } 
1756     break; 
1757   case 70 : 
1758     if (cur_chr > 2)
1759     {
1760       if (cur_chr == 3)
1761       cur_val = line; 
1762       else cur_val = last_badness; 
1763       cur_val_level = 0; 
1764     } 
1765     else {
1766   
1767       if (cur_chr == 2)
1768       cur_val = 0; 
1769       else cur_val = 0; 
1770       cur_val_level = cur_chr; 
1771       if (!(tail >= hi_mem_min)&&(mode != 0)
1772     )
1773       switch(cur_chr)
1774       {case 0 : 
1775   if (mem[tail].hh.b0 == 12)
1776   cur_val = mem[tail + 1].cint; 
1777   break; 
1778       case 1 : 
1779   if (mem[tail].hh.b0 == 11)
1780   cur_val = mem[tail + 1].cint; 
1781   break; 
1782       case 2 : 
1783   if (mem[tail].hh.b0 == 10)
1784   {
1785     cur_val = mem[tail + 1].hh.v.LH; 
1786     if (mem[tail].hh.b1 == 99)
1787     cur_val_level = 3; 
1788   } 
1789   break; 
1790       } 
1791       else if ((mode == 1)&&(tail == cur_list 
1792      .head_field)) 
1793       switch(cur_chr)
1794       {case 0 : 
1795   cur_val = last_penalty; 
1796   break; 
1797       case 1 : 
1798   cur_val = last_kern; 
1799   break; 
1800       case 2 : 
1801 /*  if (last_glue != 262143L) */ /* NO! */
1802   if (last_glue != empty_flag)
1803   cur_val = last_glue; 
1804   break; 
1805       } 
1806     } 
1807     break; 
1808     default: 
1809     {
1810                 print_err("You can't use `");
1811       print_cmd_chr(cur_cmd, cur_chr); 
1812       print_string("' after ");
1813       print_esc("the");
1814           help1("I'm forgetting what you said and using zero instead."); 
1815       error(); 
1816       if (level != 5){
1817       cur_val = 0; 
1818       cur_val_level = 1; 
1819       } 
1820       else {
1821       cur_val = 0; 
1822       cur_val_level = 0; 
1823       } 
1824     } 
1825     break; 
1826   } 
1827   while(cur_val_level > level){
1828       
1829     if (cur_val_level == 2)
1830     cur_val = mem[cur_val + 1].cint; 
1831     else if (cur_val_level == 3){
1832     mu_error(); 
1833   }
1834     decr(cur_val_level); 
1835   } 
1836   if (negative)
1837   if (cur_val_level >= 2)
1838   {
1839     cur_val = new_spec(cur_val); 
1840     {
1841       mem[cur_val + 1].cint = - (integer) mem[cur_val + 1].cint; 
1842       mem[cur_val + 2].cint = - (integer) mem[cur_val + 2].cint; 
1843       mem[cur_val + 3].cint = - (integer) mem[cur_val + 3].cint; 
1844     } 
1845   } 
1846   else cur_val = - (integer) cur_val; 
1847   else if ((cur_val_level >= 2)&&(cur_val_level <= 3)) 
1848   incr(mem[cur_val].hh.v.RH); 
1849
1850
1851 /*****************************************************************************/
1852
1853 /* Moved here to avoid question about pragma optimize 96/Sep/12 */
1854
1855 /* #pragma optimize ("a", off) */
1856
1857 void get_next (void) 
1858 {/* 20 25 21 26 40 10 */ 
1859   integer k; 
1860   halfword t; 
1861 /*  char cat; */    /* make this an int ? */
1862   int cat;      /* make this an int ? 95/Jan/7 */
1863   ASCII_code c, cc; 
1864   char d; 
1865
1866 lab20:
1867   cur_cs = 0; 
1868   if (cur_input.state_field != 0) {
1869     lab25: if (cur_input.loc_field <= cur_input.limit_field) {
1870       cur_chr = buffer[cur_input.loc_field]; 
1871       incr(cur_input.loc_field); 
1872       lab21: cur_cmd = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
1873       switch(cur_input.state_field + cur_cmd)
1874       {case 10 : 
1875       case 26 : 
1876       case 42 : 
1877       case 27 : 
1878       case 43 : 
1879   goto lab25; 
1880   break; 
1881       case 1 : 
1882       case 17 : 
1883       case 33 : 
1884   {
1885     if (cur_input.loc_field > cur_input.limit_field)
1886     cur_cs = 513; 
1887     else {
1888         
1889       lab26: k = cur_input.loc_field; 
1890       cur_chr = buffer[k]; 
1891       cat = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
1892       incr(k); 
1893       if (cat == 11)
1894       cur_input.state_field = 17; 
1895       else if (cat == 10)
1896       cur_input.state_field = 17; 
1897       else cur_input.state_field = 1; 
1898       if ((cat == 11)&&(k <= cur_input.limit_field)) 
1899       {
1900         do {
1901       cur_chr = buffer[k]; 
1902     cat = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
1903     incr(k); 
1904         } while(!((cat != 11)||(k > cur_input.limit_field)))
1905      ; 
1906         {
1907     if (buffer[k]== cur_chr)
1908     if (cat == 7)
1909     if (k < cur_input.limit_field)
1910     {
1911       c = buffer[k + 1]; 
1912       if (c < 128)
1913       {
1914         d = 2; 
1915         if ((((c >= 48)&&(c <= 57)) ||((c >= 97)&& 
1916        (c <= 102)))) 
1917         if (k + 2 <= cur_input.limit_field)
1918         {
1919           cc = buffer[k + 2]; 
1920           if ((((cc >= 48)&&(cc <= 57)) ||((cc >= 97 
1921         )&&(cc <= 102)))) 
1922           incr(d); 
1923         } 
1924         if (d > 2)
1925         {
1926           if (c <= 57)
1927           cur_chr = c - 48; 
1928           else cur_chr = c - 87; 
1929           if (cc <= 57)
1930           cur_chr = 16 * cur_chr + cc - 48; 
1931           else cur_chr = 16 * cur_chr + cc - 87; 
1932           buffer[k - 1]= cur_chr; 
1933         } 
1934         else if (c < 64)
1935         buffer[k - 1]= c + 64; 
1936         else buffer[k - 1]= c - 64; 
1937         cur_input.limit_field = cur_input.limit_field - d; 
1938         first = first - d; 
1939         while(k <= cur_input.limit_field){
1940       
1941           buffer[k]= buffer[k + d]; 
1942           incr(k); 
1943         } 
1944         goto lab26; 
1945       } 
1946     } 
1947         } 
1948         if (cat != 11)
1949         decr(k); 
1950         if (k > cur_input.loc_field + 1)
1951         {
1952     cur_cs = id_lookup(cur_input.loc_field, k - cur_input.loc_field 
1953     ); 
1954     cur_input.loc_field = k; 
1955     goto lab40; 
1956         } 
1957       } 
1958       else {
1959     
1960         if (buffer[k]== cur_chr)
1961         if (cat == 7)
1962         if (k < cur_input.limit_field)
1963         {
1964     c = buffer[k + 1]; 
1965     if (c < 128)             /* ? */
1966     {
1967       d = 2; 
1968       if ((((c >= 48)&&(c <= 57)) ||((c >= 97)&&(
1969       c <= 102)))) 
1970       if (k + 2 <= cur_input.limit_field)
1971       {
1972         cc = buffer[k + 2]; 
1973         if ((((cc >= 48)&&(cc <= 57)) ||((cc >= 97)
1974         &&(cc <= 102)))) 
1975         incr(d); 
1976       } 
1977       if (d > 2)
1978       {
1979         if (c <= 57)
1980         cur_chr = c - 48; 
1981         else cur_chr = c - 87; 
1982         if (cc <= 57)          /* cc may be used without ... */
1983         cur_chr = 16 * cur_chr + cc - 48; 
1984         else cur_chr = 16 * cur_chr + cc - 87; 
1985         buffer[k - 1]= cur_chr; 
1986       } 
1987       else if (c < 64)
1988         buffer[k - 1]= c + 64; 
1989       else buffer[k - 1]= c - 64; 
1990       cur_input.limit_field = cur_input.limit_field - d; 
1991       first = first - d; 
1992       while(k <= cur_input.limit_field){
1993         buffer[k]= buffer[k + d]; 
1994         incr(k); 
1995       } 
1996       goto lab26; 
1997     } 
1998         } 
1999       } 
2000 /*   cur_cs:=single_base+buffer[loc]; incr(loc); */
2001       cur_cs = 257 + buffer[cur_input.loc_field]; 
2002       incr(cur_input.loc_field); 
2003     } 
2004     lab40: cur_cmd = eqtb[cur_cs].hh.b0; 
2005     cur_chr = eqtb[cur_cs].hh.v.RH; 
2006     if (cur_cmd >= 113){
2007       check_outer_validity();
2008     }
2009   } 
2010   break; 
2011       case 14 : 
2012       case 30 : 
2013       case 46 : 
2014   {
2015     cur_cs = cur_chr + 1; 
2016     cur_cmd = eqtb[cur_cs].hh.b0; 
2017     cur_chr = eqtb[cur_cs].hh.v.RH; 
2018     cur_input.state_field = 1; 
2019     if (cur_cmd >= 113){
2020       check_outer_validity();
2021     }
2022   } 
2023   break; 
2024       case 8 : 
2025       case 24 : 
2026       case 40 : 
2027   {
2028     if (cur_chr == buffer[cur_input.loc_field])
2029     if (cur_input.loc_field < cur_input.limit_field)
2030     {
2031       c = buffer[cur_input.loc_field + 1]; 
2032       if (c < 128)
2033       {
2034         cur_input.loc_field = cur_input.loc_field + 2; 
2035         if ((((c >= 48)&&(c <= 57)) ||((c >= 97)&&(c <= 
2036         102)))) 
2037         if (cur_input.loc_field <= cur_input.limit_field)
2038         {
2039     cc = buffer[cur_input.loc_field]; 
2040     if ((((cc >= 48)&&(cc <= 57)) ||((cc >= 97)&&(
2041     cc <= 102)))) 
2042     {
2043       incr(cur_input.loc_field); 
2044       if (c <= 57)
2045       cur_chr = c - 48; 
2046       else cur_chr = c - 87; 
2047       if (cc <= 57)
2048       cur_chr = 16 * cur_chr + cc - 48; 
2049       else cur_chr = 16 * cur_chr + cc - 87; 
2050       goto lab21; 
2051     } 
2052         } 
2053         if (c < 64)
2054         cur_chr = c + 64; 
2055         else cur_chr = c - 64; 
2056         goto lab21; 
2057       } 
2058     } 
2059     cur_input.state_field = 1; 
2060   } 
2061   break; 
2062       case 16 : 
2063       case 32 : 
2064       case 48 : 
2065   {
2066           print_err("Text line contains an invalid character");
2067           help2("A funny symbol that I can't read has just been input.",
2068                   "Continue, and I'll forget that it ever happened.");
2069     deletions_allowed = false; 
2070     error(); 
2071     deletions_allowed = true; 
2072     goto lab20; 
2073   } 
2074   break; 
2075       case 11 : 
2076   {
2077     cur_input.state_field = 17; 
2078     cur_chr = 32; 
2079   } 
2080   break; 
2081       case 6 : 
2082   {
2083     cur_input.loc_field = cur_input.limit_field + 1; 
2084     cur_cmd = 10; 
2085     cur_chr = 32; 
2086   } 
2087   break; 
2088       case 22 : 
2089       case 15 : 
2090       case 31 : 
2091       case 47 : 
2092   {
2093     cur_input.loc_field = cur_input.limit_field + 1; 
2094     goto lab25; 
2095   } 
2096   break; 
2097       case 38 : 
2098   {
2099     cur_input.loc_field = cur_input.limit_field + 1; 
2100     cur_cs = par_loc; 
2101     cur_cmd = eqtb[cur_cs].hh.b0; 
2102     cur_chr = eqtb[cur_cs].hh.v.RH; 
2103     if (cur_cmd >= 113){
2104       check_outer_validity();
2105     }
2106   } 
2107   break; 
2108       case 2 : 
2109   incr(align_state); 
2110   break; 
2111       case 18 : 
2112       case 34 : 
2113   {
2114     cur_input.state_field = 1; 
2115     incr(align_state); 
2116   } 
2117   break; 
2118       case 3 : 
2119   decr(align_state); 
2120   break; 
2121       case 19 : 
2122       case 35 : 
2123   {
2124     cur_input.state_field = 1; 
2125     decr(align_state); 
2126   } 
2127   break; 
2128       case 20 : 
2129       case 21 : 
2130       case 23 : 
2131       case 25 : 
2132       case 28 : 
2133       case 29 : 
2134       case 36 : 
2135       case 37 : 
2136       case 39 : 
2137       case 41 : 
2138       case 44 : 
2139       case 45 : 
2140   cur_input.state_field = 1; 
2141   break; 
2142   default: 
2143   ; 
2144   break; 
2145       } 
2146     } 
2147     else {
2148       cur_input.state_field = 33; 
2149       if (cur_input.name_field > 17) {
2150       incr(line); 
2151       first = cur_input.start_field; 
2152       if (! force_eof){
2153         if (input_ln(input_file[cur_input.index_field], true)) {
2154           firm_up_the_line();
2155         }
2156         else force_eof = true; 
2157       } 
2158       if (force_eof){
2159         print_char(41);   /*)*/
2160         decr(open_parens); 
2161 #ifndef _WINDOWS
2162         fflush(stdout); 
2163 #endif
2164         force_eof = false; 
2165         end_file_reading(); 
2166         check_outer_validity(); 
2167         goto lab20; 
2168       } 
2169       if ((eqtb[(hash_size + 3211)].cint < 0)||
2170         (eqtb[(hash_size + 3211)].cint > 255)) 
2171         decr(cur_input.limit_field); 
2172 /*    long to unsigned char ... */
2173       else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint; 
2174       first = cur_input.limit_field + 1; 
2175       cur_input.loc_field = cur_input.start_field; 
2176     } 
2177     else {
2178       if (!(cur_input.name_field == 0)) {
2179         cur_cmd = 0; 
2180         cur_chr = 0; 
2181         return; 
2182       } 
2183       if (input_ptr > 0){
2184         end_file_reading(); 
2185         goto lab20; 
2186       } 
2187       if (selector < 18) open_log_file(); 
2188       if (interaction > 1){
2189         if ((eqtb[(hash_size + 3211)].cint < 0)||
2190           (eqtb[(hash_size + 3211)].cint > 255)
2191         )
2192           incr(cur_input.limit_field); 
2193         if (cur_input.limit_field == cur_input.start_field)
2194           print_nl("(Please type a command or say `\\end')");    /*  */
2195         print_ln(); 
2196         first = cur_input.start_field; 
2197         {
2198         ; 
2199           print_string("*");    /* * */
2200           term_input(42, 0); 
2201         } 
2202         cur_input.limit_field = last; 
2203         if ((eqtb[(hash_size + 3211)].cint < 0)||
2204           (eqtb[(hash_size + 3211)].cint > 255)
2205         )
2206           decr(cur_input.limit_field); 
2207 /*    long to unsigned char ... */
2208         else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint; 
2209         first = cur_input.limit_field + 1; 
2210         cur_input.loc_field = cur_input.start_field; 
2211       } 
2212       else {
2213         fatal_error("*** (job aborted, no legal \\end found)"); /*  */
2214         return;     // abort_flag set
2215       }
2216     } 
2217     {
2218       if (interrupt != 0){
2219         pause_for_instructions();
2220       }
2221       } 
2222       goto lab25; 
2223     } 
2224   } 
2225   else if (cur_input.loc_field != 0)
2226   {
2227     t = mem[cur_input.loc_field].hh.v.LH; 
2228     cur_input.loc_field = mem[cur_input.loc_field].hh.v.RH; 
2229     if (t >= 4095)
2230     {
2231       cur_cs = t - 4095; 
2232       cur_cmd = eqtb[cur_cs].hh.b0; 
2233       cur_chr = eqtb[cur_cs].hh.v.RH; 
2234       if (cur_cmd >= 113)
2235       if (cur_cmd == 116)
2236       {
2237   cur_cs = mem[cur_input.loc_field].hh.v.LH - 4095; 
2238   cur_input.loc_field = 0; 
2239   cur_cmd = eqtb[cur_cs].hh.b0; 
2240   cur_chr = eqtb[cur_cs].hh.v.RH; 
2241   if (cur_cmd > 100)
2242   {
2243     cur_cmd = 0; 
2244     cur_chr = 257; 
2245   } 
2246       } 
2247       else {
2248       check_outer_validity();
2249     }
2250     } 
2251     else {
2252   
2253       cur_cmd = t / 256; 
2254 /*      cur_cmd = t >> 8; */  /* top 8 bits */
2255       cur_chr = t % 256; 
2256 /*      cur_chr = t & 255; */ /* last 8 bits */
2257       switch(cur_cmd)
2258       {case 1 : 
2259   incr(align_state); 
2260   break; 
2261       case 2 : 
2262   decr(align_state); 
2263   break; 
2264       case 5 : 
2265   {
2266     begin_token_list(param_stack[cur_input.limit_field + cur_chr - 1], 
2267     0); 
2268     goto lab20; 
2269   } 
2270   break; 
2271   default: 
2272   ; 
2273   break; 
2274       } 
2275     } 
2276   } 
2277   else {
2278     end_token_list(); 
2279     goto lab20; 
2280   } 
2281   if (cur_cmd <= 5)
2282   if (cur_cmd >= 4)
2283   if (align_state == 0)
2284   {
2285     if (scanner_status == 4){
2286     fatal_error("(interwoven alignment preambles are not allowed)"); /*  */
2287     return;     // abort_flag set
2288   }
2289
2290     cur_cmd = mem[cur_align + 5].hh.v.LH; 
2291     mem[cur_align + 5].hh.v.LH = cur_chr; 
2292     if (cur_cmd == 63)
2293     begin_token_list(omit_template, 2); 
2294     else begin_token_list(mem[cur_align + 2].cint, 2); 
2295     align_state = 1000000L; 
2296     goto lab20; 
2297   } 
2298
2299
2300 #pragma optimize ("", on)             /* 96/Sep/12 */
2301
2302 /*****************************************************************************/