Skip to content

Commit c4583f5

Browse files
committed
do not return comment tokens during readBalanced
1 parent 3875cd6 commit c4583f5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/LaTeXML/Core/Gullet.pm

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ sub showUnexpected {
186186
my ($self) = @_;
187187
my $message = "Input is empty";
188188
if (my $token = peekToken($self)) {
189-
my @pb = @{ $$self{pushback} }[1..-1];
189+
my @pb = @{ $$self{pushback} }[1 .. -1];
190190
$message = "Next token is " . Stringify($token)
191191
. " ( == " . Stringify($STATE->lookupMeaning($token)) . ")"
192-
. (@pb ? " more: " . ToString(TokensI(@pb)) : ''); }
192+
. (@pb ? " more: " . ToString(TokensI(@pb)) : ''); }
193193
return $message; }
194194

195195
sub show_pushback {
@@ -328,7 +328,7 @@ sub readToken {
328328
# This might be needed in more places?
329329
sub peekToken {
330330
my ($self) = @_;
331-
local $LaTeXML::ALIGN_STATE = 1000000; # Inhibit readToken from processing {}!!!
331+
local $LaTeXML::ALIGN_STATE = 1000000; # Inhibit readToken from processing {}!!!
332332
if (my $token = readToken($self)) {
333333
unshift(@{ $$self{pushback} }, $token);
334334
return $token; }
@@ -453,9 +453,6 @@ sub readBalanced {
453453
my ($token, $cc, $defn, $atoken, $atype, $ahidden);
454454
# Inlined readToken (we'll keep comments in the result)
455455
while (1) {
456-
if (@{ $$self{pending_comments} }) {
457-
push(@tokens, @{ $$self{pending_comments} });
458-
$$self{pending_comments} = []; }
459456
# Examine pushback first
460457
while (($token = shift(@{ $$self{pushback} })) && $CATCODE_HOLD[$cc = $$token[1]]) {
461458
if ($cc == CC_COMMENT) { push(@tokens, $token); }

0 commit comments

Comments
 (0)