OSDN Git Service

print_string -> prints.
[putex/putex.git] / src / texsourc / tex2.c
index f98ad55..91f0697 100644 (file)
@@ -26,7 +26,7 @@ void restore_trace_(halfword p, char * s)
 {
   begin_diagnostic();
   print_char('{');
-  print_string(s);
+  prints(s);
   print_char(' ');
   show_eqtb(p);
   print_char('}');
@@ -49,7 +49,7 @@ void unsave (void)
       decr(save_ptr);
 
       if (save_type(save_ptr) == level_boundary)
-        goto lab30;
+        goto done;
 
       p = save_index(save_ptr);
 
@@ -106,7 +106,7 @@ void unsave (void)
         }
       }
     }
-lab30:
+done:
     cur_group = save_level(save_ptr);
     cur_boundary = save_index(save_ptr);
   }
@@ -124,7 +124,7 @@ void prepare_mag (void)
   {
     print_err("Incompatible magnification (");
     print_int(mag);
-    print_string(");");
+    prints(");");
     print_nl(" the previous value will be retained");
     help2("I can handle only one magnification ratio per job. So I've",
         "reverted to the magnification you used earlier on this run.");
@@ -175,7 +175,7 @@ void show_cur_cmd_chr (void)
   if (mode != shown_mode)
   {
     print_mode(mode);
-    print_string(": ");
+    prints(": ");
     shown_mode = mode;
   }
 
@@ -188,7 +188,7 @@ void show_context (void)
 {
   char old_setting;
   integer nn;
-  boolean bottomline;
+  boolean bottom_line;
   integer i;
   integer j;
   integer l;
@@ -200,17 +200,17 @@ void show_context (void)
   base_ptr = input_ptr;
   input_stack[base_ptr] = cur_input;
   nn = -1;
-  bottomline = false;
+  bottom_line = false;
 
   while (true)
   {
     cur_input = input_stack[base_ptr];
 
-    if ((state != 0))
-      if ((cur_input.name_field > 17) || (base_ptr == 0))
-        bottomline = true;
+    if ((state != token_list))
+      if ((name > 17) || (base_ptr == 0))
+        bottom_line = true;
 
-    if ((base_ptr == input_ptr) || bottomline || (nn < error_context_lines))
+    if ((base_ptr == input_ptr) || bottom_line || (nn < error_context_lines))
     {
       if ((base_ptr == input_ptr) || (state != token_list) ||
           (index != backed_up) || (loc != 0))
@@ -218,10 +218,10 @@ void show_context (void)
         tally = 0;
         old_setting = selector;
 
-        if (state != 0)
+        if (state != token_list)
         {
-          if (cur_input.name_field <= 17)
-            if ((cur_input.name_field == 0))
+          if (name <= 17)
+            if ((name == 0))
               if (base_ptr == 0)
                 print_nl("<*>");
               else
@@ -229,10 +229,12 @@ void show_context (void)
             else
             {
               print_nl("<read ");
-              if (cur_input.name_field == 17)
+
+              if (name == 17)
                 print_char('*');
               else
-                print_int(cur_input.name_field - 1);
+                print_int(name - 1);
+
               print_char('>');
             }
           else
@@ -241,14 +243,12 @@ void show_context (void)
             {
               print_ln();
 
-              if (cur_input.name_field > 17)
-                print(cur_input.name_field);
+              if (name > 17)
+                print(name);
 
               print_char('(');
               print_int(line);
-              print_char(')');
-              print_char(' ');
-              print_char(':');
+              prints(") :");
             }
             else
             {
@@ -258,13 +258,7 @@ void show_context (void)
           }
 
           print_char(' ');
-
-          {
-            l = tally;
-            tally = 0;
-            selector = pseudo;
-            trick_count = 1000000L;
-          }
+          begin_pseudoprint();
 
           if (buffer[limit] == end_line_char)
             j = limit;
@@ -275,13 +269,8 @@ void show_context (void)
             for (i = start; i <= j - 1; i++)
             {
               if (i == loc)
-              {
-                first_count = tally;
-                trick_count = tally + 1 + error_line - half_error_line;
+                set_trick_count();
 
-                if (trick_count < error_line)
-                  trick_count = error_line;
-              }
               print(buffer[i]);
             }
         }
@@ -311,7 +300,7 @@ void show_context (void)
 
             case macro:
               print_ln();
-              print_cs(cur_input.name_field);
+              print_cs(name);
               break;
 
             case output_text:
@@ -359,12 +348,7 @@ void show_context (void)
               break;
           }
 
-          {
-            l = tally;
-            tally = 0;
-            selector = pseudo;
-            trick_count = 1000000L;
-          }
+          begin_pseudoprint();
 
           if (index < macro)
             show_token_list(start, loc, 100000L);
@@ -375,13 +359,7 @@ void show_context (void)
         selector = old_setting;
 
         if (trick_count == 1000000L)
-        {
-          first_count = tally;
-          trick_count = tally + 1 + error_line - half_error_line;
-
-          if (trick_count < error_line)
-            trick_count = error_line;
-        }
+          set_trick_count();
         
         if (tally < trick_count)
           m = tally - first_count;
@@ -395,14 +373,14 @@ void show_context (void)
         }
         else
         {
-          print_string("...");
+          prints("...");
           p = l + first_count - half_error_line + 3;
           n = half_error_line;
         }
 
         for (q = p; q <= first_count - 1; q++)
           print_char(trick_buf[q % error_line]);
-        
+
         print_ln();
 
         for (q = 1; q <= n; q++)
@@ -417,7 +395,8 @@ void show_context (void)
           print_char(trick_buf[q % error_line]);
 
         if (m + n > error_line)
-          print_string("...");
+          prints("...");
+
         incr(nn);
       }
     }
