From 4a37668c3f5eeaf3e41404606db647f8b8429748 Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Sat, 28 May 2022 10:31:03 +0000 Subject: [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. git-svn-id: svn://tug.org/texlive/trunk@63419 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/cwebdir/ChangeLog | 9 +++++++++ Build/source/texk/web2c/cwebdir/ctwill-w2c.ch | 8 +++----- Build/source/texk/web2c/cwebdir/cweav-w2c.ch | 4 ++-- Build/source/texk/web2c/cwebdir/cweave.w | 10 +++++----- Build/source/texk/web2c/cwebdir/prod-cweave.w | 8 ++++---- Build/source/texk/web2c/cwebdir/prod-twill.w | 4 ++-- Build/source/texk/web2c/cwebdir/prod.w | 8 ++++---- 7 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index 51cdee25953..ee2d2fdd486 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,12 @@ +2022-05-28 Andreas Scherer + + * 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 * ctwill-mini.ch, diff --git a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch index 22dc440be80..a4a8dc2b3b7 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-w2c.ch @@ -697,7 +697,7 @@ if(cat1==lbrace || cat1==int_like || cat1==decl) { @x @ @= 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 @@ else if (cat1==semi) squash(pp,2,decl,-1,39); @y @ @= 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 @@ else if (cat1==exp && cat2!=lpar && cat2!=lbrack && cat2!=exp && cat2!=cast) { 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); diff --git a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch index fecc9e6d203..5e8cf7d1faf 100644 --- a/Build/source/texk/web2c/cwebdir/cweav-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/cweav-w2c.ch @@ -323,7 +323,7 @@ if(cat1==lbrace || cat1==int_like || cat1==decl) { @x @ @= 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 @@ else if (cat1==semi) squash(pp,2,decl,-1,39); @y @ @= 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('}'); diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index 24926f61310..738f075e9f4 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -2748,7 +2748,7 @@ else if (cat1==colcol) squash(pp,2,colcol,-1,32); @ @= 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 @@ else if ((cat1==struct_like) @| && (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 @@ else if (cat1==exp && cat2!=lpar && cat2!=lbrack && cat2!=exp && cat2!=cast) { 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); diff --git a/Build/source/texk/web2c/cwebdir/prod-cweave.w b/Build/source/texk/web2c/cwebdir/prod-cweave.w index 8576f7dc15a..606fb7cef20 100644 --- a/Build/source/texk/web2c/cwebdir/prod-cweave.w +++ b/Build/source/texk/web2c/cwebdir/prod-cweave.w @@ -109,7 +109,7 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \&{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 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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$ diff --git a/Build/source/texk/web2c/cwebdir/prod-twill.w b/Build/source/texk/web2c/cwebdir/prod-twill.w index 57acb995143..faf1c34a741 100644 --- a/Build/source/texk/web2c/cwebdir/prod-twill.w +++ b/Build/source/texk/web2c/cwebdir/prod-twill.w @@ -109,7 +109,7 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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$ diff --git a/Build/source/texk/web2c/cwebdir/prod.w b/Build/source/texk/web2c/cwebdir/prod.w index 203a77e49d2..3cc95c42566 100644 --- a/Build/source/texk/web2c/cwebdir/prod.w +++ b/Build/source/texk/web2c/cwebdir/prod.w @@ -109,7 +109,7 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \&{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 @@ We use \\{in}, \\{out}, \\{back}, \\{bsp}, and \\{din} as shorthands for \+& |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$ -- cgit v1.2.3