texlive[63419] Build/source/texk/web2c/cwebdir: [CWEB] Improce

commits+ascherer at tug.org commits+ascherer at tug.org
Sat May 28 12:31:03 CEST 2022


Revision: 63419
          http://tug.org/svn/texlive?view=revision&revision=63419
Author:   ascherer
Date:     2022-05-28 12:31:03 +0200 (Sat, 28 May 2022)
Log Message:
-----------
[CWEB] Improce productions 33, 118, and 153.

Rule 33: Comma-separated lists of variables like 'int x,y,z;' had a
full blank space (see, e.g., the SGB book), in stark contrast to the
resuts of rules 4 and 14.

Rule 118: Multiple type definitions were separated by _two_ spaces,
because the type after the comma brings its own space from rule 117.
This might look better with 'app(opt); app('9');' after the comma.

Rule 153: Long lines with multiple typename declarations now have the
chance to be broken after the comma.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    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
    trunk/Build/source/texk/web2c/cwebdir/prod-cweave.w
    trunk/Build/source/texk/web2c/cwebdir/prod-twill.w
    trunk/Build/source/texk/web2c/cwebdir/prod.w

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2022-05-28 10:31:03 UTC (rev 63419)
@@ -1,3 +1,12 @@
+2022-05-28  Andreas Scherer  <https://ascherer.github.io>
+
+	* ctwill-w2c.ch,
+	* cweav-w2c.ch,
+	* cweave.w,
+	* prod-cweave.w,
+	* prod-twill.w,
+	* prod.w: Improve productions 33, 118, and 153.
+
 2022-05-27  Andreas Scherer  <https://ascherer.github.io>
 
 	* ctwill-mini.ch,

Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch	2022-05-28 10:31:03 UTC (rev 63419)
@@ -697,7 +697,7 @@
 @x
 @ @<Cases for |decl_head|@>=
 if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
+  big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
 }
 else if (cat1==ubinop) {
   big_app1_insert(pp,'{'); big_app('}'); reduce(pp,2,decl_head,-1,34);
@@ -716,7 +716,7 @@
 @y
 @ @<Cases for |decl_head|@>=
 if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
+  big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
 }
 else if (cat1==ubinop) {
   big_app1_insert(pp,'{'); big_app('}');
@@ -838,9 +838,7 @@
   make_underlined(pp+1); make_reserved(pp+1);
   big_app1_insert(pp,' '); reduce(pp,2,typedef_like,0,117);
 }
-else if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,typedef_like,0,118);
-}
+else if (cat1==comma) squash(pp,2,typedef_like,0,118);
 else if (cat1==semi) squash(pp,2,decl,-1,119);
 else if (cat1==ubinop && (cat2==ubinop || cat2==cast)) {
   big_app('{'); big_app1_insert(pp+1,'}'); reduce(pp+1,2,cat2,0,120);

Modified: trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/cweav-w2c.ch	2022-05-28 10:31:03 UTC (rev 63419)
@@ -323,7 +323,7 @@
 @x
 @ @<Cases for |decl_head|@>=
 if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
+  big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
 }
 else if (cat1==ubinop) {
   big_app1_insert(pp,'{'); big_app('}'); reduce(pp,2,decl_head,-1,34);
@@ -342,7 +342,7 @@
 @y
 @ @<Cases for |decl_head|@>=
 if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
+  big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
 }
 else if (cat1==ubinop) {
   big_app1_insert(pp,'{'); big_app('}');

Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w	2022-05-28 10:31:03 UTC (rev 63419)
@@ -2748,7 +2748,7 @@
 
 @ @<Cases for |decl_head|@>=
 if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,decl_head,-1,33);
