texlive[73407] Build/source/texk/web2c/cwebdir: [CTWILL] Support
commits+ascherer at tug.org
commits+ascherer at tug.org
Sat Jan 11 11:32:07 CET 2025
Revision: 73407
https://tug.org/svn/texlive?view=revision&revision=73407
Author: ascherer
Date: 2025-01-11 11:32:07 +0100 (Sat, 11 Jan 2025)
Log Message:
-----------
[CTWILL] Support multiple definitions of the same identifier.
For example, the CTWILL-specific changefile 'mmix-pipe.tch' in the
'local' branch of the https://github.com/ascherer/mmix project defines
identifier 'l' both as 'tetra' and 'Extern specnode *', depending on the
usage. Section 67 of 'mmix-pipe.w' actually uses both definitions at the
same time, so we declare both with two variants of the '@$' control code
as 'local' after the '@%' conttrol code. See
<https://github.com/ascherer/mmix/blob/local/mmix-pipe.tch> for details.
By storing the index '$line's in an array instead of a scalar, we do not
exclude the second, third, ... definition of identifiers. (The sorting
can be 'off', however. See identifier 'p' in section 197.)
$ tie -c ctwill-mmix-pipe.ch mmix-pipe.{w,ch,tch}
$ ctwill -lpdf +P -x mmix-pipe.w ctwill-mmix-pipe.ch (once)
$ ctwill -lpdf +P -x mmix-pipe.w ctwill-mmix-pipe.ch (twice)
$ pdftex mmix-pipe.tex
$ ( ctwill-proofsort <mmix-pipe.tex ) 1<>mmix-pipe.tex
$ pdftex mmix-pipe.tex
The final result can be inspected here:
https://github.com/ascherer/mmix/releases/download/2023-11-25/ctwill-mmix-pipe+P.pdf
Modified Paths:
--------------
trunk/Build/source/texk/web2c/cwebdir/ChangeLog
trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort
Modified: trunk/Build/source/texk/web2c/cwebdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2025-01-11 01:57:27 UTC (rev 73406)
+++ trunk/Build/source/texk/web2c/cwebdir/ChangeLog 2025-01-11 10:32:07 UTC (rev 73407)
@@ -1,3 +1,7 @@
+2025-01-11 Andreas Scherer <https://ascherer.github.io>
+
+ * ctwill-proofsort: Support multiple definitions of identifiers.
+
2025-01-01 Andreas Scherer <https://ascherer.github.io>
* Makefile,
Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort 2025-01-11 01:57:27 UTC (rev 73406)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort 2025-01-11 10:32:07 UTC (rev 73407)
@@ -64,15 +64,18 @@
foreach my $key ($collator ?
$collator->sort(keys %mini_index) :
sort {"\L$a" cmp "\L$b"} keys %mini_index) {
- print $mini_index{$key};
+ print join "\n", @{ $mini_index{$key} };
}
$print_index = 0;
} elsif ($print_index) { # mini-index entry
- my (undef,$key) = split / /, $line; # 2nd column is the key
+ my (undef,$key,$type) = split / /, $line,3;
+ # 1st column is the section number (internal or external)
+ # 2nd column is the identifier
+ # the rest is the type of the identifier
$key =~ s/\\//g; # strip internal TeX escape(s)
$key =~ m/\w*\{(\w+)\}/; # extract plain key from control seq.
$key =~ m/\$(\w+)\$/ unless defined $1; # extract @f TeX key
- $mini_index{$1} = $line; # store index entry
+ push @{ $mini_index{$1} }, $line; # store index entry
next; # print later
}
More information about the tex-live-commits
mailing list.