@@ -427,45 +406,19 @@ void show_context (void)
       incr(nn); 
     }
 
-    if (bottomline)
-      goto lab30;
+    if (bottom_line)
+      goto done;
 
     decr(base_ptr);
   }
-lab30:
+
+done:
   cur_input = input_stack[input_ptr];
 }
-//#pragma optimize("g", off)          /* 98/Dec/10 experiment */
 /* sec 0323 */
 void begin_token_list_ (halfword p, quarterword t)
 {
-  {
-    if (input_ptr > max_in_stack)
-    {
-      max_in_stack = input_ptr;
-
-#ifdef ALLOCATEINPUTSTACK
-      if (input_ptr == current_stack_size)
-        input_stack = realloc_input_stack(increment_stack_size);
-
-      if (input_ptr == current_stack_size) /* check again after allocation */
-      {
-        overflow("input stack size", current_stack_size);
-        return;     // abort_flag set
-      }
-#else
-      if (input_ptr == stack_size) /* input stack - not dynamic */
-      {
-        overflow("input stack size", stack_size);
-        return;     // abort_flag set
-      }
-#endif
-    }
-
-    input_stack[input_ptr] = cur_input;
-    incr(input_ptr);
-  }
-
+  push_input();
   state = token_list;
   start = p;
   index = t;
@@ -500,7 +453,7 @@ void begin_token_list_ (halfword p, quarterword t)
             break;
         }
 
-        print_string("->");
+        prints("->");
         token_show(p);
         end_diagnostic(false);
       }
