texlive[60909] Build/source/texk/web2c/cwebdir: [CWEB] Restore '\T'

commits+ascherer at tug.org commits+ascherer at tug.org
Sun Oct 31 20:11:48 CET 2021


Revision: 60909
          http://tug.org/svn/texlive?view=revision&revision=60909
Author:   ascherer
Date:     2021-10-31 20:11:48 +0100 (Sun, 31 Oct 2021)
Log Message:
-----------
[CWEB] Restore '\T' macro backward compatibility.

CWEB 4.3 introduced a major change in the '\T' macro to allow C++ 'hex
exponent' notation (e.g., 0x1FFFFp10). This made CWEAVE/CTWILL mutually
incompatible with non-matching versions of their set of macros and v.v.

This change tries to reestablish the standard behavior at least for
numeric constants.  Of course, 'old' CWEAVE/CTWILL won't deliver on 'hex
exponents' in the CWEB input, but those should be rare anyway.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebdir/ChangeLog
    trunk/Build/source/texk/web2c/cwebdir/ctproofmac.tex
    trunk/Build/source/texk/web2c/cwebdir/cttwinxmac.tex
    trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
    trunk/Build/source/texk/web2c/cwebdir/ctwimac.tex
    trunk/Build/source/texk/web2c/cwebdir/cweave.w
    trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex
    trunk/Build/source/texk/web2c/cwebdir/cwebman.tex
    trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex

Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1,3 +1,14 @@
+2021-10-31  Andreas Scherer  <https://ascherer.github.io>
+
+	* ctproofmac.tex,
+	* cttwinxmac.tex,
+	* ctwill-mini.ch,
+	* ctwimac.tex,
+	* cweave.w,
+	* cwebmac.tex,
+	* cwebman.tex,
+	* texinputs/pdfctwimac.tex: Restore '\T' macro backward compatibility.
+
 2021-10-24  Andreas Scherer  <https://ascherer.github.io>
 
 	* texinputs/pdfwebtocfront.tex: Restore 'classic' PDF layout.

Modified: trunk/Build/source/texk/web2c/cwebdir/ctproofmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctproofmac.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/ctproofmac.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1,8 +1,8 @@
 % standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.4 --- July 2021
+% Version 4.5 --- October 2021
 % Modified for proofs in CTWILL
 \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB4.4+PROOFS}
+\xdef\fmtversion{\fmtversion+CWEB4.5+PROOFS}
 
 \let\:=\. % preserve a way to get the dot accent
  % (all other accents will still work as usual)
@@ -17,6 +17,7 @@
 \def\TEX/{\TeX}
 \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}}
 \def\Cee{\CEE/} % for backward compatibility
+\def\Cpp{\CPLUSPLUS/} % for backward compatibility
 \def\9#1{}
 \font\eightrm=cmr8
 \let\sc=\eightrm % small caps (NOT a caps-and-small-caps font)
@@ -161,10 +162,10 @@
 % \S is section sign
 \def\T#1{\leavevmode % octal, hex or decimal constant
   \hbox{$\def\?{\kern.2em}%$%
-    \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant
+    \let\ \, % C++ digit separator becomes a little white space
+    \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
     \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
-    \def\%{\cdot 2^{\aftergroup}}% power of two (via dirty trick)
-    \let\~=\oct \let\^=\hex \let\\=\bin{#1}$}}%$%
+    \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
 \def\U{\note{This code is used in section}} % xref for use of a section
 \def\Us{\note{This code is used in sections}} % xref for uses of a section
 \let\V=\lor % logical or
@@ -178,15 +179,13 @@
 
 %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
 %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
-\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
-\def\Od#1/{{\it#1}} % octal digit
-\def\Hd#1/{{\tt#1}} % hexadecimal digit
-\def\Bd#1/{{\tt#1}} % binary digit
+\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3
 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
         \hbox{\strut\kern2pt\.{#1}\kern2pt}}
       \hrule}\vrule\kern2pt}} % verbatim string
+\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
 
 \def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
 \newif\ifon \newif\iftitle \newif\ifpagesaved

Modified: trunk/Build/source/texk/web2c/cwebdir/cttwinxmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cttwinxmac.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/cttwinxmac.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -8,6 +8,8 @@
 \def\UNIX/{{\mc U\kern-.05emNIX\spacefactor1000}}
 \def\TEX/{\TeX}
 \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}}
