Skip to content

Commit

Permalink
Second attempt at 8f99cde
Browse files Browse the repository at this point in the history
If the first item is a braced group, more tokens are returned so a single \exp_not:N is not enough
  • Loading branch information
PhelypeOleinik committed Mar 18, 2022
1 parent 8f99cde commit b317f9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions base/ltcmd.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4119,10 +4119,7 @@
\exp_args:Ne \str_case_e:nnF
{
\exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 }
{
\token_if_macro:NT #1
{ \exp_not:N \exp_not:N \exp_not:e { \tl_head:N #1 } }
}
{ \exp_not:N \exp_not:n { \exp_not:e { \tl_head:N #1 } } }
}
{
{ \exp_not:N \@@_start:nNNnnn } {#2}
Expand Down
4 changes: 4 additions & 0 deletions base/testfiles/github-0795.lvt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
\input test2e
\START
\def\test{\typeout{test}\fi}
\def\testx{{\typeout{test x}\fi}}
\AddToHook{cmd/test/after}{\typeout{hello}}
\AddToHook{cmd/testx/after}{\typeout{hello x}}
\@kernel@after@begindocument
\if11 % \fi comes from \test
\test
\if11 % \fi comes from \testx
\testx
\END
2 changes: 2 additions & 0 deletions base/testfiles/github-0795.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.
test
hello
test x
hello x

0 comments on commit b317f9c

Please sign in to comment.