+  big_app2(pp); app(opt); app('9'); reduce(pp,2,decl_head,-1,33);
 }
 else if (cat1==ubinop) {
   big_app1_insert(pp,'{'); big_app('}'); reduce(pp,2,decl_head,-1,34);
@@ -3011,7 +3011,9 @@
   && (cat3==comma || cat3==prerangle)) {
     make_underlined(pp+2); if (reserve_typenames) make_reserved(pp+2);
     big_app2(pp); big_app(' '); big_app2(pp+2);
-    if (cat3==comma) reduce(pp,4,langle,0,153);
+    if (cat3==comma) {
+      app(opt); app('9'); reduce(pp,4,langle,0,153);
+    }
     else reduce(pp,4,cast,-1,154);
   }
 
@@ -3098,9 +3100,7 @@
   make_underlined(pp+1); make_reserved(pp+1);
   big_app1_insert(pp,' '); reduce(pp,2,typedef_like,0,117);
 }
-else if (cat1==comma) {
-  big_app2(pp); big_app(' '); reduce(pp,2,typedef_like,0,118);
-}
+else if (cat1==comma) squash(pp,2,typedef_like,0,118);
 else if (cat1==semi) squash(pp,2,decl,-1,119);
 else if (cat1==ubinop && (cat2==ubinop || cat2==cast)) {
   big_app('{'); big_app1_insert(pp+1,'}'); reduce(pp+1,2,cat2,0,120);

Modified: trunk/Build/source/texk/web2c/cwebdir/prod-cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/prod-cweave.w	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/prod-cweave.w	2022-05-28 10:31:03 UTC (rev 63419)
@@ -109,7 +109,7 @@
 \+& |colcol| \alt|exp| |int_like| & \alt|exp| |int_like| \hfill
      |qualifier| $C$\alt$E$ $I$ & \&C\DC$x$\cr
 \+& |colcol| |colcol| & |colcol| & \&C\DC\&B\DC\cr
-\+& |decl_head| |comma| & |decl_head| \hfill $DC\.\ $ & \&{int} $x,{}$ \cr
+\+& |decl_head| |comma| & |decl_head| \hfill $DC$\,|opt|9 & \&{int} $x,{}$ \cr
 \+& |decl_head| |ubinop| & |decl_head| \hfill $D\.\{U\.\}$ & |int *|\cr
 \+\dagit& |decl_head| |exp| & |decl_head| \hfill $DE^*$ & \&{int} $x$ \cr
 \+& |decl_head| \alt|binop| |colon| |exp| \altt|comma| |semi| |rpar| &
@@ -262,9 +262,9 @@
     \&{typedef} \&{char}\cr
 \+\dagit& |typedef_like| |exp| & |typedef_like| \hfill $T\.\ E^{**}$ &
     \&{typedef} \&I \.{@@[@@]} (|*|\&P)\cr
-\+& |typedef_like| |comma| & |typedef_like| \hfill $TC\.\ $ &
+\+& |typedef_like| |comma| & |typedef_like| \hfill $TC$ &
     \&{typedef} \&{int} \&x,\cr
-\+& |typedef_like| |semi| & |decl| & \&{typedef} \&{int} $\&x,\&y$;\cr
+\+& |typedef_like| |semi| & |decl| & \&{typedef} \&{int} $\&x,{}$ $\&y$;\cr
 \+& |typedef_like| |ubinop| \alt |cast| |ubinop| &
     |typedef_like| \alt |cast| |ubinop| \hfill
     \alt $C=\.\{U\.\}C$ $U_2=\.\{U_1\.\}U_2$ \unskip &
@@ -313,7 +313,7 @@
 \+& |exp| |colcol| |int_like| & |int_like| & $\\{std}\DC\&{atomic}$ \cr
 \advance\midcol-30pt
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |comma| &
-  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$
+  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$\,\\{opt}9
    & $\langle$\&{typename} $t,$\cr
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |prerangle| &
   |cast| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $P$

Modified: trunk/Build/source/texk/web2c/cwebdir/prod-twill.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/prod-twill.w	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/prod-twill.w	2022-05-28 10:31:03 UTC (rev 63419)
@@ -109,7 +109,7 @@
 \+& |colcol| \alt|exp| |int_like| & \alt|exp| |int_like| \hfill
      |qualifier| $C$\alt$E$ $I$ & \&C\DC$x$\cr
 \+& |colcol| |colcol| & |colcol| & \&C\DC\&B\DC\cr
-\+& |decl_head| |comma| & |decl_head| \hfill $DC\.\ $ & \&{int} $x,{}$ \cr
+\+& |decl_head| |comma| & |decl_head| \hfill $DC$\,|opt|9 & \&{int} $x,{}$ \cr
 \+& |decl_head| |ubinop| & |decl_head| \hfill $D\.\{U\.\}$ & |int *|\cr
 \+\dagit& |decl_head| |exp| & |decl_head| \hfill $DE^*$ & \&{int} $x$ \cr
 \+& |decl_head| \alt|binop| |colon| |exp| \altt|comma| |semi| |rpar| &
@@ -308,7 +308,7 @@
 \+& |exp| |colcol| |int_like| & |int_like| & $\\{std}\DC\&{atomic}$ \cr
 \advance\midcol-30pt
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |comma| &
-  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$
+  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$\,\\{opt}9
    & $\langle$\&{typename} $t,$\cr
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |prerangle| &
   |cast| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $P$

Modified: trunk/Build/source/texk/web2c/cwebdir/prod.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/prod.w	2022-05-27 23:56:10 UTC (rev 63418)
+++ trunk/Build/source/texk/web2c/cwebdir/prod.w	2022-05-28 10:31:03 UTC (rev 63419)
@@ -109,7 +109,7 @@
 \+& |colcol| \alt|exp| |int_like| & \alt|exp| |int_like| \hfill
      |qualifier| $C$\alt$E$ $I$ & \&C\DC$x$\cr
 \+& |colcol| |colcol| & |colcol| & \&C\DC\&B\DC\cr
-\+& |decl_head| |comma| & |decl_head| \hfill $DC\.\ $ & \&{int} $x,{}$ \cr
+\+& |decl_head| |comma| & |decl_head| \hfill $DC$\,|opt|9 & \&{int} $x,{}$ \cr
 \+& |decl_head| |ubinop| & |decl_head| \hfill $D\.\{U\.\}$ & |int *|\cr
 \+\dagit& |decl_head| |exp| & |decl_head| \hfill $DE^*$ & \&{int} $x$ \cr
 \+& |decl_head| \alt|binop| |colon| |exp| \altt|comma| |semi| |rpar| &
@@ -262,9 +262,9 @@
     \&{typedef} \&{char}\cr
 \+\dagit& |typedef_like| |exp| & |typedef_like| \hfill $T\.\ E^{**}$ &
     \&{typedef} \&I \.{@@[@@]} (|*|\&P)\cr
-\+& |typedef_like| |comma| & |typedef_like| \hfill $TC\.\ $ &
+\+& |typedef_like| |comma| & |typedef_like| \hfill $TC$ &
     \&{typedef} \&{int} \&x,\cr
-\+& |typedef_like| |semi| & |decl| & \&{typedef} \&{int} $\&x,\&y$;\cr
+\+& |typedef_like| |semi| & |decl| & \&{typedef} \&{int} $\&x,{}$ $\&y$;\cr
 \+& |typedef_like| |ubinop| \alt |cast| |ubinop| &
     |typedef_like| \alt |cast| |ubinop| \hfill
     \alt $C=\.\{U\.\}C$ $U_2=\.\{U_1\.\}U_2$ \unskip &
@@ -313,7 +313,7 @@
 \+& |exp| |colcol| |int_like| & |int_like| & $\\{std}\DC\&{atomic}$ \cr
 \advance\midcol-30pt
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |comma| &
-  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$
+  |langle| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $C$\,\\{opt}9
    & $\langle$\&{typename} $t,$\cr
 \+\dagit& |langle| |struct_like| \alt |exp| |int_like| |prerangle| &
   |cast| \hfill $LS$\.\ \alt $E^{**}$ $I^{**}$ \unskip $P$



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