+\def\Cee{\CEE/} % for backward compatibility
+\def\Cpp{\CPLUSPLUS/} % for backward compatibility
 \def\9#1{}
 
 \newdimen\em \em=10pt % this "em" will not change with font size
@@ -119,8 +121,6 @@
 \def\eightbig#1{{\hbox{$\textfont0=\ninerm\textfont2=\ninesy
   \left#1\vbox to6.5pt{}\right.\nulldelimiterspace=0pt$}}}
 
-\def\Cee{{\mc C\spacefactor1000}}
-\def\UNIX{{\mc UNIX\spacefactor1000}}
 \font\titlefont=cmr7 scaled\magstep4 % title on the contents page
 \font\ttitlefont=cmtt10 scaled\magstep2 % typewriter type in title
 
@@ -194,7 +194,7 @@
   \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
   \noindent\strut{\bf\modno.\quad}}
 \let\startsection=\stsec
-\def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format'
+\def\defin#1{\global\advance\ind by 2 \1\&{#1 }} % begin `define' or `format'
 \def\A{\note{See also section}} % xref for doubly defined section name
 \def\As{\note{See also sections}} % xref for multiply defined section name
 \def\B{\iftenpoint\ninepoint\fi
@@ -205,7 +205,7 @@
   \exhyphenpenalty 10000
   \global\ind=2 \1\ \unskip}
 \def\C#1{\5\5\quad$/\ast\,$#1$\,\ast/$}