@@ -519,6 +472,7 @@ void end_token_list (void)
     else
     {
       delete_token_ref(start);
+
       if (index == macro)
         while (param_ptr > limit)
         {
@@ -533,7 +487,7 @@ void end_token_list (void)
     else
     {
       fatal_error("(interwoven alignment preambles are not allowed)");
-      return;     // abort_flag set
+      return;
     }
 
   pop_input();
@@ -559,31 +513,7 @@ void back_input (void)
     else
       incr(align_state);
 
-  {
-    if (input_ptr > max_in_stack)
-    {
-      max_in_stack = input_ptr;
-#ifdef ALLOCATEINPUTSTACK
-      if (input_ptr == current_stack_size)
-        input_stack = realloc_input_stack(increment_stack_size);
-
-      if (input_ptr == current_stack_size) /* check again after allocation */
-      {
-        overflow("input stack size", current_stack_size);
-        return;     // abort_flag set
-      }
-#else
-      if (input_ptr == stack_size) /* stack size - not dynamic */
-      {
-        overflow("input stack size", stack_size);
-        return;     // abort_flag set
-      }
-#endif
-    }
-    input_stack[input_ptr] = cur_input;
-    incr(input_ptr);
-  }
-
+  push_input();
   state = token_list;
   start = p;
   index = backed_up;
@@ -611,8 +541,8 @@ void begin_file_reading (void)
 {
   if (in_open == max_in_open)
   {
-    overflow("text input levels", max_in_open); /* text input levels - NOT DYNAMIC */
-    return;     // abort_flag set
+    overflow("text input levels", max_in_open);
+    return;
   }
 #ifdef ALLOCATEBUFFER
   if (first == current_buf_size)
@@ -621,46 +551,27 @@ void begin_file_reading (void)
   if (first == current_buf_size) /* check again after allocation */
   {
     overflow("buffer size", current_buf_size);
-    return;     // abort_flag set
+    return;
   }
 #else
   if (first == buf_size)
   {
-    overflow("buffer size", buf_size);  /* buffer size - not dynamic */
-    return;     // abort_flag set
+    overflow("buffer size", buf_size);
+    return;
   }
 #endif
+
   incr(in_open);
-  if (in_open > high_in_open)     /* 1999 Jan 17 */
+
+  if (in_open > high_in_open) /* 1999 Jan 17 */
     high_in_open = in_open;
-  {
-    if (input_ptr > max_in_stack)
-    {
-      max_in_stack = input_ptr;
-#ifdef ALLOCATEINPUTSTACK
-      if (input_ptr == current_stack_size)
-        input_stack = realloc_input_stack(increment_stack_size);
-      if (input_ptr == current_stack_size)
-      {
-        overflow("input stack size", current_stack_size);  /* check again after allocation */
-        return;     // abort_flag set
-      }
-#else
-      if (input_ptr == stack_size)
-      {
-        overflow("input stack size", stack_size);    /* input stack - not dynamic */
-        return;     // abort_flag set
-      }
-#endif
-    }
-    input_stack[input_ptr] = cur_input;
-    incr(input_ptr);
-  }
+
+  push_input();
   index = in_open;
   line_stack[index] = line;
   start = first;
   state = 1;
-  cur_input.name_field = 0;
+  name = 0;
 }
 /* sec 0329 */
 void end_file_reading (void)
@@ -668,7 +579,7 @@ void end_file_reading (void)
   first = start;
   line = line_stack[index];
 
-  if (cur_input.name_field > 17)
+  if (name > 17)
     a_close(cur_file);
 
   pop_input();
@@ -678,9 +589,8 @@ void end_file_reading (void)
 /* sec 0330 */
 void clear_for_error_prompt (void) 
 {
-  while ((state != 0) &&
-      (cur_input.name_field == 0) && (input_ptr > 0) &&
-      (loc > limit))
+  while ((state != 0) && (name == 0) &&
+    (input_ptr > 0) && (loc > limit))
     end_file_reading();
 
   print_ln();
@@ -697,7 +607,7 @@ void check_outer_validity (void)
 
     if (cur_cs != 0)
     {
-      if ((state == 0) || (cur_input.name_field < 1) || (cur_input.name_field > 17))
+      if ((state == 0) || (name < 1) || (name > 17))
       {
         p = get_avail();
         info(p) = cs_token_flag + cur_cs;
@@ -720,39 +630,40 @@ void check_outer_validity (void)
         print_err("Forbidden control sequence found");
       }
 
-      print_string(" while scanning ");
+      prints(" while scanning ");
       p = get_avail();
 
       switch (scanner_status)
       {
         case defining:
-          print_string("definition");
+          prints("definition");
           info(p) = right_brace_token + '}';
           break;
 
         case matching:
-          print_string("use");
+          prints("use");
           info(p) = par_token;
           long_state = outer_call;
           break;
 
         case aligning:
-          print_string("preamble");
+          prints("preamble");
           info(p) = right_brace_token + '}';
           q = p;
           p = get_avail();
           link(p) = q;
-          info(p) = cs_token_flag + frozen_cr; /*96/Jan/10*/
+          info(p) = cs_token_flag + frozen_cr;
           align_state = -1000000L;
           break;
 
         case absorbing:
-          print_string("text");
+          prints("text");
           info(p) = right_brace_token + '}';
           break;
       }
+
       ins_list(p);
-      print_string(" of ");
+      prints(" of ");
       sprint_cs(warning_index);
       help4("I suspect you have forgotten a `}', causing me",
           "to read past where you wanted me to stop.",
@@ -764,7 +675,7 @@ void check_outer_validity (void)
     {
       print_err("Incomplete ");
       print_cmd_chr(if_test, cur_if);
-      print_string("; all text was ignored after line ");
+      prints("; all text was ignored after line ");
       print_int(skip_line);
       help3("A forbidden control sequence occurred in skipped text.",
           "This kind of error happens when you say `\\if...' and forget",
@@ -775,9 +686,10 @@ void check_outer_validity (void)
       else
         help_line[2] = "The file ended while I was skipping conditional text.";
 
-      cur_tok = cs_token_flag + frozen_fi; /* 96/Jan/10 */
+      cur_tok = cs_token_flag + frozen_fi;
       ins_error();
-  }
+    }
+
     deletions_allowed = true;
   }
 }
@@ -879,7 +791,7 @@ void macro_call (void)
           p = temp_head;
           m = 0;
         }
-lab22:
+continu:
         get_token();
 
         if (cur_tok == info(r))
@@ -891,10 +803,10 @@ lab22:
             if (cur_tok < left_brace_limit)
               decr(align_state);
 
-            goto lab40;
+            goto found;
           }
           else
-            goto lab22;
+            goto continu;
         }
 
         if (s != r)
