Skip to content

Commit

Permalink
recognize \bgroup as an opener for readBalanced $require_open=true (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dginev authored Apr 2, 2024
1 parent 02b7fed commit a189c60
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/LaTeXML/Core/Gullet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ sub readBalanced {
# Does we need to expand to get the { ???
if ($require_open) {
my $token = ($expanded ? readXToken($self, 0) : readToken($self));
if ((!$token) || ($$token[1] != CC_BEGIN)) {
if ((!$token) || ($$token[1] != CC_BEGIN && !Equals($STATE->lookupMeaning($token), T_BEGIN))) {
Error('expected', '{', $self, "Expected opening '{'");
return TokensI(); } }
my @tokens = ();
Expand Down Expand Up @@ -1168,11 +1168,15 @@ Skip the next spaces from the input.
Skip the next token from the input if it is a space.
If C($expanded> is true, expands ( like C< <one optional space> > ).
=item C<< $tokens = $gullet->readBalanced; >>
=item C<< $tokens = $gullet->readBalanced($expanded, $macrodef, $require_open); >>
Read a sequence of tokens from the input until the balancing '}' (assuming the '{' has
already been read). Returns a L<LaTeXML::Core::Tokens>,
except in an array context, returns the collected tokens and the closing token.
Read a sequence of tokens from the input until the balancing '}'.
By default assumes the '{' has already been read.
It optionally (C<$expand>) expands while reading, but deferring \the and related.
The C<$macrodef> flag affects whether # parameters are "packed" for macro bodies.
If C<$require_open> is true, the opening C<T_BEGIN> has not yet been read, and is required.
Returns a L<LaTeXML::Core::Tokens>.
=item C<< $boole = $gullet->ifNext($token); >>
Expand Down

0 comments on commit a189c60

Please sign in to comment.