-\def\D{\defin{\#define}} % macro definition
+\def\D{\defin{{\rm\#}define}} % macro definition
 \let\E=\equiv % equivalence sign
 \def\ET{ and~} % conjunction between two section numbers
 \def\ETs{, and~} % conjunction between the last two of several section numbers
@@ -222,16 +222,16 @@
 \let\R=\lnot % logical not
 % \S is section sign
 \def\T#1{\leavevmode % octal, hex or decimal constant
-  \hbox{${\def\?{\kern.2em}%
-    \def\${\ell}% long constant
+  \hbox{${\def\?{\kern.2em}%$%
+    \let\ \, % C++ digit separator becomes a little white space
+    \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
     \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
-    \def\%{\cdot 2^{\aftergroup}}% power of two (via dirty trick)
-    \let\~=\oct \let\^=\hex #1}$}}
+    \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
 \def\U{\note{This code is used in section}} % xref for use of a section
 \def\Us{\note{This code is used in sections}} % xref for uses of a section
 \let\V=\lor % logical or
 \let\W=\land % logical and
-\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi % section name
+\def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name
   \XX$\langle\,${#2\sevenrm\kern.5em#1}$\,\rangle$\XX}
 \def\Y{\par\yskip}
 \let\Z=\let % now you can \send the control sequence \Z
@@ -239,11 +239,13 @@
 
 %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
 %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style
+\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style
 \def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3
 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
         \hbox{\strut\kern2pt\.{#1}\kern2pt}}
       \hrule}\vrule\kern2pt}} % verbatim string
+\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
 
 \def\normaloutput#1{\shipout\vbox{
       \vbox to 3pc{\ifodd\pageno\rightheadline\else\leftheadline\fi\vfill}

Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-mini.ch	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1484,9 +1484,23 @@
   case ':': app(':');@+app_scrap(colon,no_math);@+break;@/
 @z
 
+Section 216.
+
+ at x
+@<Append a string or...@>={@+ int count=-1; /* characters remaining before string break */
+ at y
+@<Append a string or...@>={int count=-1; /* characters remaining before string break */
+ at z
+
 Section 221.
 
 @x
+@ The |outer_parse| routine is to |C_parse| as |outer_xref|
+ at y
+ at r @ The |outer_parse| routine is to |C_parse| as |outer_xref|
+ at z
+
+ at x
 @d make_pb flags['e']
 @y
 @d make_pb flags['e']
@@ -1494,14 +1508,6 @@
 @$make_pb {CTWILL}221 =\\{flags}[\.{'e'}]@>
 @z
 
-Section 222.
-
- at x
-@ @c
- at y
- at r @ @c
- at z
-
 Section 225.
 
 @x
@@ -1542,6 +1548,12 @@
 Section 234--235.
 
 @x
+@ Here is \.{CWEAVE}'s major output handler.
+ at y
+ at r @ Here is \.{CWEAVE}'s major output handler.
+ at z
+
+ at x
     reswitch: switch(a) {
       case end_translation: return;
       case identifier: case res_word: @<Output an identifier@>@; break;
@@ -1783,7 +1795,7 @@
 @x
 @ A left-to-right radix sorting method is used, since this makes it easy to
 @y
-@ A left-to-right radix sorting method is used, since this makes it easy to
+ at r @ A left-to-right radix sorting method is used, since this makes it easy to
 @-c@>
 @z
 
@@ -1790,12 +1802,6 @@
 Section 271.
 
 @x
-@ During the sorting phase we shall use the |cat| and |trans| arrays from
- at y
- at r @ During the sorting phase we shall use the |cat| and |trans| arrays from
- at z
-
- at x
 @<Rest of |trans_plus| union@>=
 @y
 @<Rest of |trans_plus| union@>=
@@ -1832,7 +1838,7 @@
 @x
 @ Procedure |unbucket| goes through the buckets and adds nonempty lists
 @y
- at r @ Procedure |unbucket| goes through the buckets and adds nonempty lists
+@ Procedure |unbucket| goes through the buckets and adds nonempty lists
 @-unbucket@>
 @$unbucket {CTWILL}276 \&{static} \&{void} (\,)@>
 @z

Modified: trunk/Build/source/texk/web2c/cwebdir/ctwimac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwimac.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwimac.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1,9 +1,9 @@
 % standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.4 --- July 2021
+% Version 4.5 --- October 2021
 % modified for pages produced by CTWILL
 % further modified for page size of the MMIXware book
 \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CTWILL4.4+LNCS}
+\xdef\fmtversion{\fmtversion+CTWILL4.5+LNCS}
 
 \let\:=\. % preserve a way to get the dot accent
  % (all other accents will still work as usual)
@@ -29,6 +29,7 @@
 \def\TEX/{\TeX}
 \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}}
 \def\Cee{\CEE/} % for backward compatibility
+\def\Cpp{\CPLUSPLUS/} % for backward compatibility
 \def\9#1{}
 \font\eightrm=cmr8
 \font\sixrm=cmr6
@@ -278,10 +279,10 @@
 % \S is section sign
 \def\T#1{\leavevmode % octal, hex or decimal constant
   \hbox{$\def\?{\kern.2em}%$%
-    \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant
+    \let\ \, % C++ digit separator becomes a little white space
+    \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
     \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
-    \def\%{\cdot 2^{\aftergroup}}% power of two (via dirty trick)
-    \let\~=\oct \let\^=\hex \let\\=\bin{#1}$}}%$%
+    \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
 \def\U{\note{This code is used in section}} % xref for use of a section
 \def\Us{\note{This code is used in sections}} % xref for uses of a section
 \let\V=\lor % logical or
@@ -295,15 +296,13 @@
 
 %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
 %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
-\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
-\def\Od#1/{{\it#1}} % octal digit
-\def\Hd#1/{{\tt#1}} % hexadecimal digit
-\def\Bd#1/{{\tt#1}} % binary digit
+\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3
 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
         \hbox{\strut\kern2pt\.{#1}\kern2pt}}
       \hrule}\vrule\kern2pt}} % verbatim string
+\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
 
 % now here's the mini-index formatting control
 \newcount\nrefs % total number of references in partial page

Modified: trunk/Build/source/texk/web2c/cwebdir/cweave.w
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cweave.w	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/cweave.w	2021-10-31 19:11:48 UTC (rev 60909)
@@ -831,7 +831,8 @@
 
 @d gather_digits_while(t) while ((t) || *loc=='\'')
   if (*loc=='\'') { /* \CPLUSPLUS/-style digit separator */
-    *id_loc++=' '; loc++; /* insert a little bit of space */
+    *id_loc++=' ';@+ loc++; /* insert a little white space */
+ at .\\\ @>
   }@+else *id_loc++=*loc++
 
 @<Get a constant@>= {
@@ -865,18 +866,18 @@
 @ @<Get a hex...@>={
   *id_loc++='^'; loc++;
   gather_digits_while(xisxdigit(*loc) || *loc=='.');
-  *id_loc++='/'; goto get_exponent;
+  goto get_exponent;
 }
 
 @ @<Get a bin...@>={
   *id_loc++='\\'; loc++;
   gather_digits_while(*loc=='0' || *loc=='1');
-  *id_loc++='/'; goto digit_suffix;
+  goto digit_suffix;
 }
 
 @ @<Get an oct...@>={
   *id_loc++='~'; gather_digits_while(xisdigit(*loc));
-  *id_loc++='/'; goto digit_suffix;
+  goto digit_suffix;
 }
 
 @ \CEE/ strings and character constants, delimited by double and single
@@ -1950,13 +1951,13 @@
 \.{@@=}string\.{@@>}&|exp|: \.{\\vb\{}string with special characters
   quoted\.\}&maybe\cr
 \.{@@'7'}&|exp|: \.{\\.\{@@'7'\}}&maybe\cr
-\.{077} or \.{\\77}&|exp|: \.{\\T\{\\\~77/\}}&maybe\cr
-\.{0x7f}&|exp|: \.{\\T\{\\\^7f/\}}&maybe\cr
-\.{0b10111}&|exp|: \.{\\T\{\\\\10111/\}}&maybe\cr
+\.{077} or \.{\\77}&|exp|: \.{\\T\{\\\~77\}}&maybe\cr
+\.{0x7f}&|exp|: \.{\\T\{\\\^7f\}}&maybe\cr
+\.{0b10111}&|exp|: \.{\\T\{\\\\10111\}}&maybe\cr
 \.{77}&|exp|: \.{\\T\{77\}}&maybe\cr
 \.{77L}&|exp|: \.{\\T\{77\\\$L\}}&maybe\cr
 \.{0.1E5}&|exp|: \.{\\T\{0.1\\\_5\}}&maybe\cr
-\.{0x10p3}&|exp|: \.{\\T\{\\\^10/\\\%3\}}&maybe\cr
+\.{0x10p3}&|exp|: \.{\\T\{\\\^10\}\\p\{3\}}&maybe\cr
 \.{1'000'000}&|exp|: \.{\\T\{1\\\ 000\\\ 000\}}&maybe\cr
 \.+&|ubinop|: \.+&yes\cr
 \.-&|ubinop|: \.-&yes\cr
@@ -3548,12 +3549,11 @@
 @q(@>@.\\)@>
   }
   switch (*id_first) {
-    case ' ':case '\\':case '#':case '%':case '$':case '^':
-    case '{': case '}': case '~': case '&': case '_': app('\\'); break;
+    case ' ':case '\\':case '#':case '$':case '^':case '{':case '}':
+    case '~':case '&':case '_': app('\\'); break;
 @.\\\ @>
 @.\\\\@>
 @.\\\#@>
- at .\\\%@>
 @.\\\$@>
 @.\\\^@>
 @.\\\{@>@q}@>
@@ -3561,6 +3561,14 @@
 @.\\\~@>
 @.\\\&@>
 @.\\\_@>
+    case '%': if (next_control==constant) {
+        app_str("}\\p{"); /* special macro for `hex exponent' */
+        id_first++; /* skip |'%'| */
+      }
+      else app('\\');
+      break;
+ at .\\p@>
+ at .\\\%@>
     case '@@': if (*(id_first+1)=='@@') id_first++;
       else err_print("! Double @@ should be used in strings");
 @.Double @@ should be used...@>

Modified: trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/cwebmac.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1,8 +1,8 @@
 % standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.5 --- July 2021
+% Version 4.5 --- October 2021
 \ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
 \xdef\fmtversion{\fmtversion+CWEB4.5}
-\chardef\cwebversion=4 \chardef\cwebrevision=4
+\chardef\cwebversion=4 \chardef\cwebrevision=5
 \newif\ifpdf
 \ifx\pdf+\pdftrue\fi
 % Uncomment the following line if you want PDF goodies to be the default
@@ -234,11 +234,12 @@
   \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77}
   \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi  % 0.1E5->\T{0.1\_5}
   \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi  % 0x77 -> \T{\^77}
+  \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi  % 0b10111 -> \T{\\10111}
   \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi % \T{77\$L}
   \else\ifx\nxt\{\addF\lbchar       \else\ifx\nxt\}\addF\rbchar
   \else\ifx\nxt\ \addF\space        \else\ifx\nxt\#\addF{\string\#}%
   \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}%
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
 }
 \def\makeolproctokctlii{%
   \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}%
@@ -343,14 +344,12 @@
 \def\Qs{\note{This code is cited in sections}} % xref for mentions of a section
 \let\R=\lnot % logical not
 % \S is section sign
-\def\digitseparator{\,} % a bit of extra space
 \def\T#1{\leavevmode % octal, hex or decimal constant
   \hbox{$\def\?{\kern.2em}%
-    \let\ \digitseparator%
+    \let\ \, % C++ digit separator becomes a little white space
 %    \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67
     \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67
     \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
-    \def\%{\cdot 2^{\aftergroup}}% power of two (via dirty trick)
     \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}
 \def\U{\note{This code is used in section}} % xref for use of a section
 \def\Us{\note{This code is used in sections}} % xref for uses of a section
@@ -370,15 +369,13 @@
 
 %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
 %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
-\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
-\def\Od#1/{{\it#1}} % octal digit
-\def\Hd#1/{{\tt#1}} % hexadecimal digit
-\def\Bd#1/{{\tt#1}} % binary digit
+\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3
 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
         \hbox{\strut\kern2pt\.{#1}\kern2pt}}
       \hrule}\vrule\kern2pt}} % verbatim string
+\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
 
 \def\onmaybe{\let\ifon=\maybe} \let\maybe=\iftrue
 \newif\ifon \newif\iftitle \newif\ifpagesaved

Modified: trunk/Build/source/texk/web2c/cwebdir/cwebman.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/cwebman.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/cwebman.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -476,15 +476,15 @@
 or \.{0x}.  In \.{CWEB} it seems reasonable to let each convention hold
 in its respective realm; so in \CEE/ text you get $40_8$ by typing
 `\.{040}', which \.{CTANGLE} faithfully copies into the \CEE/ file (for
-the compiler's benefit) and which \.{CWEAVE} prints as $\T{\~40/}$.
+the compiler's benefit) and which \.{CWEAVE} prints as $\T{\~40}$.
 Similarly, \.{CWEAVE} prints the hexadecimal \CEE/ constant `\.{0x20}'
-as \T{\^20/}. The use of italic font for octal digits and typewriter font
+as \T{\^20}. The use of italic font for octal digits and typewriter font
 for hexadecimal digits makes the meaning of such constants clearer in
 a document. For consistency, then, you should type `\.{|040|}' or
 `\.{|0x20|}' in the \TEX/ part of the section.
 
 And if you type a binary constant like `\.{0b00101010}', \.{CWEAVE} prints
-it as $\T{\\00101010/}$. In all numeric literals you may add \.' separators
+it as $\T{\\00101010}$. In all numeric literals you may add \.' separators
 for improved readability.
 
 \section Control codes.
@@ -763,11 +763,11 @@
 them by standard ASCII alphanumeric characters or
 \.{\_}, in order to generate legal \CEE/ code.  It does this by means
 of a transliteration table, which by default associates the string
-\.{Xab} to the character with ASCII code \T{\^/}$ab$ (where $a$ and $b$ are
+\.{Xab} to the character with ASCII code \T{\^}$ab$ (where $a$ and $b$ are
 hexadecimal digits, and $a\ge8$).  By placing the
 construction \.{@l\ ab\ newstring} in limbo, you are telling
 \.{CTANGLE} to replace this character by \.{newstring} instead.
-For example, the ISO Latin-1 code for the letter `\"u' is \T{\^FC/}
+For example, the ISO Latin-1 code for the letter `\"u' is \T{\^FC}
 (or \.{'\char`\\374'}),
 and \.{CTANGLE} will normally change this code to the
 three-character sequence \.{XFC} if it

Modified: trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex	2021-10-31 15:49:25 UTC (rev 60908)
+++ trunk/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex	2021-10-31 19:11:48 UTC (rev 60909)
@@ -1,5 +1,5 @@
 % standard macros for CWEB listings (in addition to plain.tex)
-% Version 4.5 --- July 2021
+% Version 4.5 --- October 2021
 % modified for pages produced by CTWILL
 % further modified for page size of the MMIXware book
 % modified for PDF output with 'tex "\let\pdf+', 'pdftex', and 'xetex'
@@ -45,6 +45,7 @@
 \def\TEX/{\TeX}
 \def\CPLUSPLUS/{{\mc C\PP\spacefactor1000}}
 \def\Cee{\CEE/} % for backward compatibility
+\def\Cpp{\CPLUSPLUS/} % for backward compatibility
 \def\9#1{}
 \font\eightrm=cmr8
 \font\sixrm=cmr6
@@ -344,11 +345,12 @@
   \else\ifx\nxt\~\ifTnum\addF{0}\else\addF\tildechar\fi % 077->\T{\~77}
   \else\ifx\nxt\_\ifTnum\addF{E}\else\addF_\fi  % 0.1E5->\T{0.1\_5}
   \else\ifx\nxt\^\ifTnum\addF{0x}\else\addF^\fi  % 0x77 -> \T{\^77}
+  \else\ifx\nxt\\\\\ifTnum\addF{0b}\else\addF\\\fi  % 0b10111 -> \T{\\10111}
   \else\ifx\nxt\$\ifTnum\tokprocessedtrue\else\addF$\fi %$% \T{77\$L}
   \else\ifx\nxt\{\addF\lbchar       \else\ifx\nxt\}\addF\rbchar
   \else\ifx\nxt\ \addF\space        \else\ifx\nxt\#\addF{\string\#}%
   \else\ifx\nxt\PP\addF{++}\else\ifx\nxt\MM\addF{--}%
-  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
 }
 \def\makeolproctokctlii{%
   \ifx\nxt\MG\addF{->}\else\ifx\nxt\GG\addF{>>}%
@@ -468,10 +470,10 @@
 % \S is section sign
 \def\T#1{\leavevmode % octal, hex or decimal constant
   \hbox{$\def\?{\kern.2em}%$%
-    \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant
+    \let\ \, % C++ digit separator becomes a little white space
+    \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
     \def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
-    \def\%{\cdot 2^{\aftergroup}}% power of two (via dirty trick)
-    \let\~=\oct \let\^=\hex \let\\=\bin{#1}$}}%$%
+    \let\~=\oct \let\^=\hex \let\\=\bin {#1}$}}%$%
 \def\U{\note{This code is used in section}} % xref for use of a section
 \def\Us{\note{This code is used in sections}} % xref for uses of a section
 \let\V=\lor % logical or
@@ -486,15 +488,13 @@
 
 %\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
 %\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
-\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
-\def\Od#1/{{\it#1}} % octal digit
-\def\Hd#1/{{\tt#1}} % hexadecimal digit
-\def\Bd#1/{{\tt#1}} % binary digit
+\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}} % CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$\tt\aftergroup}} % new in CWEB 4.3
 \def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
         \hbox{\strut\kern2pt\.{#1}\kern2pt}}
       \hrule}\vrule\kern2pt}} % verbatim string
+\def\p#1{\cdot 2^{#1}} % power of two (hex exponent)
 
 % now here's the mini-index formatting control
 \newcount\nrefs % total number of references in partial page



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