summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/dvitype.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2020-08-01 12:01:34 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2020-08-01 12:01:34 +0000
commit2b48c58a3269e00f95e2769500c0230b2b7f397a (patch)
treec318c9368cdcf720af8624d45c0579b23e0635cd /Build/source/texk/web2c/dvitype.ch
parent33b2e31d6d3f08f67bad4a8a66b6c38eeea3ab02 (diff)
Purge non-local 'goto' labels in WEB programs.
If code and comment disagree, most likely they both are wrong. ;o) git-svn-id: svn://tug.org/texlive/trunk@56013 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/dvitype.ch')
-rw-r--r--Build/source/texk/web2c/dvitype.ch23
1 files changed, 23 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/dvitype.ch b/Build/source/texk/web2c/dvitype.ch
index 661a4b7bdd0..7c0155943b1 100644
--- a/Build/source/texk/web2c/dvitype.ch
+++ b/Build/source/texk/web2c/dvitype.ch
@@ -60,6 +60,22 @@ procedure initialize; {this procedure gets things started properly}
print_ln (version_string);
@z
+@x [4] Purge non-local 'goto'.
+@ If the program has to stop prematurely, it goes to the
+`|final_end|'. Another label, |done|, is used when stopping normally.
+
+@d final_end=9999 {label for the end of it all}
+@d done=30 {go here when finished with a subtask}
+
+@<Labels...@>=final_end,done;
+@y
+@ Label |done| is used when stopping normally.
+
+@d done=30 {go here when finished with a subtask}
+
+@<Labels...@>=done;
+@z
+
% There were no complaints that these values are too small, and adjusting
% them dynamically requires to resize a large number of arrays and is not
% worth the effort (if necessary one can recompile with larger values).
@@ -83,6 +99,13 @@ procedure initialize; {this procedure gets things started properly}
@z
@x [7] Remove non-local goto.
+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 \.{DVItype}.
+@y
+so a procedure called |jump_out| has been introduced.
+@z
+@x
@d abort(#)==begin print(' ',#); jump_out;
end
@d bad_dvi(#)==abort('Bad DVI file: ',#,'!')