From 096ba29e09882f67bdf2cb0b0dcb45121e23efa1 Mon Sep 17 00:00:00 2001 From: Andreas Scherer Date: Sun, 5 Jun 2022 11:14:20 +0000 Subject: [CWEB] Update borderline cases. Related to the 'bug, known' in CWEAVE section 200, there's a second known bug with the treatment of '@t TeX material @>' in a peculiar application scenario, i.e., when you try to place a function declaration (aka prototype) next to the function definition and separate them with a 'force' line break instead of the default 'big_force' (from production rule 76). For example, several codes of MMIX (mmixal.w, mmix-arith.w, mmix-config.w, mmix-io.w, mmix-mem.w, mmix-sim.w, mmmix.w) use the convention void flush_listing_line @,@,@[ARGS((char*))@];@+@t}\6{@> void flush_listing_line(s) char *s; { ... } Most likely because of the modified production rule 1, the '@t}\6{@>' ends up _after_ the '\1\1' introduced by 'dindent' around the function header and causes the function definition to be indented together with the list of arguments. To avoid this bug in this particular case, you should use '@t}\6\4\4{@>' instead. (Other non-conflicting cases of '@t}\6{@>' work as before.) Note that MMIX uses different conventions, too: mmotype.w does _not_ mingle with the line separation at all, leaving the CWEB default of 'big_force' intact. And mmix-pipe.w cleanly separates @ from @ (both internal and external). I have not found any other codes outside MMIX that are affected by this bug in CWEB 4. git-svn-id: svn://tug.org/texlive/trunk@63488 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/cwebdir/ChangeLog | 6 ++++++ Build/source/texk/web2c/cwebdir/cweave.w | 2 +- Build/source/texk/web2c/cwebdir/cwebman-w2c.ch | 8 ++++++++ Build/source/texk/web2c/cwebdir/cwebman.tex | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index 1cf05d3e051..4587b65777d 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,9 @@ +2022-06-05 Andreas Scherer + + * cweave.w, + * cwebman-w2c.ch, + * cwebman.tex: Update borderline cases. + 2022-06-04 Andreas Scherer * cwebman.tex: Update codes in Appendices. diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index b57611851aa..fbc7881a13b 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -3602,7 +3602,7 @@ section, it will be made into a scrap when |finish_C| is called. There's a known bug here, in cases where an adjacent scrap is |prelangle| or |prerangle|. Then the \TEX/ string can disappear when the \.{\\langle} or \.{\\rangle} becomes \.{<} or \.{>}. -For example, if the user writes \.{\v x<@@ty@@>\v}, the \TEX/ string +For example, if the user writes \.{\v x<@@ty@@><42\v}, the \TEX/ string \.{\\hbox\{y\}} eventually becomes part of an |insert| scrap, which is combined with a |prelangle| scrap and eventually lost. The best way to work around this bug is probably to enclose the \.{@@t...@@>} in \.{@@[...@@]} so that diff --git a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch index 309add06700..7d16bed97ea 100644 --- a/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch +++ b/Build/source/texk/web2c/cwebdir/cwebman-w2c.ch @@ -209,6 +209,14 @@ Sometimes things don't work as smoothly, and you get a bunch of \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi @z +@x +the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'. +@y +the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'.% +\cwebfootnote{This extended version of \.{CWEB} acknowledges the \.{-o} option +to suppress the extra space globally.} +@z + @x \section Hypertext and hyperdocumentation. @y diff --git a/Build/source/texk/web2c/cwebdir/cwebman.tex b/Build/source/texk/web2c/cwebdir/cwebman.tex index aa006afee51..388c3be2261 100644 --- a/Build/source/texk/web2c/cwebdir/cwebman.tex +++ b/Build/source/texk/web2c/cwebdir/cwebman.tex @@ -1133,7 +1133,7 @@ are just \\{exp}s. Thus it would tell \TEX/ to format `\X2:Argument declarations\X' on the same line as `$\\{main}(\\{argc},\39\\{argv}{}$)'. In this case you should help \.{CWEAVE} by putting `\.{@/}' after -`\.{main(argc,argv)}'. +`\.{main(argc,argv)}' (plus `\.{@t\\qquad@>}' for consistent indentation). \.{CWEAVE} automatically inserts a bit of extra space between declarations and the first apparent statement of a block. One way to defeat this -- cgit v1.2.3