@@ -902,13 +814,13 @@ lab22:
           {
             print_err("Use of ");
             sprint_cs(warning_index);
-            print_string(" doesn't match its definition");
+            prints(" doesn't match its definition");
             help4("If you say, e.g., `\\def\\a1{...}', then you must always",
               "put `1' after `\\a', since control sequence names are",
               "made up of letters only. The macro here has not been",
               "followed by the required stuff, so I'm ignoring it.");
             error();
-            goto lab10;
+            goto exit;
           }
           else
           {
@@ -924,20 +836,20 @@ lab22:
                 {
                   if (u == r)
                     if (cur_tok != info(v))
-                      goto lab30;
+                      goto done;
                     else
                     {
                       r = link(v);
-                      goto lab22;
+                      goto continu;
                     }
 
                     if (info(u) != info(v))
-                      goto lab30;
+                      goto done;
 
                     u = link(u);
                     v = link(v);
                 }
-lab30:
+done:
                 t = link(t);
               }
             while (!(t == r));
@@ -953,7 +865,7 @@ lab30:
               runaway();
               print_err("Paragraph ended before ");
               sprint_cs(warning_index);
-              print_string("was complete");
+              prints("was complete");
               help3("I suspect you've forgotten a `}', causing me to apply this",
                   "control sequence to too much text. How can we recover?",
                   "My plan is to forget the whole thing and hope for the best.");
