OSDN Git Service

string pool clean.
[putex/putex.git] / src / texsourc / tex6.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:4131) // old style declarator
14 #pragma warning(disable:4135) // conversion between different integral types 
15 #pragma warning(disable:4127) // conditional expression is constant
16
17 #include <setjmp.h>
18
19 #define EXTERN extern
20
21 #include "texd.h"
22
23 #pragma warning(disable:4244)       /* 96/Jan/10 */
24
25 /* sec 0785 */
26 void align_peek (void)
27 {
28 lab20:
29   align_state = 1000000L;
30
31   do
32     {
33       get_x_token();
34     }
35   while (!(cur_cmd != spacer));
36
37   if (cur_cmd == no_align)
38   {
39     scan_left_brace();
40
41     new_save_level(no_align_group);
42
43     if (mode == -1)
44       normal_paragraph();
45   }
46   else if (cur_cmd == right_brace)
47   {
48     fin_align();
49   }
50   else if ((cur_cmd == car_ret) && (cur_chr == cr_cr_code))
51     goto lab20;
52   else
53   {
54     init_row();
55     init_col();
56   }
57 }
58 /* used in itex.c only */
59 /* sec 0826 */
60 halfword finite_shrink_(halfword p)
61 {
62   halfword q;
63
64   if (no_shrink_error_yet)
65   {
66     no_shrink_error_yet = false;
67     print_err("Infinite glue shrinkage found in a paragraph");
68     help5("The paragraph just ended includes some glue that has",
69         "infinite shrinkability, e.g., `\\hskip 0pt minus 1fil'.",
70         "Such glue doesn't belong there---it allows a paragraph",
71         "of any length to fit on one line. But it's safe to proceed,",
72         "since the offensive shrinkability has been made finite.");
73     error();
74   }
75
76   q = new_spec(p);
77   shrink_order(q) = normal;
78   delete_glue_ref(p);
79   return q;
80 }
81 /* sec 0829 */
82 void try_break_ (integer pi, small_number breaktype)
83 {
84   halfword r;
85   halfword prevr;
86   halfword oldl;
87   bool nobreakyet;
88   halfword prevprevr;
89   halfword s;
90   halfword q;
91   halfword v;
92   integer t;
93   internal_font_number f;
94   halfword l;
95   bool noderstaysactive;
96   scaled linewidth;
97   char fitclass;
98   halfword b;       /* current badness */
99   integer d;
100   bool artificialdemerits;
101   halfword savelink;
102   scaled shortfall;
103
104   if (abs(pi)>= 10000)
105     if (pi > 0)
106       goto lab10;
107     else
108       pi = -10000;
109
110   nobreakyet = true;
111   prevr = active;
112   oldl = 0;
113   cur_active_width[1] = active_width[1];
114   cur_active_width[2] = active_width[2];
115   cur_active_width[3] = active_width[3];
116   cur_active_width[4] = active_width[4];
117   cur_active_width[5] = active_width[5];
118   cur_active_width[6] = active_width[6];
119   while (true)
120   {
121 lab22:
122     r = mem[prevr].hh.v.RH;
123     if (mem[r].hh.b0 == 2)
124     {
125       cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
126       cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
127       cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
128       cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
129       cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
130       cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
131       prevprevr = prevr;
132       prevr = r;
133       goto lab22;
134     }
135     {
136       l = mem[r + 1].hh.v.LH;
137       if (l > oldl)
138       {
139         if ((minimum_demerits < 1073741823L) &&  /* 2^30 - 1 */
140           ((oldl != easyline) || (r == active)))
141         {
142           if (nobreakyet)
143           {
144             nobreakyet = false;
145             break_width[1] = background[1];
146             break_width[2] = background[2];
147             break_width[3] = background[3];
148             break_width[4] = background[4];
149             break_width[5] = background[5];
150             break_width[6] = background[6];
151             s = cur_p;
152 /* if break_type>unhyphenated then if cur_p<>null then l.16451 */
153             if (breaktype > 0)
154               if (cur_p != 0)
155               {
156                 t = mem[cur_p].hh.b1;
157                 v = cur_p;
158                 s = mem[cur_p + 1].hh.v.RH;
159                 while (t > 0)
160                 {
161                   decr(t);
162                   v = mem[v].hh.v.RH;
163                   if ((v >= hi_mem_min))
164                   {
165                     f = mem[v].hh.b0;
166                     break_width[1] = break_width[1]- font_info[width_base[f]+ font_info[char_base[f]+ mem[v].hh.b1].qqqq.b0].cint;
167                   }
168                   else switch (mem[v].hh.b0)
169                   {
170                     case 6:
171                       {
172                         f = mem[v + 1].hh.b0;
173                         break_width[1] = break_width[1]- font_info[width_base[f]+ font_info[char_base[f]+ mem[v + 1].hh.b1].qqqq.b0].cint;
174                       }
175                       break;
176                     case 0:
177                     case 1:
178                     case 2:
179                     case 11:
180                       break_width[1] = break_width[1]- mem[v + 1].cint;
181                       break;
182                     default:
183                       {
184                         confusion("disc1");
185                         return;       // abort_flag set
186                       }
187                       break;
188                     }
189                   }
190                   while (s != 0)
191                   {  /* while s<>null do l.16453 */
192                     if ((s >= hi_mem_min))
193                     {
194                       f = mem[s].hh.b0;
195                       break_width[1] = break_width[1]+ font_info[width_base[f]+ font_info[char_base[f]+ mem[s].hh.b1].qqqq.b0].cint;
196                     }
197                     else switch(mem[s].hh.b0)
198                     {
199                       case 6:
200                         {
201                           f = mem[s + 1].hh.b0;
202                           break_width[1] = break_width[1]+ font_info[width_base[f]+ font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq.b0].cint;
203                         }
204                         break;
205                       case 0:
206                       case 1:
207                       case 2:
208 /* didn't used to drop through to case 11 from case 2 in  3.141 */
209                       case 11:
210 /* used to be some extra code here in case 11 in 3.141 */
211                         break_width[1] = break_width[1]+ mem[s + 1].cint;
212                         break;
213                       default:
214                         {
215                           confusion("disc2");
216                           return;       // abort_flag set
217                         }
218                         break;
219                     }
220 /* used to be an increment t here in 3.141 */
221                     s = mem[s].hh.v.RH;
222                   }
223                   break_width[1] = break_width[1] + disc_width;
224 /* used to be a test on t here instead in 3.141 */
225                   if (mem[cur_p + 1].hh.v.RH == 0)
226                     s = mem[v].hh.v.RH;
227                 }
228                 while (s != 0)
229                 {
230                   if ((s >= hi_mem_min))
231                     goto lab30;
232                   switch(mem[s].hh.b0)
233                   {
234                     case 10:
235                       {
236                         v = mem[s + 1].hh.v.LH;
237                         break_width[1] = break_width[1] - mem[v + 1].cint;
238                         break_width[2 + mem[v].hh.b0] = break_width[2 + mem[v].hh.b0] - mem[v + 2].cint;
239                         break_width[6] = break_width[6] - mem[v + 3].cint;
240                       }
241                       break;
242                     case 12:
243                       ;
244                       break;
245                     case 9:
246 /* case 9 used to drop through to case 11 in 3.141 */
247                       break_width[1] = break_width[1] - mem[s + 1].cint;
248                       break;
249                     case 11:
250 /* changes here in nature of test since 3.141 */
251                       if (mem[s].hh.b1 != 1)
252                         goto lab30;
253                       else
254                         break_width[1] = break_width[1] - mem[s + 1].cint;
255                       break;
256                     default:
257                       goto lab30;
258                       break;
259                   }
260                   s = mem[s].hh.v.RH;
261                 }
262 lab30:          ;
263           }
264           if (mem[prevr].hh.b0 == 2)
265           {
266             mem[prevr + 1].cint = mem[prevr + 1].cint - cur_active_width[1] + break_width[1];
267             mem[prevr + 2].cint = mem[prevr + 2].cint - cur_active_width[2] + break_width[2];
268             mem[prevr + 3].cint = mem[prevr + 3].cint - cur_active_width[3] + break_width[3];
269             mem[prevr + 4].cint = mem[prevr + 4].cint - cur_active_width[4] + break_width[4];
270             mem[prevr + 5].cint = mem[prevr + 5].cint - cur_active_width[5] + break_width[5];
271             mem[prevr + 6].cint = mem[prevr + 6].cint - cur_active_width[6] + break_width[6];
272           }
273           else if (prevr == active)
274           {
275             active_width[1] = break_width[1];
276             active_width[2] = break_width[2];
277             active_width[3] = break_width[3];
278             active_width[4] = break_width[4];
279             active_width[5] = break_width[5];
280             active_width[6] = break_width[6];
281           }
282           else
283           {
284             q = get_node(7);
285             mem[q].hh.v.RH = r;
286             mem[q].hh.b0 = 2;
287             mem[q].hh.b1 = 0;
288             mem[q + 1].cint = break_width[1]- cur_active_width[1];
289             mem[q + 2].cint = break_width[2]- cur_active_width[2];
290             mem[q + 3].cint = break_width[3]- cur_active_width[3];
291             mem[q + 4].cint = break_width[4]- cur_active_width[4];
292             mem[q + 5].cint = break_width[5]- cur_active_width[5];
293             mem[q + 6].cint = break_width[6]- cur_active_width[6];
294             mem[prevr].hh.v.RH = q;
295             prevprevr = prevr;
296             prevr = q;
297           }
298           if (abs(adj_demerits) >= 1073741823L - minimum_demerits)
299             minimum_demerits = 1073741822L; /* 2^30 - 2 */
300           else
301             minimum_demerits = minimum_demerits + abs(adj_demerits);
302           {
303             register integer for_end;
304             fitclass = 0;
305             for_end = 3;
306             if (fitclass <= for_end) do
307             {
308               if (minimal_demerits[fitclass] <= minimum_demerits)
309               {
310                 q = get_node(2);
311                 mem[q].hh.v.RH = passive;
312                 passive = q;
313                 mem[q + 1].hh.v.RH = cur_p;
314 #ifdef STAT
315                 incr(pass_number);
316                 mem[q].hh.v.LH = pass_number;
317 #endif /* STAT */
318                 mem[q + 1].hh.v.LH = best_place[fitclass];
319                 q = get_node(3);
320                 mem[q + 1].hh.v.RH = passive;
321                 mem[q + 1].hh.v.LH = best_pl_line[fitclass] + 1;
322                 mem[q].hh.b1 = fitclass;
323                 mem[q].hh.b0 = breaktype;
324                 mem[q + 2].cint = minimal_demerits[fitclass];
325                 mem[q].hh.v.RH = r;
326                 mem[prevr].hh.v.RH = q;
327                 prevr = q;
328 #ifdef STAT
329                 if (tracing_paragraphs > 0)
330                 {
331                   print_nl("@@");
332                   print_int(mem[passive].hh.v.LH);
333                   print_string(": line ");
334                   print_int(mem[q + 1].hh.v.LH - 1);
335                   print_char('.');
336                   print_int(fitclass);
337                   if (breaktype == 1)
338                     print_char('-');
339                   print_string(" t=");
340                   print_int(mem[q + 2].cint);
341                   print_string(" -> @@");
342                   if (mem[passive + 1].hh.v.LH == 0)
343                     print_char('0');
344                   else
345                     print_int(mem[mem[passive + 1].hh.v.LH].hh.v.LH);
346                 }
347 #endif /* STAT */
348               }
349               minimal_demerits[fitclass] = 1073741823L; /* 2^30 - 1 */
350             }
351             while (fitclass++ < for_end);
352           }
353           minimum_demerits = 1073741823L; /* 2^30 - 1 */
354           if (r != active)
355           {
356             q = get_node(7);
357             mem[q].hh.v.RH = r;
358             mem[q].hh.b0 = 2;
359             mem[q].hh.b1 = 0;
360             mem[q + 1].cint = cur_active_width[1] - break_width[1];
361             mem[q + 2].cint = cur_active_width[2] - break_width[2];
362             mem[q + 3].cint = cur_active_width[3] - break_width[3];
363             mem[q + 4].cint = cur_active_width[4] - break_width[4];
364             mem[q + 5].cint = cur_active_width[5] - break_width[5];
365             mem[q + 6].cint = cur_active_width[6] - break_width[6];
366             mem[prevr].hh.v.RH = q;
367             prevprevr = prevr;
368             prevr = q;
369           }
370         }
371         if (r == active)
372           goto lab10;
373         if (l > easyline)
374         {
375           linewidth = second_width;
376           oldl = 262142L;       /* 2^18 - 2 ? */
377         }
378         else
379         {
380           oldl = l;
381           if (l > last_special_line)
382             linewidth = second_width;
383           else if (par_shape_ptr == 0)
384             linewidth = first_width;
385           else
386             linewidth = mem[par_shape_ptr + 2 * l].cint;
387         }
388       }
389     }
390     {
391       artificialdemerits = false;
392       shortfall = linewidth - cur_active_width[1];  /* linewidth may be ... */
393       if (shortfall > 0)
394         if ((cur_active_width[3]!= 0) || (cur_active_width[4]!= 0) || (cur_active_width[5]!= 0))
395         {
396           b = 0;
397           fitclass = 2;
398         }
399         else
400         {
401           if (shortfall > 7230584L)
402             if (cur_active_width[2]< 1663497L)
403             {
404               b = 10000;
405               fitclass = 0;
406               goto lab31;
407             }
408           b = badness(shortfall, cur_active_width[2]);
409           if (b > 12)
410             if (b > 99)
411               fitclass = 0;
412             else
413               fitclass = 1;
414           else
415             fitclass = 2;
416 lab31:
417           ;
418         }
419       else
420       {
421         if (- (integer) shortfall > cur_active_width[6])
422           b = 10001;
423         else
424           b = badness(- (integer) shortfall, cur_active_width[6]);
425         if (b > 12)
426           fitclass = 3;
427         else
428           fitclass = 2;
429       }
430       if ((b > 10000) || (pi == -10000))
431       {
432         if (final_pass && (minimum_demerits == 1073741823L) &&  /* 2^30 - 1 */
433             (mem[r].hh.v.RH == active) && (prevr == active))
434           artificialdemerits = true;
435         else if (b > threshold)
436           goto lab60;
437         noderstaysactive = false;
438       }
439       else
440       {
441         prevr = r;
442         if (b > threshold)
443           goto lab22;
444         noderstaysactive = true;
445       }
446       if (artificialdemerits)
447         d = 0;
448       else
449       {
450         d = line_penalty + b;
451         if (abs(d)>= 10000)
452           d = 100000000L;
453         else
454           d = d * d;
455         if (pi != 0)
456           if (pi > 0)
457             d = d + pi * pi;
458           else if (pi > -10000)
459             d = d - pi * pi;
460         if ((breaktype == 1) && (mem[r].hh.b0 == 1))
461           if (cur_p != 0)
462             d = d + double_hyphen_demerits;
463           else
464             d = d + final_hyphen_demerits;
465         if (abs(toint(fitclass)- toint(mem[r].hh.b1)) > 1)
466           d = d + adj_demerits;
467       }
468 #ifdef STAT
469       if (tracing_paragraphs > 0)
470       {
471         if (printed_node != cur_p)
472         {
473           print_nl("");
474           if (cur_p == 0)
475             short_display(mem[printed_node].hh.v.RH);
476           else
477           {
478             savelink = mem[cur_p].hh.v.RH;
479             mem[cur_p].hh.v.RH = 0;
480             print_nl("");
481             short_display(mem[printed_node].hh.v.RH);
482             mem[cur_p].hh.v.RH = savelink;
483           }
484           printed_node = cur_p;
485         }
486         print_nl("@");
487         if (cur_p == 0)
488           print_esc("par");
489         else if (mem[cur_p].hh.b0 != 10)
490         {
491           if (mem[cur_p].hh.b0 == 12)
492             print_esc("penalty");
493           else if (mem[cur_p].hh.b0 == 7)
494             print_esc("discretionary");
495           else if (mem[cur_p].hh.b0 == 11)
496             print_esc("kern");
497           else
498             print_esc("math");
499         }
500         print_string(" via @@");
501         if (mem[r + 1].hh.v.RH == 0)
502           print_char('0');
503         else
504           print_int(mem[mem[r + 1].hh.v.RH].hh.v.LH);
505         print_string(" b=");
506         if (b > 10000)
507           print_char('*');
508         else print_int(b);
509         print_string(" p=");
510         print_int(pi);
511         print_string(" d=");
512         if (artificialdemerits)
513           print_char('*');
514         else
515           print_int(d);
516       }
517 #endif /* STAT */
518       d = d + mem[r + 2].cint;
519       if (d <= minimal_demerits[fitclass])
520       {
521         minimal_demerits[fitclass] = d;
522         best_place[fitclass] = mem[r + 1].hh.v.RH;
523         best_pl_line[fitclass] = l;
524         if (d < minimum_demerits)
525           minimum_demerits = d;
526       }
527       if (noderstaysactive)
528         goto lab22;
529 lab60:
530       mem[prevr].hh.v.RH = mem[r].hh.v.RH;
531       free_node(r, 3);
532       if (prevr == active)
533       {
534         r = mem[active].hh.v.RH;
535         if (mem[r].hh.b0 == 2)
536         {
537           active_width[1] = active_width[1] + mem[r + 1].cint;
538           active_width[2] = active_width[2] + mem[r + 2].cint;
539           active_width[3] = active_width[3] + mem[r + 3].cint;
540           active_width[4] = active_width[4] + mem[r + 4].cint;
541           active_width[5] = active_width[5] + mem[r + 5].cint;
542           active_width[6] = active_width[6] + mem[r + 6].cint;
543           cur_active_width[1] = active_width[1];
544           cur_active_width[2] = active_width[2];
545           cur_active_width[3] = active_width[3];
546           cur_active_width[4] = active_width[4];
547           cur_active_width[5] = active_width[5];
548           cur_active_width[6] = active_width[6];
549           mem[active].hh.v.RH = mem[r].hh.v.RH;
550           free_node(r, 7);
551         }
552       }
553       else if (mem[prevr].hh.b0 == 2)
554       {
555         r = mem[prevr].hh.v.RH;
556         if (r == active)
557         {
558           cur_active_width[1] = cur_active_width[1] - mem[prevr + 1].cint;
559           cur_active_width[2] = cur_active_width[2] - mem[prevr + 2].cint;
560           cur_active_width[3] = cur_active_width[3] - mem[prevr + 3].cint;
561           cur_active_width[4] = cur_active_width[4] - mem[prevr + 4].cint;
562           cur_active_width[5] = cur_active_width[5] - mem[prevr + 5].cint;
563           cur_active_width[6] = cur_active_width[6] - mem[prevr + 6].cint;
564           mem[prevprevr].hh.v.RH = active; /* prevprevr may be used ... */
565           free_node(prevr, 7);
566           prevr = prevprevr;
567         }
568         else if (mem[r].hh.b0 == 2)
569         {
570           cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
571           cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
572           cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
573           cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
574           cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
575           cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
576           mem[prevr + 1].cint = mem[prevr + 1].cint + mem[r + 1].cint;
577           mem[prevr + 2].cint = mem[prevr + 2].cint + mem[r + 2].cint;
578           mem[prevr + 3].cint = mem[prevr + 3].cint + mem[r + 3].cint;
579           mem[prevr + 4].cint = mem[prevr + 4].cint + mem[r + 4].cint;
580           mem[prevr + 5].cint = mem[prevr + 5].cint + mem[r + 5].cint;
581           mem[prevr + 6].cint = mem[prevr + 6].cint + mem[r + 6].cint;
582           mem[prevr].hh.v.RH = mem[r].hh.v.RH;
583           free_node(r, 7);
584         }
585       }
586     }
587   }
588 lab10:
589   ;
590 #ifdef STAT
591   if (cur_p == printed_node)
592     if (cur_p != 0)
593       if (mem[cur_p].hh.b0 == 7)
594       {
595         t = mem[cur_p].hh.b1;
596         while (t > 0)
597         {
598           decr(t);
599           printed_node = mem[printed_node].hh.v.RH;
600         }
601       }
602 #endif /* STAT */
603 /*  must exit here, there are no internal return - except for confusion */
604 /*  savedbadness = b; */      /* 96/Feb/9 - for test in itex.c */
605 }
606 /* end of the old tex5.c here */
607 /* sec 0877 */
608 void post_line_break_(integer final_widow_penalty)
609 {
610   halfword q, r, s;
611   bool discbreak;
612   bool postdiscbreak;
613   scaled curwidth;
614   scaled curindent;
615   quarterword t;
616   integer pen;
617   halfword curline;
618
619   q = mem[best_bet + 1].hh.v.RH;
620   cur_p = 0;
621   do
622   {
623     r = q;
624     q = mem[q + 1].hh.v.LH;
625     mem[r + 1].hh.v.LH = cur_p;
626     cur_p = r;
627   }
628   while (!(q == 0));
629   curline = prev_graf + 1;
630   do
631   {
632     q = mem[cur_p + 1].hh.v.RH;
633     discbreak = false;
634     postdiscbreak = false;
635     if (q != 0)
636       if (mem[q].hh.b0 == 10)
637       {
638         delete_glue_ref(mem[q + 1].hh.v.LH);
639         mem[q + 1].hh.v.LH = eqtb[(hash_size + 790)].hh.v.RH;
640         mem[q].hh.b1 = 9;
641         incr(mem[eqtb[(hash_size + 790)].hh.v.RH].hh.v.RH);
642         goto lab30;
643       }
644       else
645       {
646         if (mem[q].hh.b0 == 7)
647         {
648           t = mem[q].hh.b1;
649           if (t == 0)
650             r = mem[q].hh.v.RH;
651           else
652           {
653             r = q;
654             while (t > 1)
655             {
656               r = mem[r].hh.v.RH;
657               decr(t);
658             }
659             s = mem[r].hh.v.RH;
660             r = mem[s].hh.v.RH;
661             mem[s].hh.v.RH = 0;
662             flush_node_list(mem[q].hh.v.RH);
663             mem[q].hh.b1 = 0;
664           }
665           if (mem[q + 1].hh.v.RH != 0)
666           {
667             s = mem[q + 1].hh.v.RH;
668             while (mem[s].hh.v.RH != 0)
669               s = mem[s].hh.v.RH;
670             mem[s].hh.v.RH = r;
671             r = mem[q + 1].hh.v.RH;
672             mem[q + 1].hh.v.RH = 0;
673             postdiscbreak = true;
674           }
675           if (mem[q + 1].hh.v.LH != 0)
676           {
677             s = mem[q + 1].hh.v.LH;
678             mem[q].hh.v.RH = s;
679             while (mem[s].hh.v.RH != 0)
680               s = mem[s].hh.v.RH;
681             mem[q + 1].hh.v.LH = 0;
682             q = s;
683           }
684           mem[q].hh.v.RH = r;
685           discbreak = true;
686         }
687         else if ((mem[q].hh.b0 == 9) || (mem[q].hh.b0 == 11))
688           mem[q + 1].cint = 0;
689       }
690     else
691     {
692       q = temp_head;
693       while (mem[q].hh.v.RH != 0)
694         q = mem[q].hh.v.RH;
695     }
696     r = new_param_glue(8);
697     mem[r].hh.v.RH = mem[q].hh.v.RH;
698     mem[q].hh.v.RH = r;
699     q = r;
700 lab30:
701     ;
702     r = mem[q].hh.v.RH;
703     mem[q].hh.v.RH = 0;
704     q = mem[temp_head].hh.v.RH;
705     mem[temp_head].hh.v.RH = r;
706     if (eqtb[(hash_size + 789)].hh.v.RH != 0)
707     {
708       r = new_param_glue(7);
709       mem[r].hh.v.RH = q;
710       q = r;
711     }
712     if (curline > last_special_line)
713     {
714       curwidth = second_width;
715       curindent = second_indent;
716     }
717     else if (par_shape_ptr == 0)
718     {
719       curwidth = first_width;
720       curindent = first_indent;
721     }
722     else
723     {
724       curwidth = mem[par_shape_ptr + 2 * curline].cint;
725       curindent = mem[par_shape_ptr + 2 * curline - 1].cint;
726     }
727     adjust_tail = adjust_head;
728     just_box = hpack(q, curwidth, 0);
729     mem[just_box + 4].cint = curindent;
730     append_to_vlist(just_box);
731 /* if adjust_head<>adjust_tail then l.17346 */
732     if (adjust_head != adjust_tail)
733     {
734       mem[tail].hh.v.RH = mem[adjust_head].hh.v.RH;
735       tail = adjust_tail;
736     }
737     adjust_tail = 0; /* adjust_tail:=null */
738     if (curline + 1 != best_line)
739     {
740       pen = inter_line_penalty;
741       if (curline == prev_graf + 1)
742         pen = pen + club_penalty;
743       if (curline + 2 == best_line)
744         pen = pen + final_widow_penalty;
745       if (discbreak)
746         pen = pen + broken_penalty;
747       if (pen != 0)
748       {
749         r = new_penalty(pen);
750         mem[tail].hh.v.RH = r;
751         tail = r;
752       }
753     }
754     incr(curline);
755     cur_p = mem[cur_p + 1].hh.v.LH;
756     if (cur_p != 0)
757       if (!postdiscbreak)
758       {
759         r = temp_head;
760         while (true)
761         {
762           q = mem[r].hh.v.RH;
763           if (q == mem[cur_p + 1].hh.v.RH)
764             goto lab31;
765           if ((q >= hi_mem_min))
766             goto lab31;
767           if ((mem[q].hh.b0 < 9))
768             goto lab31;
769 /* change in tests here from 3.141 != 1 instead of == 2 */
770           if (mem[q].hh.b0 == 11)
771             if (mem[q].hh.b1 != 1)
772               goto lab31;
773           r = q;
774         }
775 lab31:
776         if (r != temp_head)
777         {
778           mem[r].hh.v.RH = 0;
779           flush_node_list(mem[temp_head].hh.v.RH);
780           mem[temp_head].hh.v.RH = q;
781         }
782       }
783   }
784   while (!(cur_p == 0));
785   if ((curline != best_line) || (mem[temp_head].hh.v.RH != 0))
786   {
787     confusion("line breaking");
788     return;       // abort_flag set
789   }
790   prev_graf = best_line - 1;
791 }
792 /* Reconstitute ligatures during hyphenation pass */
793 /* sec 0906 */
794 small_number reconstitute_(small_number j, small_number n, halfword bchar, halfword hchar)
795 {
796   register small_number Result;
797   halfword p;
798   halfword t;
799   ffourquarters q;
800   halfword currh;
801   halfword testchar;
802   scaled w;
803   font_index k;
804   hyphen_passed = 0;            /* paragraph 907 ? */
805   t = hold_head;
806   w = 0;
807   mem[hold_head].hh.v.RH = 0;
808   cur_l = hu[j];
809   cur_q = t;
810   if (j == 0)
811   {
812     ligature_present = init_lig;
813     p = init_list; 
814     if (ligature_present)
815       lft_hit = init_lft; 
816 /*   while p>null do l.17772 */
817 /*    while(p > 0){ */  /* NO! */
818     while(p != 0)
819     {          /* 94/Mar/22 BUG FIX */
820       {
821 /*    append_charnode_to_t(character(p)); */ 
822         mem[t].hh.v.RH = get_avail();
823         t = mem[t].hh.v.RH;
824         mem[t].hh.b0 = hf;
825         mem[t].hh.b1 = mem[p].hh.b1;
826       }
827       p = mem[p].hh.v.RH; /* p:=link(p); */
828     }
829   }
830   else if (cur_l < 256)
831   {
832     mem[t].hh.v.RH = get_avail();
833     t = mem[t].hh.v.RH;
834     mem[t].hh.b0 = hf;
835     mem[t].hh.b1 = cur_l;
836   }
837   lig_stack = 0;    /* lig_stack:=null; */
838   {
839     if (j < n)
840       cur_r = hu[j + 1];
841     else
842       cur_r = bchar;
843     if (odd(hyf[j]))
844       currh = hchar;
845     else
846       currh = 256; 
847   }
848 lab22:
849   if (cur_l == 256)   /* if cur_l = non_char then */
850   {
851     k = bchar_label[hf];    /* begin k:=bchar_label[hf]; */
852 /*  if k=non_address then goto done@+else q:=font_info[k].qqqq; l.17812 */
853 /*    if (k == font_mem_size) */
854     if (k == non_address)    /* i.e. 0 ---  96/Jan/15 */
855       goto lab30;
856     else
857       q = font_info[k].qqqq;
858   }
859   else
860   {
861     q = font_info[char_base[hf]+ cur_l].qqqq;
862     if (((q.b2) % 4)!= 1)
863       goto lab30;
864     k = lig_kern_base[hf] + q.b3;
865     q = font_info[k].qqqq;
866     if (q.b0 > 128)
867     {
868       k = lig_kern_base[hf]+ 256 * q.b2 + q.b3 + 32768L - 256 *(128);
869       q = font_info[k].qqqq;
870     }
871   }
872   if (currh < 256) /* if cur_rh < non_char then test_char:=cur_rh */
873     testchar = currh;
874   else
875     testchar = cur_r;  /* else test_char:=cur_r; l.17817 */
876 /* loop@+begin if next_char(q)=test_char then if skip_byte(q)<=stop_flag then */
877   while (true)
878   {
879     if (q.b1 == testchar)
880       if (q.b0 <= 128)
881         if (currh < 256)   /*  if cur_rh<non_char then */
882         {
883           hyphen_passed = j;
884           hchar = 256;
885           currh = 256;
886           goto lab22;     /* goto continue; */
887         }
888         else
889         {    /* else begin if hchar<non_char then if odd(hyf[j]) then */
890           if (hchar < 256)
891             if (odd(hyf[j]))
892             {
893               hyphen_passed = j;
894               hchar = 256;
895             }
896           if (q.b2 < 128)  /* if op_byte(q)<kern_flag then */
897           {
898 // @<Carry out a ligature replacement, updating the cursor structure
899 //  and possibly advancing~|j|; |goto continue| if the cursor doesn't
900 //  advance, otherwise |goto done|@>;  => l.17869
901             if (cur_l == 256)    /* begin if cur_l=non_char then lft_hit:=true; */
902               lft_hit = true;
903             if (j == n)
904               if (lig_stack == 0)/* if lig_stack=null ? */
905                 rt_hit = true;
906             {
907               if (interrupt != 0)
908               {
909                 pause_for_instructions();
910               }
911             }
912             switch(q.b2)  /* case op_byte(q) of */
913             {
914               case 1:
915               case 5:
916                 {
917                   cur_l = q.b3;
918                   ligature_present = true;
919                 }
920                 break;
921               case 2:
922               case 6:
923                 {
924                   cur_r = q.b3;
925 /*   if lig_stack>null then character(lig_stack):=cur_r */
926 /*      if (lig_stack > 0) */      /* 94/Mar/22 */
927                   if (lig_stack != 0)      /* line breaking?? */
928                     mem[lig_stack].hh.b1 = cur_r; /* l.17877 ? */
929                   else
930                   {
931                     lig_stack = new_lig_item(cur_r);
932                     if (j == n)
933                       bchar = 256;
934                     else
935                     {
936                       p = get_avail();
937                       mem[lig_stack + 1].hh.v.RH = p;
938                       mem[p].hh.b1 = hu[j + 1];
939                       mem[p].hh.b0 = hf;
940                     }
941                   }
942                 }
943                 break;
944               case 3:
945                 {
946                   cur_r = q.b3;
947                   p = lig_stack;
948                   lig_stack = new_lig_item(cur_r);
949                   mem[lig_stack].hh.v.RH = p;
950                 }
951                 break;
952               case 7:
953               case 11:
954                 {
955                   if (ligature_present)
956                   {
957                     p = new_ligature(hf, cur_l, mem[cur_q].hh.v.RH);
958                     if (lft_hit)
959                     {
960                       mem[p].hh.b1 = 2;
961                       lft_hit = false;
962                     }
963 /*        if (false)
964         if (lig_stack == 0){
965           incr(mem[p].hh.b1); 
966           rt_hit = false; 
967         } */              /* removed 99/Jan/6 */
968                     mem[cur_q].hh.v.RH = p;
969                     t = p;
970                     ligature_present = false;
971                   }
972                   cur_q = t;
973                   cur_l = q.b3;
974                   ligature_present = true;
975                 }
976                 break;
977               default:
978                 {
979 /* othercases begin cur_l:=rem_byte(q);
980     ligature_present:=true; {\.{=:}} l.17869 */
981                   cur_l = q.b3;
982                   ligature_present = true;
983 /*   if lig_stack>null then pop_lig_stack l.17870 => l.17828 */
984 /*      if (lig_stack > 0)*/       /* 94/Mar/22 ??? */
985                   if (lig_stack != 0)        /* BUG FIX  */
986                   {
987 /*        if (mem[lig_stack + 1].hh.v.RH > 0) */ /* 94/Mar/22  */
988                     if (mem[lig_stack + 1].hh.v.RH != 0) /* l.17828 ? */
989                     {
990                       mem[t].hh.v.RH = mem[lig_stack + 1].hh.v.RH;
991                       t = mem[t].hh.v.RH;
992                       incr(j);
993                     }
994                     p = lig_stack;
995                     lig_stack = mem[p].hh.v.RH;
996                     free_node(p, 2);
997                     if (lig_stack == 0)  /* if lig_stack=null ? */
998                     {
999                       if (j < n)
1000                         cur_r = hu[j + 1];
1001                       else
1002                         cur_r = bchar;
1003                       if (odd(hyf[j]))
1004                         currh = hchar;
1005                       else
1006                         currh = 256;
1007                     }
1008                     else
1009                       cur_r = mem[lig_stack].hh.b1;
1010                   }
1011                   else if (j == n)
1012                     goto lab30;
1013                   else
1014                   {
1015                     {
1016                       mem[t].hh.v.RH = get_avail();
1017                       t = mem[t].hh.v.RH;
1018                       mem[t].hh.b0 = hf;
1019                       mem[t].hh.b1 = cur_r;
1020                     }
1021                     incr(j);
1022                     {
1023                       if (j < n)
1024                         cur_r = hu[j + 1];
1025                       else
1026                         cur_r = bchar;
1027                       if (odd(hyf[j]))
1028                         currh = hchar;
1029                       else
1030                         currh = 256;
1031                     }
1032                   }
1033                 }
1034                 break;
1035             }
1036             if (q.b2 > 4)
1037               if (q.b2 != 7)
1038                 goto lab30;
1039             goto lab22;
1040           }
1041           w = font_info[kern_base[hf]+ 256 * q.b2 + q.b3].cint;
1042           goto lab30;
1043         }
1044     if (q.b0 >= 128)
1045       if (currh == 256)
1046         goto lab30;
1047       else
1048       {
1049         currh = 256;
1050         goto lab22;
1051       }
1052     k = k + q.b0 + 1;
1053     q = font_info[k].qqqq;
1054   }
1055 lab30:;
1056   if (ligature_present)
1057   {
1058     p = new_ligature(hf, cur_l, mem[cur_q].hh.v.RH);
1059     if (lft_hit)
1060     {
1061       mem[p].hh.b1 = 2;
1062       lft_hit = false;
1063     }
1064     if (rt_hit)
1065       if (lig_stack == 0)  /* if lig_stack=null ? */
1066       {
1067         incr(mem[p].hh.b1);
1068         rt_hit = false;
1069       }
1070     mem[cur_q].hh.v.RH = p;
1071     t = p;
1072     ligature_present = false;
1073   }
1074   if (w != 0)
1075   {
1076     mem[t].hh.v.RH = new_kern(w);
1077     t = mem[t].hh.v.RH;
1078     w = 0;
1079   }
1080 /*  if (lig_stack > 0)*/     /* 94/Mar/22 ??? l.17870 */
1081   if (lig_stack != 0)        /* l.17841 */
1082   {
1083 /* begin cur_q:=t; cur_l:=character(lig_stack);
1084   ligature_present:=true; l.17842 */
1085     cur_q = t;
1086     cur_l = mem[lig_stack].hh.b1;
1087     ligature_present = true;
1088     {
1089 /*   pop_lig_stack; goto continue; l.17843 => l.17828 */
1090 /*      if (mem[lig_stack + 1].hh.v.RH > 0) *//* 94/Mar/22 */
1091       if (mem[lig_stack + 1].hh.v.RH != 0) /* BUG FIX */
1092       {
1093         mem[t].hh.v.RH = mem[lig_stack + 1].hh.v.RH;
1094         t = mem[t].hh.v.RH;
1095         incr(j);
1096       }
1097       p = lig_stack;
1098       lig_stack = mem[p].hh.v.RH;
1099       free_node(p, 2);
1100       if (lig_stack == 0)
1101       {
1102         if (j < n)
1103           cur_r = hu[j + 1];
1104         else
1105           cur_r = bchar;
1106         if (odd(hyf[j]))
1107           currh = hchar;
1108         else
1109           currh = 256;
1110       }
1111       else
1112         cur_r = mem[lig_stack].hh.b1;
1113     }
1114     goto lab22;
1115   }
1116   Result = j;
1117   return Result;
1118 }
1119 /* #pragma optimize ("g", off) */ /* not needed for MSVC it seems ... */
1120 /* sec 0895 */
1121 void hyphenate (void)
1122 {
1123 /*  char i, j, l;  */
1124   char i, j;
1125   int l;              /* 95/Jan/7 */
1126   halfword q, r, s;
1127   halfword bchar;
1128   halfword majortail, minortail;
1129 /*  ASCII_code c;  */
1130   int c;              /* 95/Jan/7 */
1131   char cloc;
1132 /*  integer rcount; */
1133   int rcount;           /* 95/Jan/7 */
1134   halfword hyfnode;
1135   trie_pointer z;
1136   integer v;
1137   hyph_pointer h;
1138   str_number k;
1139   pool_pointer u;
1140
1141   for (j = 0; j <= hn; j++) hyf[j] = 0;
1142   h = hc[1];
1143   incr(hn);
1144   hc[hn] = cur_lang;
1145   for (j = 2; j <= hn; j++) h = (h + h + hc[j]) % hyphen_prime;
1146   while (true)
1147   {
1148     k = hyph_word[h];
1149     if (k == 0)
1150       goto lab45;
1151     if (length(k) < hn)
1152       goto lab45;
1153     if (length(k) == hn)
1154     {
1155       j = 1;
1156       u = str_start[k];
1157       do
1158       {
1159         if (str_pool[u] < hc[j])
1160           goto lab45;
1161         if (str_pool[u] > hc[j])
1162           goto lab30;
1163         incr(j);
1164         incr(u);
1165       }
1166       while(!(j > hn));
1167       s = hyph_list[h];
1168       while (s != 0)
1169       {  /* while s<>null do l.18173 */
1170         hyf[mem[s].hh.v.LH] = 1;
1171         s = mem[s].hh.v.RH;
1172       }
1173       decr(hn);
1174       goto lab40;
1175     }
1176 lab30:;
1177     if (h > 0)
1178       decr(h);
1179 /*    else h = 607;  */
1180     else
1181       h = hyphen_prime;
1182   }
1183 lab45:
1184   decr(hn);
1185   if (trie_trc[cur_lang + 1]!= cur_lang)
1186     return;
1187   hc[0] = 0;
1188   hc[hn + 1]= 0;
1189   hc[hn + 2]= 256;
1190   for (j = 0; j <= hn - rhyf + 1; j++)
1191   {
1192     z = trie_trl[cur_lang + 1] + hc[j];
1193     l = j;
1194     while (hc[l]== trie_trc[z])
1195     {
1196       if (trie_tro[z]!= min_trie_op)
1197       {
1198         v = trie_tro[z];
1199         do
1200         {
1201           v = v + op_start[cur_lang];
1202           i = l - hyf_distance[v];
1203           if (hyf_num[v] > hyf[i])
1204             hyf[i]= hyf_num[v];
1205           v = hyf_next[v];
1206         }
1207         while(!(v == min_trie_op));
1208       }
1209       incr(l);
1210       z = trie_trl[z]+ hc[l];
1211     }
1212   }
1213 lab40:
1214   for (j = 0; j <= lhyf - 1; j++)
1215     hyf[j] = 0;
1216   for (j = 0; j <= rhyf - 1; j++)
1217     hyf[hn - j]= 0;
1218   for (j = lhyf; j <= hn - rhyf; j++)
1219     if (odd(hyf[j]))
1220       goto lab41;
1221   return;
1222 lab41:;
1223   q = mem[hb].hh.v.RH;
1224   mem[hb].hh.v.RH = 0;
1225   r = mem[ha].hh.v.RH;
1226   mem[ha].hh.v.RH = 0;
1227   bchar = hyfbchar;
1228   if ((ha >= hi_mem_min))
1229     if (mem[ha].hh.b0 != hf)
1230       goto lab42;
1231     else
1232     {
1233       init_list = ha;
1234       init_lig = false;
1235       hu[0] = mem[ha].hh.b1;
1236     }
1237   else if (mem[ha].hh.b0 == 6)
1238     if (mem[ha + 1].hh.b0 != hf)
1239       goto lab42;
1240     else
1241     {
1242       init_list = mem[ha + 1].hh.v.RH;
1243       init_lig = true;
1244       init_lft = (mem[ha].hh.b1 > 1);
1245       hu[0] = mem[ha + 1].hh.b1;
1246       if (init_list == 0)
1247         if (init_lft)
1248         {
1249           hu[0]= 256;
1250           init_lig = false;
1251         }
1252       free_node(ha, 2);
1253     }
1254   else
1255   {
1256     if (!(r >= hi_mem_min))
1257       if (mem[r].hh.b0 == 6)
1258         if (mem[r].hh.b1 > 1)
1259           goto lab42;
1260     j = 1;
1261     s = ha;
1262     init_list = 0;
1263     goto lab50;
1264   }
1265   s = cur_p;
1266   while (mem[s].hh.v.RH != ha)
1267     s = mem[s].hh.v.RH;
1268   j = 0;
1269   goto lab50;
1270 lab42:
1271   s = ha;
1272   j = 0;
1273   hu[0] = 256;
1274   init_lig = false;
1275   init_list = 0;
1276 lab50:
1277   flush_node_list(r);
1278   do
1279   {
1280     l = j;
1281     j = reconstitute(j, hn, bchar, hyf_char) + 1;
1282     if (hyphen_passed == 0)
1283     {
1284       mem[s].hh.v.RH = mem[hold_head].hh.v.RH;
1285 /*    while(mem[s].hh.v.RH > 0)*/ /* 94/Mar/22 */
1286       while (link(s) != 0) /* l.17903 */
1287         s = link(s);
1288       if (odd(hyf[j - 1]))
1289       {
1290         l = j;
1291         hyphen_passed = j - 1;
1292         mem[hold_head].hh.v.RH = 0; /* link(hold_head):=null; */
1293       }
1294     }
1295     if (hyphen_passed > 0)
1296       do
1297       {
1298         r = get_node(2);
1299         mem[r].hh.v.RH = mem[hold_head].hh.v.RH;
1300         mem[r].hh.b0 = 7;
1301         majortail = r;
1302         rcount = 0;
1303 /* while link(major_tail) > null do advance_major_tail; l.17929 */
1304 /*      while(mem[majortail].hh.v.RH > 0) { */ /* 94/Mar/22 */
1305         while (mem[majortail].hh.v.RH != 0)
1306         {
1307           majortail = mem[majortail].hh.v.RH;
1308           incr(rcount);
1309         }
1310         i = hyphen_passed;
1311         hyf[i]= 0;
1312         minortail = 0;
1313         mem[r + 1].hh.v.LH = 0;
1314         hyfnode = new_character(hf, hyf_char);
1315         if (hyfnode != 0)
1316         {
1317           incr(i);
1318           c = hu[i];
1319           hu[i]= hyf_char;
1320           {
1321             mem[hyfnode].hh.v.RH = avail;
1322             avail = hyfnode;
1323 #ifdef STAT
1324             decr(dyn_used);
1325 #endif /* STAT */
1326           }
1327         }
1328         while (l <= i)
1329         {
1330           l = reconstitute(l, i, font_bchar[hf], 256) + 1;
1331 /*        if (mem[hold_head].hh.v.RH > 0)*/  /* 94/Mar/22 */
1332           if (mem[hold_head].hh.v.RH != 0) /* BUG FIX ??? */
1333           {
1334             if (minortail == 0) /* if minor_tail=null then */
1335               mem[r + 1].hh.v.LH = mem[hold_head].hh.v.RH;
1336             else
1337               mem[minortail].hh.v.RH = mem[hold_head].hh.v.RH;
1338             minortail = mem[hold_head].hh.v.RH;
1339 /*    while(mem[minortail].hh.v.RH > 0)*/ /* 94/Mar/22 */
1340             while (mem[minortail].hh.v.RH != 0)  /* BUG FIX */
1341               minortail = mem[minortail].hh.v.RH;
1342           }
1343         }
1344         if (hyfnode != 0) /* if hyf_node<>null then l.17956 */
1345         {
1346           hu[i]= c;
1347           l = i;
1348           decr(i);
1349         }
1350         minortail = 0;
1351         mem[r + 1].hh.v.RH = 0;
1352         cloc = 0;
1353 /* if bchar_label[hf]<non_address then l.17991 3.1415 */
1354 /*      if (bchar_label[hf]< font_mem_size) */
1355 /* if bchar_label[hf]<>non_address then l.17991 3.14159 */
1356         if (bchar_label[hf]!= non_address) /* i.e. 0 --- 96/Jan/15 */
1357         {
1358           decr(l);
1359           c = hu[l];
1360           cloc = l;
1361           hu[l]= 256;
1362         }
1363         while (l < j)
1364         {
1365           do
1366           {
1367             l = reconstitute(l, hn, bchar, 256) + 1;
1368             if (cloc > 0)
1369             {
1370               hu[cloc] = c;    /* c may be used ... */
1371               cloc = 0;
1372             }
1373 /*    if (mem[hold_head].hh.v.RH > 0)  */    /* 94/Mar/22 ??? */
1374             if (mem[hold_head].hh.v.RH != 0)     /* BUG FIX */
1375             {
1376               if (minortail == 0) /* begin if minor_tail=null then */
1377                 mem[r + 1].hh.v.RH = mem[hold_head].hh.v.RH;
1378               else
1379                 mem[minortail].hh.v.RH = mem[hold_head].hh.v.RH;
1380               minortail = mem[hold_head].hh.v.RH;
1381 /*     while link(minor_tail)>null do minor_tail:=link(minor_tail); l.17977 */
1382 /*      while(mem[minortail].hh.v.RH > 0)*/ /* 94/Mar/22 */
1383               while (mem[minortail].hh.v.RH != 0)    /* ??? */
1384                 minortail = mem[minortail].hh.v.RH;
1385             }
1386           }
1387           while (!(l >= j));
1388           while (l > j)
1389           {
1390             j = reconstitute(j, hn, bchar, 256) + 1;
1391             mem[majortail].hh.v.RH = mem[hold_head].hh.v.RH;
1392 /*          while (mem[majortail].hh.v.RH > 0) { */ /* 94/Mar/22 */
1393             while (mem[majortail].hh.v.RH != 0)
1394             {
1395               majortail = mem[majortail].hh.v.RH;
1396               incr(rcount);
1397             }
1398           }
1399         }
1400         if (rcount > 127)
1401         {
1402           mem[s].hh.v.RH = mem[r].hh.v.RH;
1403           mem[r].hh.v.RH = 0; /* link(r):=null */
1404           flush_node_list(r);
1405         }
1406         else
1407         {
1408           mem[s].hh.v.RH = r;
1409           mem[r].hh.b1 = rcount;
1410         }
1411         s = majortail;
1412         hyphen_passed = j - 1;
1413         mem[hold_head].hh.v.RH = 0;  /* link(hold_head):=null; */
1414       } while(!(! odd(hyf[j - 1])));
1415      } while(!(j > hn));
1416      mem[s].hh.v.RH = q;
1417      flush_list(init_list);
1418 }
1419 /* #pragma optimize ("g", off) */ /* not needed for MSVC it seems ... */
1420 /* used only in itex.c */
1421 /* sec 0934 */
1422 void new_hyph_exceptions (void)
1423 {
1424 /*  small_number n;  */ /* in 3.141 */
1425   char n;
1426 /*  small_number j;  */ /* in 3.141 */
1427   char j;
1428   hyph_pointer h;
1429   str_number k;
1430   halfword p;
1431   halfword q;
1432   str_number s, t;
1433   pool_pointer u, v;
1434
1435   scan_left_brace();
1436   set_cur_lang();
1437   n = 0;
1438   p = 0;
1439
1440   while (true)
1441   {
1442     get_x_token();
1443 lab21:
1444     switch (cur_cmd)
1445     {
1446       case 11:
1447       case 12:
1448       case 68:
1449         if (cur_chr == 45)
1450         {
1451           if (n < 63)
1452           {
1453             q = get_avail();
1454             mem[q].hh.v.RH = p;
1455             mem[q].hh.v.LH = n;
1456             p = q;
1457           }
1458         }
1459         else
1460         {
1461           if (eqtb[(hash_size + 2139) + cur_chr].hh.v.RH == 0)
1462           {
1463             print_err("Not a letter");
1464             help2("Letters in \\hyphenation words must have \\lccode>0.",
1465                 "Proceed; I'll ignore the character I just read.");
1466             error();
1467           }
1468           else if (n < 63)
1469           {
1470             incr(n);
1471             hc[n]= eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
1472           }
1473         }
1474         break;
1475       case 16:
1476         {
1477           scan_char_num();
1478           cur_chr = cur_val;
1479           cur_cmd = 68;
1480           goto lab21;
1481         }
1482         break;
1483       case 10:
1484       case 2:
1485         {
1486           if (n > 1)
1487           {
1488             incr(n);
1489             hc[n]= cur_lang;
1490             str_room(n);
1491             h = 0;
1492             for (j = 1; j <= n; j++)
1493             {
1494               h =(h + h + hc[j]) % hyphen_prime;
1495               {
1496                 str_pool[pool_ptr]= hc[j];
1497                 incr(pool_ptr);
1498               }
1499             }
1500             s = make_string();
1501 /*    if (hyph_count == 607)*/
1502             if (hyph_count == hyphen_prime)
1503             {
1504 /*      overflow(942, 607);  */
1505               overflow("exception dictionary", hyphen_prime); /* exception dictionary - NOT DYNAMIC */
1506 /*    not dynamic ---- but can be set -e=... from command line in ini-TeX */
1507               return;     // abort_flag set
1508             }
1509             incr(hyph_count);
1510             while (hyph_word[h]!= 0)
1511             {
1512               k = hyph_word[h];
1513               if (length(k) < length(s))
1514                 goto lab40;
1515               if (length(k) > length(s))
1516                 goto lab45;
1517               u = str_start[k];
1518               v = str_start[s];
1519               do
1520               {
1521                 if (str_pool[u] < str_pool[v])
1522                   goto lab40;
1523                 if (str_pool[u] > str_pool[v])
1524                   goto lab45;
1525                 incr(u);
1526                 incr(v);
1527               }
1528               while(!(u == str_start[k + 1]));
1529 lab40:
1530               q = hyph_list[h];
1531               hyph_list[h] = p;
1532               p = q;
1533               t = hyph_word[h];
1534               hyph_word[h] = s;
1535               s = t;
1536 lab45:;
1537               if (h > 0)
1538                 decr(h);
1539 /*      else h = 607;  */
1540               else
1541                 h = hyphen_prime;
1542             }
1543             hyph_word[h]= s;
1544             hyph_list[h]= p;
1545           }
1546           if (cur_cmd == 2)
1547             return;
1548           n = 0;
1549           p = 0;
1550         }
1551         break;
1552       default:
1553         {
1554           print_err("Improper ");
1555           print_esc("hyphenation");
1556           print_string(" will be flushed");
1557           help2("Hyphenation exceptions must contain only letters",
1558               "and hyphens. But continue; I'll forgive and forget.");
1559           error();
1560         }
1561         break;
1562     } /* end of switch */
1563   }
1564 }
1565 /* sec 0968 */
1566 halfword prune_page_top_(halfword p)
1567 {
1568   register halfword Result;
1569   halfword prevp;
1570   halfword q;
1571
1572   prevp = temp_head;
1573   mem[temp_head].hh.v.RH = p;
1574 /* while p<>null do l.18803 */
1575   while(p != 0)
1576     switch(mem[p].hh.b0)
1577     {
1578       case 0:
1579       case 1:
1580       case 2:
1581         {
1582           q = new_skip_param(10);
1583           mem[prevp].hh.v.RH = q;
1584           mem[q].hh.v.RH = p;
1585           if (mem[temp_ptr + 1].cint > mem[p + 3].cint)
1586             mem[temp_ptr + 1].cint = mem[temp_ptr + 1].cint - mem[p + 3].cint;
1587           else
1588             mem[temp_ptr + 1].cint = 0;
1589           p = 0;  /* p:=null */
1590         }
1591         break;
1592       case 8:
1593       case 4:
1594       case 3:
1595         {
1596           prevp = p;
1597           p = mem[prevp].hh.v.RH;
1598         }
1599         break;
1600       case 10:
1601       case 11:
1602       case 12:
1603         {
1604           q = p;
1605           p = mem[q].hh.v.RH;
1606           mem[q].hh.v.RH = 0;
1607           mem[prevp].hh.v.RH = p;
1608           flush_node_list(q);
1609         }
1610         break;
1611       default:
1612         {
1613           confusion("pruning");
1614           return 0;       // abort_flag set
1615         }
1616         break;
1617     }
1618   Result = mem[temp_head].hh.v.RH;
1619   return Result;
1620 }
1621 /* sec 0970 */
1622 halfword vert_break_(halfword p, scaled h, scaled d)
1623 {
1624   register halfword Result;
1625   halfword prevp;
1626   halfword q, r;
1627   integer pi;
1628   integer b;
1629   integer leastcost;
1630   halfword best_place;
1631   scaled prevdp; 
1632 /*  small_number t;  */
1633   int t;              /* 95/Jan/7 */
1634   prevp = p;
1635
1636   leastcost = 1073741823L;  /* 2^30 - 1 */
1637   active_width[1] = 0;
1638   active_width[2] = 0;
1639   active_width[3] = 0;
1640   active_width[4] = 0;
1641   active_width[5] = 0;
1642   active_width[6] = 0;
1643   prevdp = 0;
1644   while (true)
1645   {
1646     if (p == 0)  /* if p=null l.18879 */
1647       pi = -10000;
1648     else switch(mem[p].hh.b0)
1649     {
1650       case 0:
1651       case 1:
1652       case 2:
1653         {
1654           active_width[1]= active_width[1]+ prevdp + mem[p + 3].cint;
1655           prevdp = mem[p + 2].cint;
1656           goto lab45;
1657         }
1658         break;
1659       case 8:
1660         goto lab45;
1661         break;
1662       case 10:
1663         if ((mem[prevp].hh.b0 < 9))
1664           pi = 0;
1665         else
1666           goto lab90;
1667         break;
1668       case 11:
1669         {
1670           if (mem[p].hh.v.RH == 0)/* if link(p)=null l.18903 */
1671             t = 12;
1672           else
1673             t = mem[mem[p].hh.v.RH].hh.b0;
1674           if (t == 10)
1675             pi = 0;
1676           else
1677             goto lab90;
1678         }
1679         break;
1680       case 12:
1681         pi = mem[p + 1].cint;
1682         break;
1683       case 4:
1684       case 3:
1685         goto lab45;
1686         break;
1687       default:
1688         {
1689           confusion("vertbreak");
1690           return 0;       // abort_flag set
1691         }
1692         break;
1693     }
1694     if (pi < 10000)      /* pi may be used ... */
1695     {
1696       if (active_width[1] < h)
1697         if ((active_width[3] != 0) || (active_width[4] != 0) || (active_width[5]!= 0))
1698           b = 0;
1699         else
1700           b = badness(h - active_width[1], active_width[2]);
1701       else if (active_width[1] - h > active_width[6])
1702         b = 1073741823L;  /* 2^30 - 1 */
1703       else
1704         b = badness(active_width[1] - h, active_width[6]);
1705       if (b < 1073741823L) /* 2^30 - 1 */
1706         if (pi <= -10000)
1707           b = pi;
1708         else if (b < 10000)
1709           b = b + pi;
1710         else
1711           b = 100000L;
1712       if (b <= leastcost)
1713       {
1714         best_place = p;
1715         leastcost = b;
1716         best_height_plus_depth = active_width[1]+ prevdp;
1717       }
1718       if ((b == 1073741823L) || (pi <= -10000))  /* 2^30 - 1 */
1719         goto lab30;
1720     }
1721     if ((mem[p].hh.b0 < 10) || (mem[p].hh.b0 > 11))
1722       goto lab45;
1723 lab90:
1724     if (mem[p].hh.b0 == 11)
1725       q = p;
1726     else
1727     {
1728       q = mem[p + 1].hh.v.LH;
1729       active_width[2 + mem[q].hh.b0] = active_width[2 + mem[q].hh.b0]+ mem[q + 2].cint;
1730       active_width[6] = active_width[6]+ mem[q + 3].cint;
1731       if ((mem[q].hh.b1 != 0)&&(mem[q + 3].cint != 0))
1732       {
1733         print_err("Infinite glue shrinkage found in box being split");
1734         help4("The box you are \\vsplitting contains some infinitely",
1735             "shrinkable glue, e.g., `\\vss' or `\\vskip 0pt minus 1fil'.",
1736             "Such glue doesn't belong there; but you can safely proceed,",
1737             "since the offensive shrinkability has been made finite.");
1738         error();
1739         r = new_spec(q);
1740         mem[r].hh.b1 = 0;
1741         delete_glue_ref(q);
1742         mem[p + 1].hh.v.LH = r;
1743         q = r;
1744       }
1745     }
1746     active_width[1] = active_width[1]+ prevdp + mem[q + 1].cint;
1747     prevdp = 0;
1748 lab45:
1749     if (prevdp > d)
1750     {
1751       active_width[1] = active_width[1]+ prevdp - d;
1752       prevdp = d;
1753     }
1754     prevp = p;
1755     p = mem[prevp].hh.v.RH;
1756   }
1757 lab30:
1758   Result = best_place; /* best_place may be used ... */
1759   return Result;
1760 }
1761 /* called only from tex7.c */
1762 /* sec 0977 */
1763 halfword vsplit_(eight_bits n, scaled h)
1764 {
1765   register halfword Result;
1766   halfword v;
1767   halfword p;
1768   halfword q;
1769
1770   v = eqtb[(hash_size + 1578) + n].hh.v.RH;
1771   if (cur_mark[3]!= 0)
1772   {
1773     delete_token_ref(cur_mark[3]);
1774     cur_mark[3] = 0;
1775     delete_token_ref(cur_mark[4]);
1776     cur_mark[4] = 0;
1777   }
1778   if (v == 0)    /* if v=null then l.18999 */
1779   {
1780     Result = 0; /*   begin vsplit:=null; return; */
1781     return(Result);
1782   }
1783   if (mem[v].hh.b0 != 1)
1784   {
1785     print_err("");
1786     print_esc("vsplit");
1787     print_string(" needs a ");
1788     print_esc("vbox");
1789     help2("The box you are trying to split is an \\hbox.",
1790         "I can't split such a box, so I'll leave it alone.");
1791     error();
1792     Result = 0;
1793     return(Result);
1794   }
1795   q = vert_break(mem[v + 5].hh.v.RH, h, split_max_depth);
1796   p = mem[v + 5].hh.v.RH;
1797   if (p == q)
1798     mem[v + 5].hh.v.RH = 0;
1799   else while (true)
1800   {
1801     if (mem[p].hh.b0 == 4)
1802       if (cur_mark[3]== 0)
1803       {
1804         cur_mark[3] = mem[p + 1].cint;
1805         cur_mark[4] = cur_mark[3];
1806         mem[cur_mark[3]].hh.v.LH = mem[cur_mark[3]].hh.v.LH + 2;
1807       }
1808       else
1809       {
1810         delete_token_ref(cur_mark[4]);
1811         cur_mark[4]= mem[p + 1].cint;
1812         incr(mem[cur_mark[4]].hh.v.LH);
1813       }
1814     if (mem[p].hh.v.RH == q)
1815     {
1816       mem[p].hh.v.RH = 0;
1817       goto lab30;
1818     }
1819     p = mem[p].hh.v.RH;
1820   }
1821 lab30:;
1822   q = prune_page_top(q);
1823   p = mem[v + 5].hh.v.RH;
1824   free_node(v, 7);
1825   if (q == 0)    /* if q=null l.18993 */
1826     eqtb[(hash_size + 1578) + n].hh.v.RH = 0;  /* then box(n):=null */
1827   else
1828     eqtb[(hash_size + 1578) + n].hh.v.RH = vpackage(q, 0, 1, 1073741823L);  /* 2^30 - 1 */
1829   Result = vpackage(p, h, 0, split_max_depth);
1830   return Result;
1831 }
1832 /* sec 0985 */
1833 void print_totals (void)
1834 {
1835   print_scaled(page_so_far[1]);
1836   if (page_so_far[2] != 0)
1837   {
1838     print_string(" plus ");
1839     print_scaled(page_so_far[2]);
1840     print_string("");
1841   }
1842   if (page_so_far[3] != 0)
1843   {
1844     print_string(" plus ");
1845     print_scaled(page_so_far[3]);
1846     print_string("fil");
1847   }
1848   if (page_so_far[4] != 0)
1849   {
1850     print_string(" plus ");
1851     print_scaled(page_so_far[4]);
1852     print_string("fill");
1853   }
1854   if (page_so_far[5] != 0)
1855   {
1856     print_string(" plus ");
1857     print_scaled(page_so_far[5]);
1858     print_string("filll");
1859   }
1860   if (page_so_far[6] != 0)
1861   {
1862     print_string(" minus ");
1863     print_scaled(page_so_far[6]);
1864   }
1865 }
1866 /* sec 0987 */
1867 void freeze_page_specs_(small_number s)
1868 {
1869   page_contents = s;
1870   page_so_far[0] = vsize;
1871   page_max_depth = max_depth;
1872   page_so_far[7] = 0;
1873   page_so_far[1] = 0;
1874   page_so_far[2] = 0;
1875   page_so_far[3] = 0;
1876   page_so_far[4] = 0;
1877   page_so_far[5] = 0;
1878   page_so_far[6] = 0;
1879   least_page_cost = 1073741823L;  /* 2^30 - 1 */
1880 #ifdef STAT
1881   if (tracing_pages > 0)
1882   {
1883     begin_diagnostic();
1884     print_nl("%% goal height=");
1885     print_scaled(page_so_far[0]);
1886     print_string(", max depth=");
1887     print_scaled(page_max_depth);
1888     end_diagnostic(false);
1889   }
1890 #endif /* STAT */
1891 }
1892 /* sec 0992 */
1893 void box_error_(eight_bits n)
1894 {
1895   error();
1896   begin_diagnostic();
1897   print_nl("The following box has been deleted:");
1898   show_box(eqtb[(hash_size + 1578) + n].hh.v.RH);
1899   end_diagnostic(true);
1900   flush_node_list(eqtb[(hash_size + 1578) + n].hh.v.RH);
1901   eqtb[(hash_size + 1578) + n].hh.v.RH = 0;
1902 }
1903 /* sec 0993 */
1904 void ensure_vbox_(eight_bits n)
1905 {
1906   halfword p; 
1907   p = eqtb[(hash_size + 1578) + n].hh.v.RH;
1908   if (p != 0) /* if p<>null then if type(p)=hlist_node then l.19324 */
1909     if (mem[p].hh.b0 == 0)
1910     {
1911       print_err("Insertions can only be added to a vbox");
1912       help3("Tut tut: You're trying to \\insert into a",
1913           "\\box register that now contains an \\hbox.",
1914           "Proceed, and I'll discard its present contents.");
1915       box_error(n);
1916     }
1917 }
1918 /* called only from tex7.c */
1919 /* sec 1012 */
1920 void fire_up_(halfword c)
1921 {
1922   halfword p, q, r, s;
1923   halfword prevp;
1924 /*  unsigned char n;  */
1925   unsigned int n;         /* 95/Jan/7 */
1926   bool wait;
1927   integer savevbadness;
1928   scaled savevfuzz;
1929   halfword savesplittopskip;
1930
1931   if (mem[best_page_break].hh.b0 == 12)
1932   {
1933     geq_word_define((hash_size + 3202), mem[best_page_break + 1].cint);
1934     mem[best_page_break + 1].cint = 10000;
1935   }
1936   else
1937     geq_word_define((hash_size + 3202), 10000);
1938   if (cur_mark[2]!= 0)
1939   {
1940     if (cur_mark[0]!= 0)
1941       delete_token_ref(cur_mark[0]);
1942     cur_mark[0]= cur_mark[2];
1943     incr(mem[cur_mark[0]].hh.v.LH);
1944     delete_token_ref(cur_mark[1]);
1945     cur_mark[1]= 0;
1946   }
1947   if (c == best_page_break)
1948     best_page_break = 0;
1949   if (eqtb[(hash_size + 1833)].hh.v.RH != 0)
1950   {
1951     print_err("");
1952     print_esc("box");
1953     print_string("255 is not void");
1954     help2("You shouldn't use \\box255 except in \\output routines.",
1955         "Proceed, and I'll discard its present contents.");
1956     box_error(255);
1957   }
1958   insert_penalties = 0;
1959   savesplittopskip = eqtb[(hash_size + 792)].hh.v.RH;
1960   if (holding_inserts <= 0)
1961   {
1962     r = mem[mem_top].hh.v.RH;
1963     while (r != mem_top)
1964     {
1965       if (mem[r + 2].hh.v.LH != 0)
1966       {
1967         n = mem[r].hh.b1;
1968         ensure_vbox(n);
1969 /*    if box(n)=null then box(n):=new_null_box; l.19759 */
1970         if (eqtb[(hash_size + 1578) + n].hh.v.RH == 0)
1971           eqtb[(hash_size + 1578) + n].hh.v.RH = new_null_box();
1972         p = eqtb[(hash_size + 1578) + n].hh.v.RH + 5;
1973         while (mem[p].hh.v.RH != 0)
1974           p = mem[p].hh.v.RH;
1975         mem[r + 2].hh.v.RH = p;
1976       }
1977       r = mem[r].hh.v.RH;
1978     }
1979   }
1980   q = hold_head;
1981   mem[q].hh.v.RH = 0;
1982   prevp = page_head;
1983   p = mem[prevp].hh.v.RH;
1984   while (p != best_page_break)
1985   {
1986     if (mem[p].hh.b0 == 3)
1987     {
1988       if (holding_inserts <= 0)
1989       {
1990         r = mem[mem_top].hh.v.RH;
1991         while (mem[r].hh.b1 != mem[p].hh.b1)
1992           r = mem[r].hh.v.RH;
1993 /*  if best_ins_ptr(r)=null then wait:=true l.19783 */
1994         if (mem[r + 2].hh.v.LH == 0)
1995           wait = true;
1996         else
1997         {
1998           wait = false;
1999           s = mem[r + 2].hh.v.RH;
2000           mem[s].hh.v.RH = mem[p + 4].hh.v.LH;
2001           if (mem[r + 2].hh.v.LH == p)
2002           {
2003             if (mem[r].hh.b0 == 1)
2004               if ((mem[r + 1].hh.v.LH == p) && (mem[r + 1].hh.v.RH != 0))
2005               {
2006                 while (mem[s].hh.v.RH != mem[r + 1].hh.v.RH)
2007                   s = mem[s].hh.v.RH;
2008                 mem[s].hh.v.RH = 0;
2009                 eqtb[(hash_size + 792)].hh.v.RH = mem[p + 4].hh.v.RH;
2010                 mem[p + 4].hh.v.LH = prune_page_top(mem[r + 1].hh.v.RH);
2011                 if (mem[p + 4].hh.v.LH != 0)
2012                 {
2013                   temp_ptr = vpackage(mem[p + 4].hh.v.LH, 0, 1, 1073741823L);  /* 2^30 - 1 */
2014                   mem[p + 3].cint = mem[temp_ptr + 3].cint + mem[temp_ptr + 2].cint;
2015                   free_node(temp_ptr, 7);
2016                   wait = true;
2017                 }
2018               }
2019             mem[r + 2].hh.v.LH = 0;
2020             n = mem[r].hh.b1;
2021             temp_ptr = mem[eqtb[(hash_size + 1578) + n].hh.v.RH + 5].hh.v.RH;
2022             free_node(eqtb[(hash_size + 1578) + n].hh.v.RH, 7);
2023             eqtb[(hash_size + 1578) + n].hh.v.RH = vpackage(temp_ptr, 0, 1, 1073741823L);  /* 2^30 - 1 */
2024           }
2025           else
2026           {
2027             while (mem[s].hh.v.RH != 0)
2028               s = mem[s].hh.v.RH;
2029             mem[r + 2].hh.v.RH = s;
2030           }
2031         }
2032         mem[prevp].hh.v.RH = mem[p].hh.v.RH;
2033         mem[p].hh.v.RH = 0;
2034         if (wait)
2035         {
2036           mem[q].hh.v.RH = p;
2037           q = p;
2038           incr(insert_penalties);
2039         }
2040         else
2041         {
2042           delete_glue_ref(mem[p + 4].hh.v.RH);
2043           free_node(p, 5);
2044         }
2045         p = prevp;
2046       }
2047     }
2048     else if (mem[p].hh.b0 == 4)
2049     {
2050       if (cur_mark[1] == 0)
2051       {
2052         cur_mark[1]= mem[p + 1].cint;
2053         incr(mem[cur_mark[1]].hh.v.LH);
2054       }
2055       if (cur_mark[2] != 0)
2056         delete_token_ref(cur_mark[2]);
2057       cur_mark[2]= mem[p + 1].cint;
2058       incr(mem[cur_mark[2]].hh.v.LH);
2059     }
2060     prevp = p;
2061     p = mem[prevp].hh.v.RH;
2062   }
2063   eqtb[(hash_size + 792)].hh.v.RH = savesplittopskip;
2064   if (p != 0)    /* if p<>null then l.19730 */
2065   {
2066     if (mem[contrib_head].hh.v.RH == 0)/* if link(contrib_head)=null then */
2067       if (nest_ptr == 0)
2068         tail = page_tail;
2069       else
2070         nest[0].tail_field = page_tail;
2071     mem[page_tail].hh.v.RH = mem[contrib_head].hh.v.RH;
2072     mem[contrib_head].hh.v.RH = p;
2073     mem[prevp].hh.v.RH = 0; /*   link(prev_p):=null; */
2074   }
2075   savevbadness = vbadness;
2076   vbadness = 10000;
2077   savevfuzz = eqtb[(hash_size + 3739)].cint;
2078   eqtb[(hash_size + 3739)].cint = 1073741823L;  /* 2^30 - 1 */
2079   eqtb[(hash_size + 1833)].hh.v.RH = vpackage(mem[page_head].hh.v.RH, best_size, 0, page_max_depth);
2080   vbadness = savevbadness;
2081   eqtb[(hash_size + 3739)].cint = savevfuzz;
2082 /*  if (last_glue != 262143L) */
2083   if (last_glue != empty_flag)
2084     delete_glue_ref(last_glue);
2085   page_contents = 0;
2086   page_tail = page_head;
2087   mem[page_head].hh.v.RH = 0;
2088 /*  last_glue = 262143L;  */
2089   last_glue = empty_flag;
2090   last_penalty = 0;
2091   last_kern = 0;
2092   page_so_far[7] = 0;
2093   page_max_depth = 0;
2094   if (q != hold_head)
2095   {
2096     mem[page_head].hh.v.RH = mem[hold_head].hh.v.RH;
2097     page_tail = q;
2098   }
2099   r = mem[mem_top].hh.v.RH;
2100   while (r != mem_top)
2101   {
2102     q = mem[r].hh.v.RH;
2103     free_node(r, 4);
2104     r = q;
2105   }
2106   mem[mem_top].hh.v.RH = mem_top;
2107 /* if (top_mark<>null)and(first_mark=null) then l.19654 */
2108   if ((cur_mark[0]!= 0) && (cur_mark[1]== 0))
2109   {
2110     cur_mark[1] = cur_mark[0];
2111     incr(mem[cur_mark[0]].hh.v.LH);
2112   }
2113 /* if output_routine<>null then */
2114   if (output_routine != 0)
2115     if (dead_cycles >= max_dead_cycles)
2116     {
2117       print_err("Output loop---");
2118       print_int(dead_cycles);
2119       print_string(" consecutive dead cycles");
2120       help3("I've concluded that your \\output is awry; it never does",
2121           "\\ship_out, so I'm shipping \box255 out myself. Next ",
2122           "increase \\maxdeadcycles if you want me to be more patient!");
2123       error();
2124     }
2125     else
2126     {
2127       output_active = true;
2128       incr(dead_cycles);
2129       push_nest();
2130       mode = -1;
2131       cur_list.aux_field.cint = ignore_depth;
2132       mode_line = - (integer) line;
2133       begin_token_list(output_routine, 6); /* output */
2134       new_save_level(8);
2135       normal_paragraph();
2136       scan_left_brace();
2137       return;
2138     }
2139   {
2140     if (mem[page_head].hh.v.RH != 0)
2141     {
2142       if (mem[contrib_head].hh.v.RH == 0)
2143         if (nest_ptr == 0)
2144           tail = page_tail;
2145         else
2146           nest[0].tail_field = page_tail;
2147       else
2148         mem[page_tail].hh.v.RH = mem[contrib_head].hh.v.RH;
2149       mem[contrib_head].hh.v.RH = mem[page_head].hh.v.RH;
2150       mem[page_head].hh.v.RH = 0;
2151       page_tail = page_head;
2152     }
2153     ship_out(eqtb[(hash_size + 1833)].hh.v.RH);
2154     eqtb[(hash_size + 1833)].hh.v.RH = 0; 
2155   }
2156 }
2157 /* used to continue here with build_page etc in tex6.c */