diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2021-10-31 19:11:48 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2021-10-31 19:11:48 +0000 |
commit | 943863160772f86ad635c253e6f26cb2c15de76a (patch) | |
tree | 9a536b653d8c742ea96ebdd8bf7cb46e3f8d0338 /Build | |
parent | 6c15806f54458b18d679bf0e3e6e2b71b1d237da (diff) |
[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.
git-svn-id: svn://tug.org/texlive/trunk@60909 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 11 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctproofmac.tex | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cttwinxmac.tex | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-mini.ch | 38 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwimac.tex | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweave.w | 30 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cwebmac.tex | 21 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cwebman.tex | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex | 22 |
9 files changed, 109 insertions, 87 deletions
diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index a59bfab2b8f..078795706f1 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -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. diff --git a/Build/source/texk/web2c/cwebdir/ctproofmac.tex b/Build/source/texk/web2c/cwebdir/ctproofmac.tex index 39978fdc22c..c0b4fa65cf6 100644 --- a/Build/source/texk/web2c/cwebdir/ctproofmac.tex +++ b/Build/source/texk/web2c/cwebdir/ctproofmac.tex @@ -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 diff --git a/Build/source/texk/web2c/cwebdir/cttwinxmac.tex b/Build/source/texk/web2c/cwebdir/cttwinxmac.tex index 064d04412d6..30d44496f13 100644 --- a/Build/source/texk/web2c/cwebdir/cttwinxmac.tex +++ b/Build/source/texk/web2c/cwebdir/cttwinxmac.tex @@ -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} diff --git a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch index 68e53899e00..fd9f27d0bb0 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch @@ -1484,22 +1484,28 @@ Section 213--214. case ':': app(':');@+app_scrap(colon,no_math);@+break;@/ @z -Section 221. +Section 216. @x -@d make_pb flags['e'] +@<Append a string or...@>={@+ int count=-1; /* characters remaining before string break */ @y -@d make_pb flags['e'] -@-make_pb@> -@$make_pb {CTWILL}221 =\\{flags}[\.{'e'}]@> +@<Append a string or...@>={int count=-1; /* characters remaining before string break */ @z -Section 222. +Section 221. + +@x +@ The |outer_parse| routine is to |C_parse| as |outer_xref| +@y +@r @ The |outer_parse| routine is to |C_parse| as |outer_xref| +@z @x -@ @c +@d make_pb flags['e'] @y -@r @ @c +@d make_pb flags['e'] +@-make_pb@> +@$make_pb {CTWILL}221 =\\{flags}[\.{'e'}]@> @z Section 225. @@ -1542,6 +1548,12 @@ This subroutine will never be called when |stack_ptr==1|. Section 234--235. @x +@ Here is \.{CWEAVE}'s major output handler. +@y +@r @ Here is \.{CWEAVE}'s major output handler. +@z + +@x reswitch: switch(a) { case end_translation: return; case identifier: case res_word: @<Output an identifier@>@; break; @@ -1783,19 +1795,13 @@ Section 269. @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 +@r @ A left-to-right radix sorting method is used, since this makes it easy to @-c@> @z Section 271. @x -@ During the sorting phase we shall use the |cat| and |trans| arrays from -@y -@r @ During the sorting phase we shall use the |cat| and |trans| arrays from -@z - -@x @<Rest of |trans_plus| union@>= @y @<Rest of |trans_plus| union@>= @@ -1832,7 +1838,7 @@ Section 276. @x @ Procedure |unbucket| goes through the buckets and adds nonempty lists @y -@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 diff --git a/Build/source/texk/web2c/cwebdir/ctwimac.tex b/Build/source/texk/web2c/cwebdir/ctwimac.tex index b5a81e8364b..df249009256 100644 --- a/Build/source/texk/web2c/cwebdir/ctwimac.tex +++ b/Build/source/texk/web2c/cwebdir/ctwimac.tex @@ -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 diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index db5b4f250f5..bb0b58e29de 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -831,7 +831,8 @@ are pointers into the array |section_text|, not into |buffer|. @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 */ +@.\\\ @> }@+else *id_loc++=*loc++ @<Get a constant@>= { @@ -865,18 +866,18 @@ digit_suffix: @ @<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 @@ with discretionary breaks in between. \.{@@=}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 @@ while (id_first<id_loc) { @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; @.\\\ @> @.\\\\@> @.\\\#@> -@.\\\%@> @.\\\$@> @.\\\^@> @.\\\{@>@q}@> @@ -3561,6 +3561,14 @@ while (id_first<id_loc) { @.\\\~@> @.\\\&@> @.\\\_@> + case '%': if (next_control==constant) { + app_str("}\\p{"); /* special macro for `hex exponent' */ + id_first++; /* skip |'%'| */ + } + else app('\\'); + break; +@.\\p@> +@.\\\%@> case '@@': if (*(id_first+1)=='@@') id_first++; else err_print("! Double @@ should be used in strings"); @.Double @@ should be used...@> diff --git a/Build/source/texk/web2c/cwebdir/cwebmac.tex b/Build/source/texk/web2c/cwebdir/cwebmac.tex index 191f6c27a69..81a2bb1b6ff 100644 --- a/Build/source/texk/web2c/cwebdir/cwebmac.tex +++ b/Build/source/texk/web2c/cwebdir/cwebmac.tex @@ -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 diff --git a/Build/source/texk/web2c/cwebdir/cwebman.tex b/Build/source/texk/web2c/cwebdir/cwebman.tex index 449aad56e80..6b2098f933b 100644 --- a/Build/source/texk/web2c/cwebdir/cwebman.tex +++ b/Build/source/texk/web2c/cwebdir/cwebman.tex @@ -476,15 +476,15 @@ respectively, to it; in \CEE/ the constant should be preceded by \.0 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 @@ and so on. When such characters occur in identifiers, \.{CTANGLE} must replace 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 diff --git a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex index 4b7f38b5604..cb6804e8545 100644 --- a/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex +++ b/Build/source/texk/web2c/cwebdir/texinputs/pdfctwimac.tex @@ -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 |