@@ -966,7 +878,7 @@ lab30:
             for (m = 0; m <= n; m++)
               flush_list(pstack[m]);
 
-            goto lab10;
+            goto exit;
           }
 
         if (cur_tok < right_brace_limit)
@@ -987,7 +899,7 @@ lab30:
                     runaway();
                     print_err("Paragraph ended before ");
                     sprint_cs(warning_index);
-                    print_string(" was complete");
+                    prints(" was complete");
                     help3("I suspect you've forgotten a `}', causing me to apply this",
                         "control sequence to too much text. How can we recover?",
                         "My plan is to forget the whole thing and hope for the best.");
@@ -999,7 +911,7 @@ lab30:
 
                   for (m = 0; m <= n; m++)
                     flush_list(pstack[m]);
-                  goto lab10;
+                  goto exit;
                 }
 
               if (cur_tok < right_brace_limit)
@@ -1010,10 +922,10 @@ lab30:
                   decr(unbalance);
 
                   if (unbalance == 0)
-                    goto lab31;
+                    goto done1;
                 }
             }
-lab31:
+done1:
             rbrace_ptr = p;
             store_new_token(cur_tok);
           }
@@ -1022,7 +934,7 @@ lab31:
             back_input();
             print_err("Argument of ");
             sprint_cs(warning_index);
-            print_string(" has an extra }");
+            prints(" has an extra }");
             help6("I've run across a `}' that doesn't seem to match anything.",
                 "For example, `\\def\\a#1{...}' and `\\a}' would produce",
                 "this error. If you simply proceed now, the `\\par' that",
@@ -1033,31 +945,31 @@ lab31:
             long_state = call;
             cur_tok = par_token;
             ins_error();
-            goto lab22;
+            goto continu;
           }
         else
         {
           if (cur_tok == space_token)
             if (info(r) <= end_match_token)
               if (info(r) >= match_token)
-                goto lab22;
+                goto continu;
 
           store_new_token(cur_tok);
         }
 
-        incr(m);          /* m may be used without having been ... */
+        incr(m);
 
         if (info(r) > end_match_token)
-          goto lab22;
+          goto continu;
 
         if (info(r) < match_token)
-          goto lab22;
-lab40:
+          goto continu;
+found:
         if (s != 0)
         {
           if ((m == 1) && (info(p) < right_brace_limit) && (p != temp_head))
           {
-            link(rbrace_ptr) = 0; /* rbrace_ptr may be used without ... */
+            link(rbrace_ptr) = 0;
             free_avail(p);
             p = link(temp_head);
             pstack[n] = link(p);
@@ -1071,10 +983,10 @@ lab40:
           if (tracing_macros > 0)
           {
             begin_diagnostic();
-            //print_nl(match_chr); /* matchchar may be used without ... */
+            //print_nl(match_chr);
             print_nl(""); print(match_chr);
             print_int(n);
-            print_string("<-");
+            prints("<-");
             show_token_list(pstack[n - 1], 0, 1000);
             end_diagnostic(false);
           }
@@ -1088,7 +1000,7 @@ lab40:
     end_token_list();
 
   begin_token_list(ref_count, macro);
-  cur_input.name_field = warning_index;
+  name = warning_index;
   loc = link(r);
 
   if (n > 0)
@@ -1101,16 +1013,16 @@ lab40:
       if (max_param_stack > current_param_size)
         param_stack = realloc_param_stack(increment_param_size);
 
-      if (max_param_stack > current_param_size) /* check again after allocation */
+      if (max_param_stack > current_param_size)
       {
         overflow("parameter stack size", current_param_size);
-        return;     // abort_flag set
+        return;
       }
 #else
       if (max_param_stack > param_size)
       {
-        overflow("parameter stack size", param_size); /* parameter stack - not dynamic */
-        return;     // abort_flag set
+        overflow("parameter stack size", param_size);
+        return;
       }
 #endif
     }
@@ -1120,7 +1032,7 @@ lab40:
 
     param_ptr = param_ptr + n;
   }
