texlive[67887] Build/source/texk/web2c/cwebdir: [CWEB] Refurbish
commits+ascherer at tug.org
commits+ascherer at tug.org
Fri Aug 11 18:49:21 CEST 2023
Revision: 67887
http://tug.org/svn/texlive?view=revision&revision=67887
Author: ascherer
Date: 2023-08-11 18:49:21 +0200 (Fri, 11 Aug 2023)
Log Message:
-----------
[CWEB] Refurbish 'phase_three'.
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
trunk/Build/source/texk/web2c/cwebdir/cweave.w
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-08-11 15:14:48 UTC (rev 67886)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2023-08-11 16:49:21 UTC (rev 67887)
@@ -1,3 +1,10 @@
+2023-08-11 Andreas Scherer <https://ascherer.github.io>
+
+ * ctwill-mini.ch,
+ * ctwill-w2c.ch,
+ * cweav-w2c.ch,
+ * cweave.w: Refurbish 'phase_three'.
+
2023-08-08 Andreas Scherer <https://ascherer.github.io>
* comm-w2c.ch,
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2023-08-11 15:14:48 UTC (rev 67886)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch 2023-08-11 16:49:21 UTC (rev 67887)
@@ -1874,6 +1874,14 @@
@-footnote@>
@z
+Section 264.
+
+ at x
+@** Phase three processing.
+ at y
+ at r @** Phase three processing.
+ at z
+
Section 265.
@x
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2023-08-11 15:14:48 UTC (rev 67886)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch 2023-08-11 16:49:21 UTC (rev 67887)
@@ -1112,24 +1112,16 @@
@z
@x
-if (no_xref) {
- finish_line();
- out_str("\\end");
- at .\\end@>
- finish_line();
-}
+ if (show_progress) fputs("\nWriting the index...",stdout);
@y
-if (no_xref) {
- finish_line();
- out_str("\\end");
- at .\\end@>
-}
+ if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
+ if (change_exists) {
+ @<Tell about changed sections@>@; finish_line(); finish_line();
+ }
@y
- phase=3; if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
@@ -1139,13 +1131,6 @@
@z
@x
- if (change_exists) {
- @<Tell about changed sections@>@; finish_line(); finish_line();
- }
- at y
- at z
-
- at x
fatal("! Cannot open section file ",scn_file_name);
@y
fatal(_("! Cannot open section file "),scn_file_name);
@@ -1152,14 +1137,9 @@
@z
@x
- at .\\end@>
- finish_line();
- fclose(active_file);
-}
+fclose(active_file);
@y
- at .\\end@>
-}
-finish_line(); fclose(active_file); active_file=tex_file=NULL;
+fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2023-08-11 15:14:48 UTC (rev 67886)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch 2023-08-11 16:49:21 UTC (rev 67887)
@@ -515,27 +515,12 @@
@z
@x
-if (no_xref) {
- finish_line();
- out_str("\\end");
- at .\\end@>
- finish_line();
-}
+ if (show_progress) fputs("\nWriting the index...",stdout);
@y
-if (no_xref) {
- finish_line();
- out_str("\\end");
- at .\\end@>
-}
+ if (show_progress) fputs(_("\nWriting the index..."),stdout);
@z
@x
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
- at y
- phase=3; if (show_progress) fputs(_("\nWriting the index..."),stdout);
- at z
-
- at x
fatal("! Cannot open index file ",idx_file_name);
@y
fatal(_("! Cannot open index file "),idx_file_name);
@@ -548,14 +533,9 @@
@z
@x
- at .\\end@>
- finish_line();
- fclose(active_file);
-}
+fclose(active_file);
@y
- at .\\end@>
-}
-finish_line(); fclose(active_file); active_file=tex_file=NULL;
+fclose(active_file); active_file=tex_file=NULL;
if (check_for_change) @<Update the result when it has changed@>@;
@z
Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w 2023-08-11 15:14:48 UTC (rev 67886)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w 2023-08-11 16:49:21 UTC (rev 67887)
@@ -4525,31 +4525,32 @@
@c
static void
phase_three(void) {
-if (no_xref) {
- finish_line();
+phase=3;
+finish_line(); /* the bulk of |tex_file| has been written */
+if (no_xref)
out_str("\\end");
@.\\end@>
- finish_line();
-}
else {
- phase=3; if (show_progress) fputs("\nWriting the index...",stdout);
+ if (show_progress) fputs("\nWriting the index...",stdout);
@.Writing the index...@>
- finish_line();
- if ((idx_file=fopen(idx_file_name,"wb"))==NULL)
- fatal("! Cannot open index file ",idx_file_name);
- at .Cannot open index file@>
if (change_exists) {
@<Tell about changed sections@>@; finish_line(); finish_line();
}
out_str("\\inx"); finish_line();
@.\\inx@>
+@#
+ if ((idx_file=fopen(idx_file_name,"wb"))==NULL)
+ fatal("! Cannot open index file ",idx_file_name);
+ at .Cannot open index file@>
active_file=idx_file; /* change active file to the index file */
@<Do the first pass of sorting@>@;
@<Sort and output the index@>@;
finish_line(); fclose(active_file); /* finished with |idx_file| */
+@#
active_file=tex_file; /* switch back to |tex_file| for a tic */
out_str("\\fin"); finish_line();
@.\\fin@>
+@#
if ((scn_file=fopen(scn_file_name,"wb"))==NULL)
fatal("! Cannot open section file ",scn_file_name);
@.Cannot open section file@>
@@ -4556,13 +4557,14 @@
active_file=scn_file; /* change active file to section listing file */
@<Output all the section names@>@;
finish_line(); fclose(active_file); /* finished with |scn_file| */
- active_file=tex_file;
+@#
+ active_file=tex_file; /* switch back to |tex_file| for the last time */
if (group_found) out_str("\\con");@+else out_str("\\end");
@.\\con@>
@.\\end@>
- finish_line();
- fclose(active_file);
}
+finish_line();
+fclose(active_file);
if (show_happiness) {
if (show_progress) new_line();
fputs("Done.",stdout);
More information about the tex-live-commits
mailing list.