Skip to content

Commit 285bb02

Browse files
authored
[minor] iflimit regression (#2771)
* only bookkeep if_count when we are keeping a limit * Revert "only bookkeep if_count when we are keeping a limit" This reverts commit 723ea9c. * Add if_count and absorb_count to deny list for value table in precompiled kernels.
1 parent 7119a53 commit 285bb02

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

lib/LaTeXML/Engine/TeX_Job.pool.ltxml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ sub today {
6363
# \maxdeadcycles pi is the maximum allowed value of \deadcycles before an error is generated.
6464

6565
DefPrimitiveI('\lx@end@document', undef, sub {
66-
my ($stomach) = @_;
67-
$stomach->leaveHorizontal;
68-
$stomach->getGullet->flush;
69-
return; });
66+
my ($stomach) = @_;
67+
$stomach->leaveHorizontal;
68+
$stomach->getGullet->flush;
69+
return; });
7070
Let('\end', '\lx@end@document');
7171

7272
DefRegister('\everyjob' => Tokens());
@@ -97,7 +97,9 @@ my %IGNORED_SYMBOLS = map { $_ => 1; }
9797
value:PARAMETER_TYPES
9898
value:TAG_PROPERTIES
9999
value:MATH_LIGATURES
100-
value:TEXT_LIGATURES),
100+
value:TEXT_LIGATURES
101+
value:if_count
102+
value:absorb_count),
101103
# \lnot, \to let to \neg, \rightarrow in pre 2017 TeXlive; gratuitously screws up tests
102104
qw(
103105
meaning:\lnot
@@ -141,9 +143,9 @@ sub DumpFile {
141143
else {
142144
Fatal('expected', $file, "Couldn't find definitions file $file"); }
143145
Debug("Extracting symbols " . join(',', map { $_ . '=' . scalar(keys %{ $$STATE{$_} }); } @tables));
144-
my $nsym = 0;
145-
my $nlets = 0;
146-
my %unchanged=();
146+
my $nsym = 0;
147+
my $nlets = 0;
148+
my %unchanged = ();
147149
my (@cmds_early, @cmds, @cmds_late);
148150
foreach my $table_name (sort @tables) {
149151
my $table = $$STATE{$table_name};
@@ -152,36 +154,37 @@ sub DumpFile {
152154
my $dump_key = $table_name . ':' . $key;
153155
my $dkey = LaTeXML::Core::Dumper::Dump($key, $dump_key);
154156
next if $IGNORED_SYMBOLS{$dump_key};
155-
my $value = $$table{$key}[0];
156-
my $dump = LaTeXML::Core::Dumper::Dump($value, $dump_key);
157+
my $value = $$table{$key}[0];
158+
my $dump = LaTeXML::Core::Dumper::Dump($value, $dump_key);
157159
my $let_cs;
158-
my $prev = $$snap{$table_name}{$key};
159-
my $pdump = LaTeXML::Core::Dumper::Dump($prev, $dump_key);
160-
if(($dump // $value // 'undef') ne ($pdump // $prev // 'undef')) {
160+
my $prev = $$snap{$table_name}{$key};
161+
my $pdump = LaTeXML::Core::Dumper::Dump($prev, $dump_key);
162+
163+
if (($dump // $value // 'undef') ne ($pdump // $prev // 'undef')) {
161164
$nsym++;
162165
## one of the simple value tables?
163166
if ($table_name ne 'meaning') {
164167
if (!(ref $value) || defined $dump) {
165-
push(@cmds, "$inst(" . $dkey . ',' . $dump . ")") } # Assign within table
168+
push(@cmds, "$inst(" . $dkey . ',' . $dump . ")") } # Assign within table
166169
else {
167170
Warn('unexpected', $table_name, undef,
168171
"Do not know how to dump $table_name for $key : " . Stringify($value)); } }
169172
# else processing the meaning table; some kind of definition
170173
elsif ((!defined $value) # Value Empty?
171-
|| (!$value->isaDefinition) # or menaing is non-definition; maybe a token
172-
|| (!($let_cs = $value->getCSName))) { # Or definition w/NO cs !?!? (can't happen?)
173-
push(@cmds, 'Im(' . $dkey . ',' . $dump . ')'); } # Assign meaning
174+
|| (!$value->isaDefinition) # or menaing is non-definition; maybe a token
175+
|| (!($let_cs = $value->getCSName))) { # Or definition w/NO cs !?!? (can't happen?)
176+
push(@cmds, 'Im(' . $dkey . ',' . $dump . ')'); } # Assign meaning
174177
## Else, some proper kind of definition.
175-
elsif ($key eq $let_cs) { # Normal definition
176-
if($dump){
177-
push(@cmds, 'I(' . $dump . ')'); } # the key (the cs!) is already embedded in the dump!!!
178+
elsif ($key eq $let_cs) { # Normal definition
179+
if ($dump) {
180+
push(@cmds, 'I(' . $dump . ')'); } # the key (the cs!) is already embedded in the dump!!!
178181
else {
179182
Warn('unexpected', $table_name, undef,
180183
"Do not know how to dump $table_name for $key : " . Stringify($value)); } }
181184
## \let symbols? Worry about WHICH value of original cs to use? before/after?????
182185
else {
183186
$nlets++;
184-
my $letkey = LaTeXML::Core::Dumper::Dump($let_cs, $dump_key);
187+
my $letkey = LaTeXML::Core::Dumper::Dump($let_cs, $dump_key);
185188
my $prev_let = $$snap{$table_name}{$let_cs};
186189
my $curr_let = $$table{$let_cs}[0];
187190
if ((defined $prev_let) && ($value eq $prev_let)) {
@@ -191,13 +194,13 @@ sub DumpFile {
191194
## \let to the current defn; do let assignment after load
192195
push(@cmds_late, 'Lt(' . $dkey . ',' . $letkey . ')'); }
193196
else {
194-
push(@cmds, 'Im(' . $dkey . ',' . $dump . ')'); } # Assign meaning
197+
push(@cmds, 'Im(' . $dkey . ',' . $dump . ')'); } # Assign meaning
195198
} }
196199
else {
197200
$unchanged{$dump_key}++; } } }
198201
#----------------------------------------------------------------------
199202
Debug("Found $nsym new symbols; $nlets were \\let");
200-
Debug("There were ".scalar(keys %unchanged)." unchanged symbols");
203+
Debug("There were " . scalar(keys %unchanged) . " unchanged symbols");
201204
#. join(',', sort keys %unchanged));
202205
Debug("Storing $name in $destination");
203206
my $OUT;
@@ -208,6 +211,7 @@ sub DumpFile {
208211
print $OUT "## Dump of $name\n";
209212
print $OUT "## Generated file, do not edit!\n";
210213
print $OUT $DUMP_HEADER;
214+
211215
foreach my $cmd (@cmds_early) {
212216
print $OUT $cmd . ";\n"; }
213217
foreach my $cmd (@cmds) {

0 commit comments

Comments
 (0)