-lab10:
+exit:
   scanner_status = save_scanner_status;
   warning_index = save_warning_index;
 }
@@ -1210,7 +1122,7 @@ void expand (void)
         {
           print_err("Missing ");
           print_esc("endcsname");
-          print_string(" inserted");
+          prints(" inserted");
           help2("The control sequence marked <to be read again> should",
               "not appear between \\csname and \\endcsname.");
           back_error();
@@ -1232,13 +1144,13 @@ void expand (void)
             if (max_buf_stack == current_buf_size) /* check again after allocation */
             {
               overflow("buffer size", current_buf_size);
-              return;     // abort_flag set
+              return;
             }
 #else
             if (max_buf_stack == buf_size)
             {
               overflow("buffer size", buf_size); /* buffer size - not dynamic */
-              return;     // abort_flag set
+              return;
             }
 #endif
           }
@@ -1348,11 +1260,11 @@ void expand (void)
 /* sec 0380 */
 void get_x_token (void)
 {
-lab20:
+restart:
   get_next();
 
   if (cur_cmd <= max_command)
-    goto lab30;
+    goto done;
 
   if (cur_cmd >= call)
     if (cur_cmd < end_template)
@@ -1361,14 +1273,14 @@ lab20:
     {
       cur_cs = frozen_endv;
       cur_cmd = endv;
-      goto lab30;
+      goto done;
     }
   else
     expand();
 
-  goto lab20;
+  goto restart;
 
-lab30:
+done:
   if (cur_cs == 0)
     cur_tok = (cur_cmd * 256) + cur_chr;
   else
@@ -1526,7 +1438,7 @@ void scan_twenty_seven_bit_int (void)
 {
   scan_int();
 
-  if ((cur_val < 0) || (cur_val > 134217727L)) /* 2^27 - 1 */
+  if ((cur_val < 0) || (cur_val > 134217727L))
   {
     print_err("Bad delimiter code");
     help2("A numeric delimiter code must be between 0 and 2^{27}-1.",
@@ -1628,9 +1540,9 @@ void find_font_dimen_(boolean writing)
   {
     print_err("Font ");
     print_esc(""); print(font_id_text(f));
-    print_string(" has only ");
+    prints(" has only ");
     print_int(font_params[f]);
-    print_string(" fontdimen parameters");
+    prints(" fontdimen parameters");
     help2("To increase the number of font parameters, you must",
       "use \\fontdimen immediately after the \\font is loaded.");
     error();
@@ -1909,7 +1821,7 @@ void scan_something_internal_(small_number level, boolean negative)
       {
         print_err("You can't use `");
         print_cmd_chr(cur_cmd, cur_chr);
-        print_string("' after ");
+        prints("' after ");
         print_esc("the");
         help1("I'm forgetting what you said and using zero instead.");
         error();
@@ -1958,17 +1870,17 @@ void get_next (void)
   ASCII_code c, cc;
   char d;
 
-lab20:
+restart:
   cur_cs = 0;
 
   if (state != token_list)
   {
-lab25:
+lab_switch:
     if (loc <= limit)
     {
       cur_chr = buffer[loc];
       incr(loc);
-lab21:
+reswitch:
       cur_cmd = cat_code(cur_chr);
 
       switch (state + cur_cmd)
@@ -1976,7 +1888,7 @@ lab21:
         case any_state_plus(ignore):
         case skip_blanks + spacer:
         case new_line + spacer:
-          goto lab25;
+          goto lab_switch;
           break;
 
         case any_state_plus(escape):
@@ -1985,7 +1897,7 @@ lab21:
               cur_cs = null_cs;
             else
             {
-lab26:
+start_cs:
               k = loc;
               cur_chr = buffer[k];
               cat = cat_code(cur_chr);
@@ -2046,7 +1958,7 @@ lab26:
                             incr(k);
                           }
 
-                          goto lab26;
+                          goto start_cs;
                         }
                       }
                 }
@@ -2058,7 +1970,7 @@ lab26:
                 {
                   cur_cs = id_lookup(loc, k - loc);
                   loc = k;
-                  goto lab40;
+                  goto found;
                 }
               }
               else
@@ -2100,14 +2012,14 @@ lab26:
                           buffer[k] = buffer[k + d];
                           incr(k);
                         }
-                        goto lab26;
+                        goto start_cs;
                       }
                     }
               }
               cur_cs = single_base + buffer[loc];
               incr(loc);
             }
