texlive[56014] Build/source/texk/web2c: Purge more 'goto' and

commits+ascherer at tug.org commits+ascherer at tug.org
Sat Aug 1 16:27:01 CEST 2020


Revision: 56014
          http://tug.org/svn/texlive?view=revision&revision=56014
Author:   ascherer
Date:     2020-08-01 16:27:00 +0200 (Sat, 01 Aug 2020)
Log Message:
-----------
Purge more 'goto' and 'jump_out' leftovers.

Editor's note: Trying to make the WEB changefiles fully represent the
actual codes as modified for Web2c/TeX Live is like opening a veritable
can of worms.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/dvicopy.ch
    trunk/Build/source/texk/web2c/gftodvi.ch
    trunk/Build/source/texk/web2c/gftopk.ch
    trunk/Build/source/texk/web2c/gftype.ch
    trunk/Build/source/texk/web2c/mf.ch
    trunk/Build/source/texk/web2c/mft.ch
    trunk/Build/source/texk/web2c/patgen.ch
    trunk/Build/source/texk/web2c/pktype.ch
    trunk/Build/source/texk/web2c/tangle.ch
    trunk/Build/source/texk/web2c/tex.ch
    trunk/Build/source/texk/web2c/weave.ch

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/ChangeLog	2020-08-01 14:27:00 UTC (rev 56014)
@@ -2,12 +2,17 @@
 
 	* dvicopy.ch,
 	* dvitype.ch,
+	* gftodvi.ch,
 	* gftopk.ch,
 	* gftype.ch,
 	* mf.ch,
 	* mft.ch,
+	* patgen.ch,
 	* pktogf.ch,
-	* pktype.ch: Purge non-local 'goto' labels.
+	* pktype.ch,
+	* tangle.ch,
+	* tex.ch,
+	* weave.ch: Purge non-local 'goto' labels and 'jump_out' leftovers.
 
 2020-07-25  Andreas Scherer  <https://ascherer.github.io>
 

Modified: trunk/Build/source/texk/web2c/dvicopy.ch
===================================================================
--- trunk/Build/source/texk/web2c/dvicopy.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/dvicopy.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -156,6 +156,7 @@
 goto final_end;
 end;
 @y