-lab40:
+found:
             cur_cmd = eq_type(cur_cs);
             cur_chr = equiv(cur_cs);
             
@@ -2148,7 +2060,7 @@ lab40:
                       {
                         incr(loc);
                         hex_to_cur_chr();
-                        goto lab21;
+                        goto reswitch;
                       }
                     }
 
@@ -2157,7 +2069,7 @@ lab40:
                   else
                     cur_chr = c - 64;
 
-                  goto lab21;
+                  goto reswitch;
                 }
               }
 
@@ -2173,7 +2085,7 @@ lab40:
             deletions_allowed = false;
             error();
             deletions_allowed = true;
-            goto lab20;
+            goto restart;
           }
           break;
 
@@ -2196,7 +2108,7 @@ lab40:
         case any_state_plus(comment):
           {
             loc = limit + 1;
-            goto lab25;
+            goto lab_switch;
           }
           break;
 
@@ -2249,7 +2161,7 @@ lab40:
     {
       state = new_line;
 
-      if (cur_input.name_field > 17)
+      if (name > 17)
       {
         incr(line);
         first = start;
@@ -2266,13 +2178,11 @@ lab40:
         {
           print_char(')');
           decr(open_parens);
-#ifndef _WINDOWS
-          fflush(stdout);
-#endif
+          update_terminal();
           force_eof = false;
           end_file_reading();
           check_outer_validity();
-          goto lab20;
+          goto restart;
         }
 
         if (end_line_char_inactive())
@@ -2285,7 +2195,7 @@ lab40:
       }
       else
       {
-        if (!(cur_input.name_field == 0))
+        if (!(name == 0))
         {
           cur_cmd = 0;
           cur_chr = 0;
@@ -2295,7 +2205,7 @@ lab40:
         if (input_ptr > 0)
         {
           end_file_reading();
-          goto lab20;
+          goto restart;
         }
 
         if (selector < log_only)
@@ -2325,12 +2235,12 @@ lab40:
         else
         {
           fatal_error("*** (job aborted, no legal \\end found)");
-          return;     // abort_flag set
+          return;
         }
       }
 
       check_interrupt();
-      goto lab25;
+      goto lab_switch;
     }
   }
   else if (loc != 0)
@@ -2381,7 +2291,7 @@ lab40:
         case out_param:
           {
             begin_token_list(param_stack[limit + cur_chr - 1], parameter);
-            goto lab20;
+            goto restart;
           }
           break;
 
@@ -2393,7 +2303,7 @@ lab40:
   else
   {
     end_token_list();
-    goto lab20;
+    goto restart;
   }
 
   if (cur_cmd <= car_ret)
@@ -2403,7 +2313,7 @@ lab40:
         if ((scanner_status == aligning) && (cur_align == 0))
         {
           fatal_error("(interwoven alignment preambles are not allowed)");
-          return;     // abort_flag set
+          return;
         }
 
         cur_cmd = extra_info(cur_align);
@@ -2415,6 +2325,6 @@ lab40:
           begin_token_list(v_part(cur_align), v_template);
 
         align_state = 1000000L;
-        goto lab20;
+        goto restart;
       }
 }
\ No newline at end of file