+ at f noreturn==procedure
 @d abort(#)==begin write_ln(stderr, ' ',#,'.'); jump_out;
     end
 
@@ -170,6 +171,11 @@
 @z
 
 @x [24] Declare confusion as noreturn
+says |confusion(|indication of where we are|)|.
+ at y
+says |confusion|(indication of where we are).
+ at z
+ at x
 procedure confusion(@!p:pckt_pointer);
 @y
 noreturn procedure confusion(@!p:pckt_pointer);

Modified: trunk/Build/source/texk/web2c/gftodvi.ch
===================================================================
--- trunk/Build/source/texk/web2c/gftodvi.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/gftodvi.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -99,9 +99,17 @@
 @z
 
 @x [8] Add newline to end of abort() message, and exit abnormally.
+so a procedure called |jump_out| has been introduced. This procedure, which
+simply transfers control to the label |final_end| at the end of the program,
+contains the only non-local |goto| statement in \.{GFtoDVI}.
+@^system dependencies@>
+
 @d abort(#)==@+begin print(' ',#); jump_out;@+end
 @y
- at d abort(#)==@+begin write_ln (stderr, #); uexit (1);@+end
+so a procedure called |jump_out| has been introduced.
+@^system dependencies@>
+
+ at d abort(#)==@+begin write_ln (stderr, #); jump_out;@+end
 @z
 
 % [8] Remove nonlocal goto.
@@ -112,7 +120,7 @@
 end;
 @y
 @p procedure jump_out;
-begin uexit(0);
+begin uexit(1);
 end;
 @z
 

Modified: trunk/Build/source/texk/web2c/gftopk.ch
===================================================================
--- trunk/Build/source/texk/web2c/gftopk.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/gftopk.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -91,7 +91,7 @@
 simply transfers control to the label |final_end| at the end of the program,
 contains the only non-local |goto| statement in \.{GFtoPK}.
 @y
-so a procedure called |jump_out| has been introduced.
+so we might want to |abort| the program with an error message.
 @z
 @x
 @d abort(#)==begin print(' ',#); jump_out;

Modified: trunk/Build/source/texk/web2c/gftype.ch
===================================================================
--- trunk/Build/source/texk/web2c/gftype.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/gftype.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -135,11 +135,13 @@
 @z
 
 @x [7] Purge 'final_end' label.
+Such errors might be discovered inside of subroutines inside of subroutines,
 so a procedure called |jump_out| has been introduced. This procedure, which
 simply transfers control to the label |final_end| at the end of the program,
 contains the only non-local |goto| statement in \.{GFtype}.
 @y
-so a procedure called |jump_out| has been introduced.
+Such errors might be discovered inside of subroutines inside of subroutines,
+so we might want to |abort| the program with an error message.
 @z
 
 @x [7] Remove jump_out, and make `abort' end with a newline.

Modified: trunk/Build/source/texk/web2c/mf.ch
===================================================================
--- trunk/Build/source/texk/web2c/mf.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/mf.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -646,12 +646,14 @@
 begin goto end_of_MF;
 end;
 @y
-@ The |jump_out| procedure just cuts across all active procedure levels and
-simply calls
+@ The |jump_out| procedure just cuts across all active procedure levels.
+The body of |jump_out| simply calls
 `|close_files_and_terminate|;\thinspace' followed by a call on some system
 procedure that quietly terminates the program.
 @^system dependencies@>
 
+ at f noreturn==procedure
+
 @d do_final_end==begin
    update_terminal;
    ready_already:=0;

Modified: trunk/Build/source/texk/web2c/mft.ch
===================================================================
--- trunk/Build/source/texk/web2c/mft.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/mft.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -226,7 +226,7 @@
 @<Error handling...@>=
 procedure jump_out;
 begin
- at t\4\4@>{here files should be closed if the operating system requires it}
+{here files should be closed if the operating system requires it}
   @<Print the job |history|@>;
   new_line;
   if (history <> spotless) and (history <> harmless_message) then

Modified: trunk/Build/source/texk/web2c/patgen.ch
===================================================================
--- trunk/Build/source/texk/web2c/patgen.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/patgen.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -58,7 +58,22 @@
   print_ln (version_string);
 @z
 
+ at x [10] Purge 'jump_out' and 'end_of_PATGEN'.
+error message about what caused the error. Such errors might be
+discovered inside of subroutines inside of subroutines, so a \.{WEB}
+macro called |jump_out| has been introduced. This macro, which transfers
+control to the label |end_of_PATGEN| at the end of the program, contains
+the only non-local |@!goto| statement in \.{PATGEN}. Some \PASCAL\
+compilers do not implement non-local |goto| statements. In such cases
+the |goto end_of_PATGEN| in the definition of |jump_out| should simply
+be replaced by a call on some system procedure that quietly terminates
+the program.
+ at y
+error message about what caused the error.
+ at z
 @x Error handling
+ at d jump_out==goto end_of_PATGEN {terminates \.{PATGEN}}
+@#
 @d error(#)==begin print_ln(#); jump_out; end
 @y
 @d error(#)==begin write_ln(stderr, #); uexit(1); end;

Modified: trunk/Build/source/texk/web2c/pktype.ch
===================================================================
--- trunk/Build/source/texk/web2c/pktype.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/pktype.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -60,7 +60,7 @@
 @<Labels...@>=final_end;
 @y
 @ This module is deleted, because it is only useful for
-a non-local goto, which we don't use in C.
+a non-local |goto|, which we don't use in C.
 @z
 
 % [6] No need for |name_length| or |terminal_line_length|.  Since these

Modified: trunk/Build/source/texk/web2c/tangle.ch
===================================================================
--- trunk/Build/source/texk/web2c/tangle.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/tangle.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -52,9 +52,11 @@
 @z
 
 @x [2] Eliminate the |end_of_TANGLE| label.
+calls the `|jump_out|' procedure, which goes to the label |end_of_TANGLE|.
+
 @d end_of_TANGLE = 9999 {go here to wrap it up}
-
 @y
+calls the `|jump_out|' procedure.
 @z
 @x
 label end_of_TANGLE; {go here to finish}
@@ -193,6 +195,16 @@
 @z
 
 @x [34] Fix `jump_out'.
+and jumps out of the program. This is the only non-local |goto| statement
+in \.{TANGLE}. It is used when no recovery from a particular error has
+been provided.
+
+Some \PASCAL\ compilers do not implement non-local |goto| statements.
+@^system dependencies@>
+In such cases the code that appears at label |end_of_TANGLE| should be
+copied into the |jump_out| procedure, followed by a call to a system procedure
+that terminates the program.
+
 @d fatal_error(#)==begin new_line; print(#); error; mark_fatal; jump_out;
   end
 
@@ -201,9 +213,11 @@
 begin goto end_of_TANGLE;
 end;
 @y
+and jumps out of the program.
+
 @d jump_out==uexit(1)
 @d fatal_error(#)==begin new_line; write(stderr, #);
-     error; mark_fatal; uexit(1);
+     error; mark_fatal; jump_out;
   end
 @z
 

Modified: trunk/Build/source/texk/web2c/tex.ch
===================================================================
--- trunk/Build/source/texk/web2c/tex.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/tex.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -822,11 +822,29 @@
 % under Unix.  We call it `uexit' because there's a WEB symbol called
 % `exit' already.  We use a C macro to change `uexit' back to `exit'.
 @x [6.81] l.1852 - Eliminate nonlocal goto, since C doesn't have them.
+@ The |jump_out| procedure just cuts across all active procedure levels and
+goes to |end_of_TEX|. This is the only nontrivial |@!goto| statement in the
+whole program. It is used when there is no recovery from a particular error.
+
+Some \PASCAL\ compilers do not implement non-local |goto| statements.
+@^system dependencies@>
+In such cases the body of |jump_out| should simply be
+`|close_files_and_terminate|;\thinspace' followed by a call on some system
+procedure that quietly terminates the program.
+
 @<Error hand...@>=
 procedure jump_out;
 begin goto end_of_TEX;
 end;
 @y
+@ The |jump_out| procedure just cuts across all active procedure levels.
+The body of |jump_out| simply calls
+`|close_files_and_terminate|;\thinspace' followed by a call on some system
+procedure that quietly terminates the program.
+@^system dependencies@>
+
+ at f noreturn==procedure
+
 @d do_final_end==begin
    update_terminal;
    ready_already:=0;

Modified: trunk/Build/source/texk/web2c/weave.ch
===================================================================
--- trunk/Build/source/texk/web2c/weave.ch	2020-08-01 12:01:34 UTC (rev 56013)
+++ trunk/Build/source/texk/web2c/weave.ch	2020-08-01 14:27:00 UTC (rev 56014)
@@ -63,6 +63,13 @@
 @z
 
 @x [2] No global labels, define and call parse_arguments.
+calls the `|jump_out|' procedure, which goes to the label |end_of_WEAVE|.
+
+ at d end_of_WEAVE = 9999 {go here to wrap it up}
+ at y
+calls the `|jump_out|' procedure.
+ at z
+ at x
 label end_of_WEAVE; {go here to finish}
 const @<Constants in the outer block@>@/
 type @<Types in the outer block@>@/
@@ -225,7 +232,16 @@
       begin while not eoln(f) do vgetc(f);
 @z
 
- at x [??] Fix jump_out
+ at x [33] Fix jump_out
+Some \PASCAL\ compilers do not implement non-local |goto| statements.
+@^system dependencies@>
+In such cases the code that appears at label |end_of_WEAVE| should be
+copied into the |jump_out| procedure, followed by a call to a system procedure
+that terminates the program.
+
+ at y
+ at z
+ at x
 @d fatal_error(#)==begin new_line; print(#); error; mark_fatal; jump_out;
   end
 



More information about the tex-live-commits mailing list.