summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/unravel
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-01-06 03:01:33 +0000
committerNorbert Preining <norbert@preining.info>2024-01-06 03:01:33 +0000
commit949a85bb8707bf1aaa2b23b018e24d5001d38e52 (patch)
treec5af6ca7487e0e439195d0308276267088b67352 /macros/latex/contrib/unravel
parent387961768f65ec00d171b3781d4b87ea94bb19f5 (diff)
CTAN sync 202401060301
Diffstat (limited to 'macros/latex/contrib/unravel')
-rw-r--r--macros/latex/contrib/unravel/README.md3
-rw-r--r--macros/latex/contrib/unravel/unravel.dtx749
-rw-r--r--macros/latex/contrib/unravel/unravel.pdfbin880287 -> 908970 bytes
3 files changed, 434 insertions, 318 deletions
diff --git a/macros/latex/contrib/unravel/README.md b/macros/latex/contrib/unravel/README.md
index 97a261e8ae..d9e74f09ed 100644
--- a/macros/latex/contrib/unravel/README.md
+++ b/macros/latex/contrib/unravel/README.md
@@ -26,9 +26,6 @@ step by step.
Some parts of TeX are not covered. In particular, category codes
are fixed for the whole argument of `\unravel` when it is read.
-This package requires up-to-date versions of the `l3kernel`,
-`l3packages` and `l3experimental` bundles.
-
The package is extracted by running `pdflatex unravel.ins`.
For the documentation, run `pdflatex unravel.dtx` twice.
diff --git a/macros/latex/contrib/unravel/unravel.dtx b/macros/latex/contrib/unravel/unravel.dtx
index d69e7a2552..b603c256c8 100644
--- a/macros/latex/contrib/unravel/unravel.dtx
+++ b/macros/latex/contrib/unravel/unravel.dtx
@@ -1,5 +1,5 @@
% \iffalse
-%% File: unravel.dtx Copyright (C) 2013, 2015, 2018-2019, 2021 Bruno Le Floch
+%% File: unravel.dtx Copyright (C) 2013, 2015, 2018-2019, 2021, 2024 Bruno Le Floch
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -23,9 +23,9 @@
%
% \title{The \textsf{unravel} package: \\
% watching TeX digest tokens\thanks{This
-% file has version number 0.3a, last revised 2021/05/11.}}
+% file has version number 0.3c, last revised 2024/01/05.}}
% \author{Bruno Le Floch}
-% \date{2021/05/11}
+% \date{2024/01/05}
%
% \maketitle
% \tableofcontents
@@ -208,9 +208,18 @@
% \end{function}
%
% \begin{function}{online}
-% Integer option determining where to write the output: terminal and
-% log if the option is positive, log only if the option is zero,
-% neither if the option is negative.
+% Integer option (default~$1$) determining where to write the output:
+% terminal and log if the option is positive, log only if the option
+% is zero, neither if the option is negative.
+% \end{function}
+%
+% \begin{function}{output-file}
+% Name of a file where the output is written instead of the log file.
+% Setting this option also sets \texttt{online} to zero. If
+% \texttt{online} is further modified to be positive then the output
+% is written to the terminal as well (hence inevitably to the log
+% file), while if it is made negative then the output is written
+% nowhere.
% \end{function}
%
% \begin{function}{prompt-input}
@@ -530,14 +539,9 @@
\expandafter \endgroup \@@_setup_latexe:
% \end{macrocode}
%
-% Load a few dependencies: \pkg{expl3}, \pkg{xparse}, \pkg{gtl}.
-% Load \pkg{l3str} if \pkg{expl3} is too old and does not define
-% \cs{str_range:nnn}. Otherwise loading \pkg{l3str} would give
-% an error.
+% Load the \pkg{gtl} dependency.
% \begin{macrocode}
-\RequirePackage{expl3,xparse}[2021/01/01]
-\RequirePackage{gtl}[2018/12/28]
-\csname cs_if_exist:cF\endcsname{str_range:nnn}{\RequirePackage{l3str}}
+\RequirePackage{gtl}[2024/01/04]
% \end{macrocode}
%
% Before loading \pkg{unravel}, restore catcodes, so that the implicit
@@ -554,7 +558,7 @@
{%
\csname @@_setup_restore:\endcsname
\ProvidesExplPackage
- {unravel} {2021/05/11} {0.3a} {Watching TeX digest tokens}%
+ {unravel} {2024/01/05} {0.3c} {Watching TeX digest tokens}%
\csname @@_setup_unravel:\endcsname
}%
% \end{macrocode}
@@ -661,26 +665,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}{\l_@@_exp_tl}
-% \begin{macro}{\@@_exp_args:Nx, \@@_exp_args:NNx}
-% Low-level because \cs{exp_args:Nx} redefines an internal
-% \pkg{l3expan} variable which may be appearing in code that we debug.
-% \begin{macrocode}
-\tl_new:N \l_@@_exp_tl
-\cs_new_protected:Npn \@@_exp_args:Nx #1#2
- {
- \cs_set_nopar:Npx \l_@@_exp_tl { \exp_not:N #1 {#2} }
- \l_@@_exp_tl
- }
-\cs_new_protected:Npn \@@_exp_args:NNx #1#2#3
- {
- \cs_set_nopar:Npx \l_@@_exp_tl { \exp_not:N #1 \exp_not:N #2 {#3} }
- \l_@@_exp_tl
- }
-% \end{macrocode}
-% \end{macro}
-% \end{variable}
-%
% \subsubsection{Miscellanous helpers}
%
% \begin{macro}{\@@_tmp:w}
@@ -706,7 +690,7 @@
\cs_new_protected:Npn \@@_file_get_aux:wN ##1 #1 ##2
{
\group_end:
- \tl_set:Nx ##2
+ \tl_set:Ne ##2
{ \exp_not:o {##1} \exp_not:V \@@_everyeof:w }
}
}
@@ -771,7 +755,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_prompt_input:Nn #1#2
{
- \clist_gset:Nx #1
+ \clist_gset:Ne #1
{ \@@_prompt_input:w \prg_do_nothing: #2 , \q_@@_recursion_tail , }
}
\cs_new:Npn \@@_prompt_input:w #1 ,
@@ -941,7 +925,7 @@
{
\group_begin:
\char_set_active_eq:nN {#1} \scan_stop:
- \use:x
+ \use:e
{
\group_end:
\exp_not:n {#2} { \char_generate:nn {#1} { 13 } }
@@ -1023,7 +1007,7 @@
{ TF }
{
\group_begin:
- \@@_exp_args:Nx \char_set_lccode:nn
+ \exp_args:Ne \char_set_lccode:nn
{ ` \exp_args:No \str_head:n { \token_to_str:N #1 } }
{ ` Z }
\tex_lowercase:D { \tl_if_eq:nnTF {#1} } { Z }
@@ -1055,7 +1039,7 @@
{
\group_begin:
\@@_set_escapechar:n { 92 }
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ \exp_args:No \str_tail:n { \token_to_str:N #1 } }
\tl_if_empty:NTF \l_@@_tmpa_tl
{
@@ -1141,7 +1125,7 @@
\cs_new_protected:Npn \@@_prev_input_gpush_gtl:N
{ \@@_prev_input_gpush_aux:NN G }
\cs_new_protected:Npn \@@_prev_input_gpush_aux:NN #1#2
- { \seq_gput_right:Nx \g_@@_prev_input_seq { #1 { \exp_not:o {#2} } } }
+ { \seq_gput_right:Ne \g_@@_prev_input_seq { #1 { \exp_not:o {#2} } } }
% \end{macrocode}
% \end{macro}
%
@@ -1172,7 +1156,7 @@
{
\token_if_eq_meaning:NNTF #1#3
{ \tl_set:Nn }
- { \msg_error:nnnnnn { unravel } { prev-input } {#1} {#3} }
+ { \@@_error:nnnnn { prev-input } {#1} {#3} }
#2
}
% \end{macrocode}
@@ -1183,13 +1167,13 @@
% {
% \@@_prev_input_silent:n,
% \@@_prev_input_silent:V,
-% \@@_prev_input_silent:x
+% \@@_prev_input_silent:e
% }
% \begin{macro}
% {
% \@@_prev_input:n,
% \@@_prev_input:V,
-% \@@_prev_input:x
+% \@@_prev_input:e
% }
% \begin{macrocode}
\cs_new_protected:Npn \@@_prev_input_silent:n #1
@@ -1198,17 +1182,13 @@
\tl_put_right:Nn \l_@@_prev_input_tl {#1}
\@@_prev_input_gpush:N \l_@@_prev_input_tl
}
-\cs_generate_variant:Nn \@@_prev_input_silent:n { V }
-\cs_new_protected:Npn \@@_prev_input_silent:x
- { \@@_exp_args:Nx \@@_prev_input_silent:n }
+\cs_generate_variant:Nn \@@_prev_input_silent:n { V , e }
\cs_new_protected:Npn \@@_prev_input:n #1
{
\@@_prev_input_silent:n {#1}
- \@@_print_action:x { \tl_to_str:n {#1} }
+ \@@_print_action:e { \tl_to_str:n {#1} }
}
-\cs_generate_variant:Nn \@@_prev_input:n { V }
-\cs_new_protected:Npn \@@_prev_input:x
- { \@@_exp_args:Nx \@@_prev_input:n }
+\cs_generate_variant:Nn \@@_prev_input:n { V , e }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1248,7 +1228,7 @@
{
\@@_prev_input_gpop:N \l_@@_head_tl
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \tl_set:Nx #4 { #1 { \l_@@_tmpa_tl #2 \l_@@_head_tl #3 } }
+ \tl_set:Ne #4 { #1 { \l_@@_tmpa_tl #2 \l_@@_head_tl #3 } }
}
% \end{macrocode}
% \end{macro}
@@ -1258,6 +1238,19 @@
%
% \subsubsection{User interaction}
%
+% \begin{variable}{\g_@@_iow, \g_@@_current_output_file_tl}
+% The stream is used to implement the \texttt{output-file} option. At
+% any given time it points to the file named
+% \cs{g_@@_current_output_file_tl}, unless that is empty, in which
+% case the stream is closed. The idea is that we do not want to close
+% the file in between different \cs{unravel} calls since file writing
+% is not additive in \TeX{}.
+% \begin{macrocode}
+\iow_new:N \g_@@_iow
+\tl_new:N \g_@@_current_output_file_tl
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}{\g_@@_before_print_state_tl, \g_@@_before_prompt_tl}
% Code to run before printing the state or before the prompt.
% \begin{macrocode}
@@ -1279,12 +1272,21 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\g_@@_current_online_int}
+% Temporary value replacing \cs{g_@@_online_int} and that can be set
+% through the prompt.
+% \begin{macrocode}
+\int_new:N \g_@@_current_online_int
+% \end{macrocode}
+% \end{variable}
+%
% \begin{variable}
% {
% \g_@@_default_explicit_prompt_bool , \g_@@_explicit_prompt_bool ,
% \g_@@_default_internal_debug_bool , \g_@@_internal_debug_bool ,
% \g_@@_default_number_steps_bool , \g_@@_number_steps_bool ,
% \g_@@_default_online_int , \g_@@_online_int ,
+% \g_@@_default_output_file_tl , \g_@@_output_file_tl ,
% \g_@@_default_prompt_input_clist , \g_@@_prompt_input_clist ,
% \g_@@_default_trace_assigns_bool , \g_@@_trace_assigns_bool ,
% \g_@@_default_trace_expansion_bool , \g_@@_trace_expansion_bool ,
@@ -1301,6 +1303,7 @@
\bool_new:N \g_@@_default_internal_debug_bool
\bool_new:N \g_@@_default_number_steps_bool
\int_new:N \g_@@_default_online_int
+\tl_new:N \g_@@_default_output_file_tl
\clist_new:N \g_@@_default_prompt_input_clist
\bool_new:N \g_@@_default_trace_assigns_bool
\bool_new:N \g_@@_default_trace_expansion_bool
@@ -1316,6 +1319,7 @@
\bool_new:N \g_@@_internal_debug_bool
\bool_new:N \g_@@_number_steps_bool
\int_new:N \g_@@_online_int
+\tl_new:N \g_@@_output_file_tl
\clist_new:N \g_@@_prompt_input_clist
\bool_new:N \g_@@_trace_assigns_bool
\bool_new:N \g_@@_trace_expansion_bool
@@ -1333,7 +1337,7 @@
%
% \begin{variable}{\g_@@_action_text_str}
% Text describing the action, displayed at each step. This should
-% only be altered through \cs{@@_set_action_text:x}, which sets the
+% only be altered through \cs{@@_set_action_text:e}, which sets the
% escape character as appropriate before converting the argument to a
% string.
% \begin{macrocode}
@@ -1478,12 +1482,13 @@
% \begin{variable}{\l_@@_defined_tl, \l_@@_defining_tl}
% The token that is defined by the prefixed command (such as
% \tn{chardef} or \tn{futurelet}), and the code to define it. We do
-% not use the the previous-input sequence to store that code: rather,
+% not use the the previous-input sequence to store that code because
% this sequence contains a string representation of the code, which is
-% not suitable for the definition. This is safe, as definitions
-% cannot be nested. This is needed for expanding assignments, as
-% expansion should be shown to the user, but then later should not be
-% performed again when defining.
+% not suitable for the definition. Using a single variable here is
+% safe, as definitions cannot be nested. This is needed for expanding
+% assignments, as expansion should be shown to the user, but then
+% later should not be performed again when defining. It is also
+% helpful in tracking some register assignments.
% \begin{macrocode}
\tl_new:N \l_@@_defined_tl
\tl_new:N \l_@@_defining_tl
@@ -1531,8 +1536,8 @@
% Used to determine if a macro has simple parameters or not.
% \begin{macrocode}
\group_begin:
- \cs_set:Npx \@@_tmp:w #1 { \c_hash_str #1 }
- \tl_const:Nx \c_@@_parameters_tl
+ \cs_set_nopar:Npe \@@_tmp:w #1 { \c_hash_str #1 }
+ \tl_const:Ne \c_@@_parameters_tl
{ ^ \tl_map_function:nN { 123456789 } \@@_tmp:w }
\group_end:
% \end{macrocode}
@@ -1612,7 +1617,7 @@
\tl_const:Nn \c_@@_over_tl { / }
\tl_const:Nn \c_@@_lq_tl { ` }
\tl_const:Nn \c_@@_rq_tl { ' }
-\tl_const:Nn \c_@@_dq_tl { " }
+\tl_const:Nn \c_@@_dq_tl { " } %"
\tl_const:Nn \c_@@_lp_tl { ( }
\tl_const:Nn \c_@@_rp_tl { ) }
\tl_const:Nn \c_@@_eq_tl { = }
@@ -1624,7 +1629,7 @@
% \begin{variable}{\c_@@_frozen_relax_gtl}
% \TeX{}'s |frozen_relax|, inserted by \cs{@@_insert_relax:}.
% \begin{macrocode}
-\gtl_const:Nx \c_@@_frozen_relax_gtl { \if_int_compare:w 0 = 0 \fi: }
+\gtl_const:Ne \c_@@_frozen_relax_gtl { \if_int_compare:w 0 = 0 \fi: }
% \end{macrocode}
% \end{variable}
%
@@ -1686,7 +1691,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tex_primitive:nnn #1#2#3
{
- \tl_const:cx { c_@@_tex_#1_tl }
+ \tl_const:ce { c_@@_tex_#1_tl }
{ { \@@_tex_use:n {#2} } {#3} }
}
\cs_new_protected:Npn \@@_tex_primitive_pdf:nnn #1#2#3
@@ -2426,7 +2431,7 @@
\@@_tex_primitive:nnn { expanded } { convert } { 34 }
\sys_if_engine_luatex:T
{ \@@_tex_primitive:nnn { luaescapestring } { convert } { 35 } }
-\sys_if_engine_xetex:T
+\bool_if:nT { \sys_if_engine_xetex_p: || \sys_if_engine_ptex_p: || \sys_if_engine_uptex_p: }
{
\@@_tex_primitive:nnn { Ucharcat } { convert } { 40 }
}
@@ -2483,7 +2488,7 @@
\gtl_head_do:NN \l_@@_head_gtl \@@_get_next_aux:w
\gtl_if_tl:NTF \l_@@_head_gtl
{
- \tl_set:Nx \l_@@_head_tl
+ \tl_set:Ne \l_@@_head_tl
{ \gtl_head:N \l_@@_head_gtl }
\token_if_eq_meaning:NNT
\l_@@_head_token \@@_special_relax:
@@ -2522,7 +2527,7 @@
\tl_if_eq:onTF { \l_@@_head_tl } { \@@_unravel_marker: }
{ \@@_get_next_marker: }
{
- \@@_exp_args:NNx \use:nn \@@_notexpanded_test:w
+ \exp_args:NNe \use:nn \@@_notexpanded_test:w
{ \scan_stop: \exp_after:wN \cs_to_str:N \l_@@_head_tl Z }
\q_mark \@@_notexpanded_expand:n
#1 Z \q_mark \use_none:n
@@ -2533,12 +2538,12 @@
##1 #1 ##2 Z \q_mark ##3##4 \q_stop
{ ##3 {##2} }
}
-\exp_args:Nx \@@_tmp:w { \scan_stop: \tl_to_str:n { notexpanded: } }
+\exp_args:Ne \@@_tmp:w { \scan_stop: \tl_to_str:n { notexpanded: } }
\group_begin:
\char_set_catcode_active:n { 0 }
\cs_new_protected:Npn \@@_notexpanded_expand:n #1
{
- \@@_exp_args:Nx \tl_if_empty:nTF { \str_tail:n {#1} }
+ \exp_args:Ne \tl_if_empty:nTF { \str_tail:n {#1} }
{
\group_begin:
\char_set_lccode:nn { 0 } { `#1 }
@@ -2571,14 +2576,14 @@
{
\@@_get_next:
\tl_if_eq:onTF \l_@@_head_tl { \@@:nn }
- { \@@_error:nxxxx { nested-unravel } { } { } { } { } }
- { \@@_error:nxxxx { internal } { marker~unknown } { } { } { } }
+ { \@@_error:neeee { nested-unravel } { } { } { } { } }
+ { \@@_error:neeee { internal } { marker~unknown } { } { } { } }
\@@_input_gpop_item:NF \l_@@_argi_tl
- { \@@_error:nxxxx { internal } { marker~1 } { } { } { } }
+ { \@@_error:neeee { internal } { marker~1 } { } { } { } }
\@@_input_gpop_item:NF \l_@@_argii_tl
- { \@@_error:nxxxx { internal } { marker~2 } { } { } { } }
+ { \@@_error:neeee { internal } { marker~2 } { } { } { } }
\exp_args:Nno \keys_set:nn { unravel } \l_@@_argi_tl
- \@@_exp_args:Nx \@@_back_input:n
+ \exp_args:Ne \@@_back_input:n
{ \exp_not:N \exp_not:n { \exp_not:o \l_@@_argii_tl } }
\@@_get_next:
}
@@ -2641,22 +2646,22 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_cmd_aux_meaning:
{
- \tl_set:Nx \l_@@_head_meaning_tl
+ \tl_set:Ne \l_@@_head_meaning_tl
{
\exp_after:wN \@@_strip_escape:w
\token_to_meaning:N \l_@@_head_token
\tl_to_str:n { : }
}
- \tl_set:Nx \l_@@_head_meaning_tl
+ \tl_set:Ne \l_@@_head_meaning_tl
{
\exp_after:wN \@@_set_cmd_aux_meaning:w
\l_@@_head_meaning_tl \q_stop
}
}
-\use:x
+\use:e
{
\cs_new:Npn \exp_not:N \@@_set_cmd_aux_meaning:w
- ##1 \token_to_str:N : ##2 \exp_not:N \q_stop {##1}
+ #1 \token_to_str:N : #2 \exp_not:N \q_stop {#1}
}
% \end{macrocode}
% \end{macro}
@@ -2714,7 +2719,7 @@
{ \tl_to_str:n { xpandable~luacall } }
{ }
{
- \@@_error:nxxxx { unknown-primitive }
+ \@@_error:neeee { unknown-primitive }
{ \l_@@_head_meaning_tl } { } { } { }
}
}
@@ -2724,7 +2729,7 @@
{
\exp_last_unbraced:NV \@@_set_cmd_aux_primitive:nn
\c_@@_tex_relax_tl
- \@@_error:nxxxx { unknown-primitive }
+ \@@_error:neeee { unknown-primitive }
{ \l_@@_head_meaning_tl } { } { } { }
}
}
@@ -2777,7 +2782,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_cmd_aux_numeric:
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{
\exp_after:wN \@@_set_cmd_aux_numeric:N
\l_@@_head_meaning_tl + 0
@@ -2831,13 +2836,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_cmd_aux_char:
{
- \tl_set:Nx \l_@@_head_meaning_tl
+ \tl_set:Ne \l_@@_head_meaning_tl
{ \token_to_meaning:N \l_@@_head_token }
\token_if_eq_catcode:NNT \l_@@_head_token \c_catcode_other_token
{ \tl_set:Nn \l_@@_head_meaning_tl { other~ } }
\exp_after:wN \@@_set_cmd_aux_char:w
\l_@@_head_meaning_tl \q_stop
- \@@_exp_args:NNx \int_set:Nn \l_@@_head_char_int
+ \exp_args:NNe \int_set:Nn \l_@@_head_char_int
{ ` \@@_token_to_char:N \l_@@_head_token }
}
\cs_new_protected:Npn \@@_set_cmd_aux_char:w #1 ~ #2 \q_stop
@@ -2897,7 +2902,7 @@
% \begin{macro}{\@@_input_split:}
% If the input is completely flat, and is a token list starting with
% an |N|-type token, try to unflatten it by splitting at each
-% occurence of that first character
+% occurence of that first token.
% \begin{macrocode}
\cs_new_protected:Npn \@@_input_split:
{
@@ -2913,8 +2918,8 @@
{
\gtl_if_head_is_N_type:NT #1
{
- \tl_set:Nx \l_@@_input_tmpa_tl { \gtl_left_tl:N #1 }
- \@@_exp_args:NNx \use:nn
+ \tl_set:Ne \l_@@_input_tmpa_tl { \gtl_left_tl:N #1 }
+ \exp_args:NNe \use:nn
\@@_input_split_auxii:N
{ \tl_head:N \l_@@_input_tmpa_tl }
}
@@ -2987,7 +2992,7 @@
{
\int_compare:nNnF {#1} = 0
{
- \tl_set:Nx \l_@@_input_get_left_tl
+ \tl_set:Ne \l_@@_input_get_left_tl
{ \gtl_left_tl:c { g_@@_input_#1_gtl } }
\tl_concat:NNN #2 #2 \l_@@_input_get_left_tl
\gtl_if_tl:cT { g_@@_input_#1_gtl }
@@ -3095,7 +3100,7 @@
{
\gtl_if_tl:NTF #1
{
- \tl_put_right:Nx #2 { \gtl_left_tl:N #1 }
+ \tl_put_right:Ne #2 { \gtl_left_tl:N #1 }
\gtl_gclear:N #1
\int_gdecr:N \g_@@_input_int
\@@_input_gpop_tl_aux:N #2
@@ -3105,7 +3110,7 @@
{ \int_compare:nNnTF { \gtl_extra_end:N #1 } > 0 }
{ \use_i:nn }
{
- \tl_put_right:Nx #2 { \gtl_left_tl:N #1 }
+ \tl_put_right:Ne #2 { \gtl_left_tl:N #1 }
\gtl_gpop_left_tl:N #1
}
{
@@ -3117,7 +3122,26 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_back_input:n, \@@_back_input:x}
+% \begin{macro}[TF]{\@@_input_if_head_is_group_begin:}
+% Call \cs{@@_input_if_empty:TF} to remove empty levels from the input
+% stack, then check if the left-most non-empty level starts with an
+% explicit begin-group character token.
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn \@@_input_if_head_is_group_begin: { T , F , TF }
+ {
+ \@@_input_if_empty:TF
+ { \prg_return_false: }
+ {
+ \exp_args:Nc \gtl_if_head_is_group_begin:NTF
+ { g_@@_input_ \int_use:N \g_@@_input_int _gtl }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_back_input:n, \@@_back_input:V, \@@_back_input:o}
% Insert a token list back into the input. Use \cs{gtl_gclear_new:c}
% to define the gtl variable if necessary: this happens whenever a
% new largest value of \cs{g_@@_input_int} is reached.
@@ -3129,8 +3153,6 @@
\gtl_gset:cn { g_@@_input_ \int_use:N \g_@@_input_int _gtl }
}
\cs_generate_variant:Nn \@@_back_input:n { V , o }
-\cs_new_protected:Npn \@@_back_input:x
- { \@@_exp_args:Nx \@@_back_input:n }
% \end{macrocode}
% \end{macro}
%
@@ -3140,7 +3162,7 @@
\cs_new_protected:Npn \@@_back_input_gtl:N #1
{
\gtl_if_tl:NTF #1
- { \@@_back_input:x { \gtl_left_tl:N #1 } }
+ { \exp_args:Ne \@@_back_input:n { \gtl_left_tl:N #1 } }
{
\gtl_gconcat:cNc
{ g_@@_input_ \int_use:N \g_@@_input_int _gtl }
@@ -3166,10 +3188,10 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_back_input_tl_o:
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ \exp_args:NV \exp_not:o \l_@@_head_tl }
\@@_back_input:V \l_@@_tmpa_tl
- \@@_print_expansion:x
+ \@@_print_expansion:e
{ \tl_to_str:N \l_@@_head_tl = \tl_to_str:N \l_@@_tmpa_tl }
}
% \end{macrocode}
@@ -3228,7 +3250,7 @@
% \@@_macro_replacement:N
% }
% \begin{macrocode}
-\use:x
+\use:e
{
\exp_not:n { \cs_new:Npn \@@_macro_split_do:NN #1 }
{
@@ -3258,20 +3280,22 @@
% \@@_macro_call_safe:,
% \@@_macro_call_quick:,
% \@@_macro_call_quick_loop:NNN,
+% \@@_macro_call_quick_loop:NN,
% \@@_macro_call_quick_runaway:Nw,
% }
% Macros are simply expanded once. We cannot determine precisely
% which tokens a macro will need for its parameters, but we know that
% it must form a balanced token list. Thus we can be safe by
% extracting the longest balanced prefix in the input and working with
-% that.
+% that. We need to check if the argument was braced, to improve the
+% error recovery for a non-\tn{long} macro receiving \tn{par}.
% \begin{macrocode}
\cs_new_protected:Npn \@@_macro_call:
{
\bool_if:NTF \g_@@_speedup_macros_bool
{
- \tl_set:Nx \l_@@_tmpa_tl
- {^ \exp_after:wN \@@_macro_parameter:N \l_@@_head_tl }
+ \tl_set:Ne \l_@@_tmpa_tl
+ { ^ \exp_after:wN \@@_macro_parameter:N \l_@@_head_tl }
\@@_tl_if_in:ooTF \c_@@_parameters_tl \l_@@_tmpa_tl
{ \@@_macro_call_quick: } { \@@_macro_call_safe: }
}
@@ -3292,16 +3316,23 @@
\cs_new_protected:Npn \@@_macro_call_quick_loop:NNN #1#2#3
{
\use_none:n #2
+ \@@_input_if_head_is_group_begin:TF
+ { \@@_macro_call_quick_loop:NN \prg_do_nothing: }
+ { \@@_macro_call_quick_loop:NN \use:n }
+ #3
+ }
+\cs_new_protected:Npn \@@_macro_call_quick_loop:NN #1#2
+ {
\@@_input_gpop_item:NF \l_@@_tmpa_tl
- { \@@_macro_call_quick_runaway:Nw #3 }
- \tl_put_right:Nx \l_@@_head_tl
- { { \exp_not:V \l_@@_tmpa_tl } }
+ { \@@_macro_call_quick_runaway:Nw #2 }
+ \tl_put_right:Ne \l_@@_head_tl
+ { #1 { \exp_not:V \l_@@_tmpa_tl } }
\@@_macro_call_quick_loop:NNN
- #3
+ #2
}
\cs_new_protected:Npn \@@_macro_call_quick_runaway:Nw #1#2 \q_stop
{
- \@@_error:nxxxx { runaway-macro-parameter }
+ \@@_error:neeee { runaway-macro-parameter }
{ \tl_to_str:N \l_@@_head_tl } { \tl_to_str:n {#1} } { } { }
}
% \end{macrocode}
@@ -3337,7 +3368,7 @@
\bool_if:NT \g_@@_internal_debug_bool
{
\@@_set_cmd:
- \@@_exp_args:Nx \iow_term:n { Exp:~\int_to_arabic:n { \l_@@_head_cmd_int } }
+ \exp_args:Ne \iow_term:n { Exp:~\int_to_arabic:n { \l_@@_head_cmd_int } }
}
\token_if_macro:NTF \l_@@_head_token
{ \@@_macro_call: }
@@ -3362,7 +3393,7 @@
{
\cs_if_exist_use:cF
{ @@_expandable_ \int_use:N \l_@@_head_cmd_int : }
- { \@@_error:nxxxx { internal } { expandable } { } { } { } }
+ { \@@_error:neeee { internal } { expandable } { } { } { } }
}
{
\@@_set_cmd_aux_unknown:
@@ -3570,7 +3601,7 @@
\quark_if_recursion_tail_stop_do:nn {#2}
{ \@@_scan_keyword_true: }
\quark_if_recursion_tail_stop_do:nn {#3}
- { \@@_error:nxxxx { internal } { odd-keyword-length } { } { } { } }
+ { \@@_error:neeee { internal } { odd-keyword-length } { } { } { } }
\@@_get_x_next:
\@@_scan_keyword_test:NNTF #2#3
{
@@ -3605,7 +3636,7 @@
\cs_new_protected:Npn \@@_scan_keyword_true:
{
\@@_prev_input_gpop_gtl:N \l_@@_tmpb_gtl
- \@@_prev_input:x { \gtl_to_str:N \l_@@_tmpb_gtl }
+ \@@_prev_input:e { \gtl_to_str:N \l_@@_tmpb_gtl }
\prg_return_true:
}
\cs_new_protected:Npn \@@_scan_keyword_false:w
@@ -3773,7 +3804,7 @@
}
\int_compare:nNnTF {#3} < { 4 }
{ \@@_thing_use_get:nnNN {#1} {#3} \l_@@_head_tl \l_@@_tmpa_tl }
- { \tl_set:Nx \l_@@_tmpa_tl { \@@_the:w \l_@@_head_tl } }
+ { \tl_set:Ne \l_@@_tmpa_tl { \@@_the:w \l_@@_head_tl } }
\@@_rescan_something_internal_auxii:Vn \l_@@_tmpa_tl {#1}
\@@_break_point:
\int_compare:nNnT {#3} < { 4 } { \@@_print_action: }
@@ -3782,7 +3813,7 @@
{
\@@_prev_input_silent:n {#1}
\@@_set_action_text:
- \@@_set_action_text:x
+ \@@_set_action_text:e
{ \g_@@_action_text_str \use:n { ~ => ~ } \tl_to_str:n {#1} }
\int_gset:Nn \g_@@_val_level_int {#2}
}
@@ -3796,8 +3827,9 @@
% This expands to a digit (the level generated by whatever token is
% the current |head|), followed by some code to fetch necessary
% operands. In most cases, this can be done by simply looking at the
-% |cmd| integer, but for |last_item|, |set_aux| and |register|, the level of the
-% token depends on the |char| integer. When the token is not allowed
+% |cmd| integer, but for |last_item|, |set_aux|, |set_shape| and
+% |register|, the level of the token, or what has to be scanned,
+% depends on the |char| integer. When the token is not allowed
% after \tn{the} (or at any other position where
% \cs{@@_rescan_something_internal:n} is called), the resulting level
% is~$8$, large enough so that the main function knows it is
@@ -3823,7 +3855,7 @@
{ 81 } { 1 } % set_page_dimen
{ 82 } { 0 } % set_page_int
{ 83 } { 1 \@@_scan_int: } % set_box_dimen
- { 84 } { 0 \@@_scan_int: } % set_shape
+ { 84 } { \@@_thing_set_shape: } % set_shape
{ 85 } { 0 \@@_scan_int: } % def_code
{ 86 } { 4 \@@_scan_int: } % def_family
{ 87 } { 4 } % set_font
@@ -3836,6 +3868,8 @@
}
\cs_new:Npn \@@_thing_set_aux:
{ \int_compare:nNnTF \l_@@_head_char_int = { 1 } { 1 } { 0 } }
+\cs_new:Npn \@@_thing_set_shape:
+ { \int_compare:nNnTF \l_@@_head_char_int = 0 { 0 } { 0 \@@_scan_int: } }
\cs_new:Npn \@@_thing_last_item:
{
\int_compare:nNnTF \l_@@_head_char_int < { 26 }
@@ -3910,7 +3944,7 @@
{
\int_compare:nNnT {#1} = { 3 }
{ \@@_tex_error:nV { incompatible-units } #3 }
- \tl_set:Nx #4
+ \tl_set:Ne #4
{
\int_case:nn { \int_min:nn {#1} {#2} }
{
@@ -3924,12 +3958,12 @@
{
\int_case:nnF {#1}
{
- { 0 } { \tl_set:Nx #4 { \int_eval:n {#3} } }
- { 3 } { \tl_set:Nx #4 { \muskip_eval:n {#3} } }
+ { 0 } { \tl_set:Ne #4 { \int_eval:n {#3} } }
+ { 3 } { \tl_set:Ne #4 { \muskip_eval:n {#3} } }
}
{
\@@_tex_error:nV { incompatible-units } #3
- \tl_set:Nx #4 { \muskip_eval:n { \tex_gluetomu:D #3 } }
+ \tl_set:Ne #4 { \muskip_eval:n { \tex_gluetomu:D #3 } }
}
}
}
@@ -3950,7 +3984,7 @@
\cs_new_protected:Npn \@@_scan_expr_op:NN #1#2
{
\@@_get_x_non_blank:
- \tl_case:NnF \l_@@_head_tl
+ \token_case_meaning:NnF \l_@@_head_tl
{
\c_@@_plus_tl
{
@@ -4049,7 +4083,7 @@
}
\cs_new_protected:Npn \@@_scan_int_char:
{
- \tl_case:NnF \l_@@_head_tl
+ \token_case_meaning:NnF \l_@@_head_tl
{
\c_@@_lq_tl { \@@_scan_int_lq: }
\c_@@_rq_tl
@@ -4062,7 +4096,7 @@
{
\@@_prev_input:V \l_@@_head_tl
\@@_get_x_next:
- \@@_scan_int_explicit:Nn \c_false_bool { " }
+ \@@_scan_int_explicit:Nn \c_false_bool { " } % "
}
}
{ \@@_scan_int_explicit:Nn \c_false_bool { } }
@@ -4072,13 +4106,13 @@
\@@_get_next:
\@@_gtl_if_head_is_definable:NF \l_@@_head_gtl
{
- \tl_set:Nx \l_@@_head_tl
+ \tl_set:Ne \l_@@_head_tl
{ \@@_token_to_char:N \l_@@_head_token }
}
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ \int_eval:n { \exp_after:wN ` \l_@@_head_tl } }
\@@_prev_input_silent:V \l_@@_tmpa_tl
- \@@_print_action:x
+ \@@_print_action:e
{ ` \gtl_to_str:N \l_@@_head_gtl = \l_@@_tmpa_tl }
\@@_skip_optional_space:
}
@@ -4314,7 +4348,7 @@
\@@_gtl_if_head_is_definable:NTF \l_@@_head_gtl
{ \@@_back_input: }
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ \@@_token_to_char:N \l_@@_head_token }
\tl_if_eq:NNT \l_@@_tmpa_tl \c_@@_dq_tl
{
@@ -4363,7 +4397,7 @@
\@@_prev_input_gpush:
\@@_scan_toks:NN \c_false_bool \c_true_bool
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \@@_prev_input_silent:x
+ \@@_prev_input_silent:e
{ { \exp_after:wN \tl_to_str:n \l_@@_tmpa_tl } }
}
% \end{macrocode}
@@ -4376,7 +4410,7 @@
\@@_prev_input_gpush:
\@@_scan_toks:NN \c_false_bool \c_true_bool
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \@@_prev_input_silent:x
+ \@@_prev_input_silent:e
{ { \exp_not:N \exp_not:n \exp_not:V \l_@@_tmpa_tl } }
}
% \end{macrocode}
@@ -4440,7 +4474,7 @@
\@@_error:nnnnn { runaway-text } { } { } { } { }
\@@_exit_hard:w
}
- \tl_set:Nx \l_@@_head_tl { { \exp_not:V \l_@@_head_tl } }
+ \tl_set:Ne \l_@@_head_tl { { \exp_not:V \l_@@_head_tl } }
\bool_if:NT #1
{ \tl_put_right:NV \l_@@_defining_tl \l_@@_head_tl }
\@@_prev_input_silent:V \l_@@_head_tl
@@ -4467,7 +4501,7 @@
\@@_prev_input_gtl:N \l_@@_head_gtl
\@@_scan_group_x:n { 1 }
\@@_prev_input_gpop_gtl:N \l_@@_tmpb_gtl
- \@@_prev_input_silent:x
+ \@@_prev_input_silent:e
{ \gtl_left_tl:N \l_@@_tmpb_gtl }
}
}
@@ -4498,7 +4532,7 @@
}
{
\@@_prev_input_silent:V \l_@@_head_tl
- \tl_put_right:Nx \l_@@_defining_tl
+ \tl_put_right:Ne \l_@@_defining_tl
{ \exp_not:N \exp_not:N \exp_not:V \l_@@_head_tl }
\@@_scan_group_xdef:n {#1}
}
@@ -4625,7 +4659,7 @@
\@@_back_input:
\@@_error:nnnnn { missing-box } { } { } { } { }
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
% \end{macro}
@@ -4675,7 +4709,7 @@
{ \@@_prepare_mag: }
\tl_use:N \l_@@_head_tl \scan_stop:
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
}
% \end{macrocode}
@@ -4698,7 +4732,7 @@
\@@_back_input:
\@@_error:nnnnn { improper-leaders } { } { } { } { }
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
}
% \end{macrocode}
@@ -4729,7 +4763,7 @@
{ \@@_box_hook:N \tex_everyvbox:D }
\@@_scan_spec:
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_set_action_text:x
+ \@@_set_action_text:e
{ \tl_to_str:N \l_@@_head_tl \iow_char:N \{ }
\seq_push:Nf \l_@@_leaders_box_seq
{ \bool_if:NTF #1 { \mode_if_vertical:TF { v } { h } } { Z } }
@@ -4755,7 +4789,7 @@
\str_if_eq:eeF
{ \tl_head:N \l_@@_tmpa_tl } { \exp_not:N \@@_box_hook:w }
{
- \@@_exp_args:Nx #1
+ \exp_args:Ne #1
{
\exp_not:n { \@@_box_hook:w \prg_do_nothing: }
\exp_not:V #1
@@ -4768,7 +4802,7 @@
\gtl_clear:N \l_@@_after_group_gtl
\@@_print_action:
\@@_back_input:o {##1}
- \@@_set_action_text:x
+ \@@_set_action_text:e
{ \token_to_meaning:N #1 = \tl_to_str:o {##1} }
\tl_if_empty:oF {##1} { \@@_print_action: }
}
@@ -4812,33 +4846,31 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_char:n, \@@_char:V, \@@_char:x}
+% \begin{macro}{\@@_char:n, \@@_char:V, \@@_char:e}
% \begin{macrocode}
\cs_new_protected:Npn \@@_char:n #1
{
\tex_char:D #1 \scan_stop:
\@@_charcode_if_safe:nTF {#1}
{
- \tl_set:Nx \l_@@_tmpa_tl { \char_generate:nn {#1} { 12 } }
+ \tl_set:Ne \l_@@_tmpa_tl { \char_generate:nn {#1} { 12 } }
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_tmpa_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_tmpa_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_tmpa_tl }
}
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ \exp_not:N \char \int_eval:n {#1} ~ }
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_tmpa_tl
- \@@_print_action:x
+ \@@_print_action:e
{ " \char_generate:nn {#1} { 12 } " = \tl_to_str:N \l_@@_tmpa_tl }
}
}
-\cs_generate_variant:Nn \@@_char:n { V }
-\cs_new_protected:Npn \@@_char:x
- { \@@_exp_args:Nx \@@_char:n }
+\cs_generate_variant:Nn \@@_char:n { V , e }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}
-% {\@@_char_in_mmode:n, \@@_char_in_mmode:V, \@@_char_in_mmode:x}
+% {\@@_char_in_mmode:n, \@@_char_in_mmode:V, \@@_char_in_mmode:e}
% \begin{macrocode}
\cs_new_protected:Npn \@@_char_in_mmode:n #1
{
@@ -4847,30 +4879,27 @@
{ % math active
\@@_active_do:nn {#1} { \gtl_set:Nn \l_@@_head_gtl }
\@@_back_input:
- \@@_print_action:x
+ \@@_print_action:e
{ \char_generate:nn {#1} { 12 } ~ active }
}
{ \@@_char:n {#1} }
}
-\cs_generate_variant:Nn \@@_char_in_mmode:n { V }
-\cs_new_protected:Npn \@@_char_in_mmode:x
- { \@@_exp_args:Nx \@@_char_in_mmode:n }
+\cs_generate_variant:Nn \@@_char_in_mmode:n { V , e }
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_mathchar:n, \@@_mathchar:x}
+% \begin{macro}{\@@_mathchar:n, \@@_mathchar:e}
% ^^A todo: \omathchar support
% \begin{macrocode}
\cs_new_protected:Npn \@@_mathchar:n #1
{
\tex_mathchar:D #1 \scan_stop:
- \tl_set:Nx \l_@@_tmpa_tl
- { \exp_not:N \mathchar " \int_to_hex:n {#1} ~ }
+ \tl_set:Ne \l_@@_tmpa_tl
+ { \exp_not:N \mathchar " \int_to_hex:n {#1} ~ } % "
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_tmpa_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_tmpa_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_tmpa_tl }
}
-\cs_new_protected:Npn \@@_mathchar:x
- { \@@_exp_args:Nx \@@_mathchar:n }
+\cs_generate_variant:Nn \@@_mathchar:n { e }
% \end{macrocode}
% \end{macro}
%
@@ -4888,7 +4917,7 @@
\bool_if:NTF #1 { \tex_indent:D } { \tex_noindent:D }
\exp_args:NV \@@_everypar:w \l_@@_tmpa_tl
\@@_back_input:V \l_@@_tmpa_tl
- \@@_print_action:x
+ \@@_print_action:e
{
\g_@@_action_text_str \c_space_tl : ~
\token_to_str:N \everypar = { \tl_to_str:N \l_@@_tmpa_tl }
@@ -4912,7 +4941,7 @@
{
\tex_par:D
\gtl_gput_right:Nn \g_@@_output_gtl { \par }
- \@@_print_action:x { Paragraph~end. }
+ \@@_print_action:e { Paragraph~end. }
}
% \end{macrocode}
% \end{macro}
@@ -5062,7 +5091,7 @@
{
\@@_back_input_gtl:N \l_@@_after_group_gtl
\c_group_end_token
- \@@_print_action:x
+ \@@_print_action:e
{ \token_to_str:N #2 \prg_replicate:nn { #1 + 1 } { {...} } }
}
{ \exp_args:NV \@@_end_choice_group:nN \l_@@_choice_int #2 }
@@ -5077,7 +5106,7 @@
\use:n \c_group_begin_token
\int_set:Nn \l_@@_choice_int { #1 + 1 }
\gtl_clear:N \l_@@_after_group_gtl
- \@@_print_action:x
+ \@@_print_action:e
{
\token_to_str:N #2
\prg_replicate:nn {#1} { { ... } }
@@ -5093,7 +5122,7 @@
{
\int_compare:nNnTF \@@_currentgrouptype: = { 0 }
{ % bottom-level
- \@@_error:nxxxx { extra-close }
+ \@@_error:neeee { extra-close }
{ \token_to_meaning:N \l_@@_head_token } { } { } { }
}
{
@@ -5109,7 +5138,7 @@
}
{ \gtl_set_eq:NN \l_@@_head_gtl \c_group_end_gtl }
\@@_back_input:
- \@@_error:nxxxx { off-save }
+ \@@_error:neeee { off-save }
{ \gtl_to_str:N \l_@@_head_gtl } { } { } { }
}
}
@@ -5267,7 +5296,7 @@
{
\exp_after:wN \@@_token_if_expandable:NTF \l_@@_head_tl
{
- \@@_set_action_text:x
+ \@@_set_action_text:e
{ \iow_char:N \\notexpanded: \g_@@_action_text_str }
}
{ }
@@ -5392,7 +5421,7 @@
\g_@@_output_gtl \c_group_begin_gtl
\tl_use:N \l_@@_head_tl \c_group_begin_token
}
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -5427,7 +5456,7 @@
{
\@@_mode_non_vertical:n
{
- \tl_set:Nx \l_@@_tmpa_tl
+ \tl_set:Ne \l_@@_tmpa_tl
{ ` \@@_token_to_char:N \l_@@_head_token }
\mode_if_math:TF
{ \@@_char_in_mmode:V \l_@@_tmpa_tl }
@@ -5475,7 +5504,7 @@
\tex_penalty:D - '10000000000 ~
}
\@@_build_page:
- \@@_print_action:x { End~everything! }
+ \@@_print_action:e { End~everything! }
}
{
\@@_print_outcome:
@@ -5496,7 +5525,7 @@
\@@_scan_int:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
}
% \end{macrocode}
@@ -5542,8 +5571,8 @@
\@@_scan_int:
\@@_prev_input_gpop:N \l_@@_head_tl
\mode_if_math:TF
- { \@@_char_in_mmode:x { \tl_tail:N \l_@@_head_tl } }
- { \@@_char:x { \tl_tail:N \l_@@_head_tl } }
+ { \@@_char_in_mmode:e { \tl_tail:N \l_@@_head_tl } }
+ { \@@_char:e { \tl_tail:N \l_@@_head_tl } }
}
}
% \end{macrocode}
@@ -5560,7 +5589,7 @@
\@@_print_action:
\@@_scan_int:
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_mathchar:x { \tl_tail:N \l_@@_head_tl }
+ \@@_mathchar:e { \tl_tail:N \l_@@_head_tl }
}
}
% \end{macrocode}
@@ -5576,9 +5605,9 @@
\@@_scan_toks:NN \c_false_bool \c_true_bool
\@@_prev_input_gpop:N \l_@@_tmpa_tl
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_print_action:x
+ \@@_print_action:e
{ \tl_to_str:N \l_@@_head_tl \tl_to_str:N \l_@@_tmpa_tl }
- \tl_put_right:Nx \l_@@_head_tl
+ \tl_put_right:Ne \l_@@_head_tl
{ { \exp_not:N \exp_not:n \exp_not:V \l_@@_tmpa_tl } }
\tl_use:N \l_@@_head_tl
}
@@ -5616,7 +5645,7 @@
\@@_get_x_next:
\@@_rescan_something_internal:n { 5 }
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_exp_args:Nx \use:n
+ \exp_args:Ne \use:n % better display than \use:e
{ \tex_showtokens:D { \tl_tail:N \l_@@_head_tl } }
}
}
@@ -5683,7 +5712,7 @@
\@@_scan_int:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
% \end{macro}
@@ -5735,7 +5764,7 @@
{ \int_eval:n { \l_@@_head_char_int - 2 } }
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
}
% \end{macrocode}
@@ -5774,7 +5803,7 @@
{ \@@_scan_dimen:nN { 3 } \c_false_bool }
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
% \end{macro}
@@ -5846,7 +5875,7 @@
\@@_scan_alt_rule:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -5877,7 +5906,7 @@
\gtl_gconcat:NNN \g_@@_output_gtl
\g_@@_output_gtl \c_group_begin_gtl
\tl_use:N \l_@@_head_tl \c_group_begin_token
- \@@_print_action:x
+ \@@_print_action:e
{ \tl_to_str:N \l_@@_head_tl \iow_char:N \{ }
}
% \end{macrocode}
@@ -5902,7 +5931,7 @@
\tl_set_eq:NN \l_@@_tmpa_tl \l_@@_head_tl
\@@_get_next:
\gtl_gset_eq:NN \g_@@_after_assignment_gtl \l_@@_head_gtl
- \@@_print_action:x
+ \@@_print_action:e
{
Afterassignment:~\tl_to_str:N \l_@@_tmpa_tl
\gtl_to_str:N \l_@@_head_gtl
@@ -5920,7 +5949,7 @@
\@@_get_next:
\int_compare:nNnTF \@@_currentgrouptype: = 0
{
- \@@_print_action:x
+ \@@_print_action:e
{
Aftergroup~(level~0~=>~dropped):~
\tl_to_str:N \l_@@_tmpa_tl
@@ -5930,7 +5959,7 @@
{
\gtl_concat:NNN \l_@@_after_group_gtl
\l_@@_after_group_gtl \l_@@_head_gtl
- \@@_print_action:x
+ \@@_print_action:e
{
Aftergroup:~\tl_to_str:N \l_@@_tmpa_tl
\gtl_to_str:N \l_@@_head_gtl
@@ -5948,7 +5977,7 @@
\@@_scan_int:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -6011,7 +6040,7 @@
\@@_prev_input_gpop:N \l_@@_head_tl
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
\@@_break_point:
}
% \end{macrocode}
@@ -6109,7 +6138,7 @@
{
\gtl_gput_right:NV \g_@@_output_gtl \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
{
\int_case:nnF \tex_currentgrouptype:D
@@ -6124,7 +6153,7 @@
\gtl_clear:N \l_@@_after_group_gtl
}
{ \tl_use:N \l_@@_head_tl \scan_stop: }
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
{ 15 }
{ % todo: this is a TeX error
@@ -6200,7 +6229,7 @@
\tl_use:N \l_@@_head_tl \c_group_begin_token
\gtl_clear:N \l_@@_after_group_gtl
\int_set:Nn \l_@@_choice_int { 1 }
- \@@_print_action:x
+ \@@_print_action:e
{ \tl_to_str:N \l_@@_head_tl \iow_char:N \{ }
}
% \end{macrocode}
@@ -6245,7 +6274,7 @@
\cs_new_protected:Npn \@@_case_shift:Nn #1#2
{
#1 { \@@_back_input:n {#2} }
- \@@_print_action:x
+ \@@_print_action:e
{ \token_to_meaning:N #1 ~ \tl_to_str:n { {#2} } }
}
% \end{macrocode}
@@ -6258,7 +6287,7 @@
\@@_scan_toks_to_str:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -6271,7 +6300,7 @@
\@@_scan_extension_operands:
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -6289,7 +6318,7 @@
{ \@@_scan_int: }
\@@_prev_input_gpop:N \l_@@_head_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -6362,7 +6391,7 @@
\@@_new_tex_cmd:nn { math_given } % 69
{
\@@_mode_math:n
- { \@@_mathchar:x { \int_use:N \l_@@_head_char_int } }
+ { \@@_mathchar:e { \int_use:N \l_@@_head_char_int } }
}
% \end{macrocode}
%
@@ -6683,7 +6712,7 @@
{
\@@_back_input:
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl ignored }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl ignored }
\@@_prev_input_gpush:
}
@@ -6780,7 +6809,7 @@
> { \@@_tex_use:n { max_non_prefixed_command } }
{
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \@@_error:nxxxx { erroneous-prefixes }
+ \@@_error:neeee { erroneous-prefixes }
{ \tl_to_str:N \l_@@_tmpa_tl }
{ \tl_to_str:N l_@@_head_tl }
{ } { }
@@ -6859,7 +6888,7 @@
\tl_if_empty:nF {#1}
{
\@@_prev_input_gpush:N \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
#1
\@@_prev_input_gpop:N \l_@@_head_tl
}
@@ -6955,20 +6984,37 @@
}
% \end{macrocode}
%
+% This is a variant of \cs{@@_assign_value:nn}, with a bit more complication
+% because the syntax of \tn{parshape} and of \eTeX{} primitives such as
+% \tn{interlinepenalties} is a bit different.
% \begin{macrocode}
\@@_prefixed_new:nn { set_shape } % 84
{
- \@@_assign_value:nn { \@@_scan_int: }
+ \@@_prev_input:V \l_@@_head_tl
+ \tl_set_eq:NN \l_@@_defined_tl \l_@@_head_tl
+ \tl_if_head_eq_meaning:VNTF \l_@@_defined_tl \tex_parshape:D
{
- \prg_replicate:nn
- {
- \tl_if_head_eq_meaning:VNT
- \l_@@_defined_tl \tex_parshape:D { 2 * }
- \tl_tail:N \l_@@_defined_tl
- }
- { \@@_scan_int: }
+ \@@_set_shape:NN 2 \@@_scan_normal_dimen:
+ \@@_print_assigned_parshape:
+ }
+ {
+ \@@_set_shape:NN 1 \@@_scan_int:
+ \@@_print_assigned_set_shape:
}
}
+\cs_new_protected:Npn \@@_set_shape:NN #1#2
+ {
+ \@@_scan_optional_equals:
+ \@@_prev_input_gpush:
+ \@@_scan_int:
+ \@@_prev_input_gpop:N \l_@@_tmpa_tl
+ \@@_prev_input_silent:V \l_@@_tmpa_tl
+ \prg_replicate:nn
+ { \int_max:nn { 0 } { #1 * \l_@@_tmpa_tl } }
+ { \@@_prev_input_silent:n { ~ } #2 }
+ \@@_prev_input_gpop:N \l_@@_tmpa_tl
+ \tl_use:N \l_@@_tmpa_tl \scan_stop:
+ }
% \end{macrocode}
%
% \begin{macrocode}
@@ -6993,9 +7039,9 @@
\@@_prefixed_new:nn { def_font } % 88
{
\@@_prev_input_silent:V \l_@@_head_tl
- \@@_set_action_text:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_set_action_text:e { \tl_to_str:N \l_@@_head_tl }
\@@_scan_r_token:
- \@@_print_action:x
+ \@@_print_action:e
{ \g_@@_action_text_str \tl_to_str:N \l_@@_defined_tl }
\@@_scan_optional_equals:
\@@_scan_file_name:
@@ -7024,7 +7070,7 @@
{ % |let|
\@@_scan_r_token:
\@@_prev_input_get:N \l_@@_tmpa_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_tmpa_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_tmpa_tl }
\@@_get_next:
\bool_while_do:nn
{ \token_if_eq_catcode_p:NN \l_@@_head_token \c_space_token }
@@ -7037,7 +7083,7 @@
{ % |futurelet|
\@@_scan_r_token:
\@@_prev_input_get:N \l_@@_tmpa_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_tmpa_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_tmpa_tl }
\@@_get_next:
\gtl_set_eq:NN \l_@@_tmpb_gtl \l_@@_head_gtl
\@@_get_next:
@@ -7048,7 +7094,7 @@
\@@_prev_input_gpop:N \l_@@_tmpa_tl
\tl_put_right:Nn \l_@@_tmpa_tl { = ~ \l_@@_head_token }
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_exp_args:Nx \use:n
+ \use:e
{
\exp_not:V \l_@@_head_tl
\tex_let:D \tl_tail:N \l_@@_tmpa_tl
@@ -7061,10 +7107,10 @@
\@@_prefixed_new:nn { shorthand_def } % 95
{
\@@_prev_input_silent:V \l_@@_head_tl
- \tl_set:Nx \l_@@_prev_action_tl
+ \tl_set:Ne \l_@@_prev_action_tl
{ \tl_to_str:N \l_@@_head_tl }
\@@_scan_r_token:
- \@@_print_action:x
+ \@@_print_action:e
{ \l_@@_prev_action_tl \tl_to_str:N \l_@@_defined_tl }
\exp_after:wN \cs_set_eq:NN \l_@@_defined_tl \scan_stop:
\@@_just_print_assigned_token:
@@ -7087,7 +7133,7 @@
\@@_prefixed_new:nn { read_to_cs } % 96
{
\@@_prev_input_silent:V \l_@@_head_tl
- \@@_print_action:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_action:e { \tl_to_str:N \l_@@_head_tl }
\@@_scan_int:
\@@_scan_to:
\@@_scan_r_token:
@@ -7186,7 +7232,7 @@
\@@_prev_input_gpop:N \l_@@_tmpa_tl
\tl_put_left:NV \l_@@_head_tl \l_@@_tmpa_tl
\tl_use:N \l_@@_head_tl \scan_stop:
- \@@_print_assignment:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_assignment:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
%
@@ -7194,9 +7240,9 @@
\@@_prefixed_new:nn { letterspace_font } % 101
{
\@@_prev_input_silent:V \l_@@_head_tl
- \@@_set_action_text:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_set_action_text:e { \tl_to_str:N \l_@@_head_tl }
\@@_scan_r_token:
- \@@_print_action:x
+ \@@_print_action:e
{ \g_@@_action_text_str \tl_to_str:N \l_@@_defined_tl }
\exp_after:wN \cs_set_eq:NN \l_@@_defined_tl \@@_nullfont:
\@@_just_print_assigned_token:
@@ -7211,9 +7257,9 @@
\@@_prefixed_new:nn { pdf_copy_font } % 102
{
\@@_prev_input_silent:V \l_@@_head_tl
- \@@_set_action_text:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_set_action_text:e { \tl_to_str:N \l_@@_head_tl }
\@@_scan_r_token:
- \@@_print_action:x
+ \@@_print_action:e
{ \g_@@_action_text_str \tl_to_str:N \l_@@_defined_tl }
\exp_after:wN \cs_set_eq:NN \l_@@_defined_tl \@@_nullfont:
\@@_just_print_assigned_token:
@@ -7327,7 +7373,7 @@
{ 3 } { \@@_scan_normal_glue: } % glue
{ 4 } { \@@_scan_mu_glue: } % muglue
}
- { \@@_error:nxxxx { internal } { do-reg=#2 } { } { } { } }
+ { \@@_error:neeee { internal } { do-reg=#2 } { } { } { } }
}
{ \@@_scan_int: }
\@@_assign_register:
@@ -7384,7 +7430,7 @@
% \tn{pdffiledump}, \tn{pdfmatch}, \tn{pdflastmatch},
% \tn{pdfuniformdeviate}, \tn{pdfnormaldeviate}, \tn{pdfinsertht},
% \tn{pdfximagebbox}, \tn{jobname}, \tn{expanded}, and in
-% \LuaTeX{} \tn{directlua}, \tn{luaescapestring}, and in \XeTeX{} \tn{Ucharcat}.
+% \LuaTeX{} \tn{directlua}, \tn{luaescapestring}, and in \XeTeX{}/(u)p\TeX{} \tn{Ucharcat}.
% \item |the=111| for \tn{the}, \tn{unexpanded}, and \tn{detokenize}.
% \item |top_bot_mark=112| \tn{topmark}, \tn{firstmark}, \tn{botmark},
% \tn{splitfirstmark}, \tn{splitbotmark}, \tn{topmarks},
@@ -7414,13 +7460,13 @@
\gtl_concat:NNN \l_@@_head_gtl
\l_@@_tmpb_gtl \l_@@_head_gtl
\@@_prev_input_gpush_gtl:N \l_@@_head_gtl
- \@@_print_expansion:x { \gtl_to_str:N \l_@@_head_gtl }
+ \@@_print_expansion:e { \gtl_to_str:N \l_@@_head_gtl }
\@@_get_next:
\@@_token_if_expandable:NTF \l_@@_head_token
{ \@@_expand_do:N \prg_do_nothing: }
{ \@@_back_input: }
\@@_prev_input_gpop_gtl:N \l_@@_head_gtl
- \@@_set_action_text:x
+ \@@_set_action_text:e
{ back_input: ~ \gtl_to_str:N \l_@@_head_gtl }
\gtl_pop_left:N \l_@@_head_gtl
\@@_back_input:
@@ -7428,6 +7474,7 @@
}
\cs_new_protected:Npn \@@_unless:
{
+ \gtl_set_eq:NN \l_@@_tmpb_gtl \l_@@_head_gtl
\@@_get_token:
\int_compare:nNnTF
\l_@@_head_cmd_int = { \@@_tex_use:n { if_test } }
@@ -7435,8 +7482,8 @@
\token_if_eq_meaning:NNTF \l_@@_head_token \tex_ifcase:D
{ \@@_unless_bad: }
{
- \tl_put_left:Nn \l_@@_head_tl { \reverse_if:N }
- % \int_add:Nn \l_@@_head_char_int { 32 }
+ \tl_put_left:Ne \l_@@_head_tl
+ { \gtl_head_do:NN \l_@@_tmpb_gtl \exp_not:N }
\@@_expand_nonmacro:
}
}
@@ -7546,19 +7593,21 @@
\@@_prev_input_gpush:
\@@_scan_toks:NN \c_false_bool \c_false_bool
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \tl_set_rescan:Nno \l_@@_head_tl { } \l_@@_tmpa_tl
+ \exp_last_unbraced:NNNo \tl_set_rescan:Nnn
+ \l_@@_head_tl \prg_do_nothing: \l_@@_tmpa_tl
+ \@@_back_input:V \@@_everyeof:w
\@@_back_input:V \l_@@_head_tl
- \@@_print_expansion:x { \tl_to_str:N \l_@@_tmpa_tl }
+ \@@_print_expansion:e { \tl_to_str:N \l_@@_tmpa_tl }
}
\cs_new_protected:Npn \@@_input:
{
\@@_prev_input_gpush:N \l_@@_head_tl
\@@_scan_file_name:
\@@_prev_input_gpop:N \l_@@_head_tl
- \tl_set:Nx \l_@@_tmpa_tl { \tl_tail:N \l_@@_head_tl }
+ \tl_set:Ne \l_@@_tmpa_tl { \tl_tail:N \l_@@_head_tl }
\@@_file_get:nN \l_@@_tmpa_tl \l_@@_tmpa_tl
\@@_back_input:V \l_@@_tmpa_tl
- \@@_print_expansion:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_expansion:e { \tl_to_str:N \l_@@_head_tl }
}
% \end{macrocode}
% \end{macro}
@@ -7579,7 +7628,7 @@
}
{
\@@_back_input:V \g_@@_lastnamedcs_tl
- \@@_print_expansion:x
+ \@@_print_expansion:e
{ \tl_to_str:N \l_@@_head_tl = \tl_to_str:N \g_@@_lastnamedcs_tl }
}
}
@@ -7596,7 +7645,7 @@
}
}
{
- \@@_prev_input_silent:x
+ \@@_prev_input_silent:e
{ \@@_token_to_char:N \l_@@_head_token }
\@@_csname_loop:
}
@@ -7606,9 +7655,11 @@
\group_begin:
\@@_prev_input_get:N \l_@@_head_tl
\tl_gset:No \g_@@_lastnamedcs_tl
- { \cs:w \exp_after:wN \use_none:n \l_@@_head_tl }
+ { \cs:w \exp_after:wN \@@_get_lastnamedcs_check:N \l_@@_head_tl }
\group_end:
}
+\cs_new:Npn \@@_get_lastnamedcs_check:N #1
+ { \if_meaning:w \reverse_if:N #1 \use_i:nn \fi: }
% \end{macrocode}
% \end{macro}
%
@@ -7667,7 +7718,7 @@
{
\@@_get_next:
\tl_if_empty:NTF \l_@@_head_tl
- { \@@_prev_input:x { \gtl_to_str:N \l_@@_head_gtl } }
+ { \@@_prev_input:e { \gtl_to_str:N \l_@@_head_gtl } }
{ \@@_prev_input:V \l_@@_head_tl }
}
\cs_new_protected:Npn \@@_convert_meaning:w
@@ -7680,11 +7731,11 @@
\@@_prev_input_gpop:N \l_@@_prev_input_tl
\exp_args:NNV \gtl_put_left:Nn \l_@@_tmpb_gtl \l_@@_prev_input_tl
\@@_prev_input_gpush_gtl:N \l_@@_tmpb_gtl
- \@@_print_action:x { \gtl_to_str:N \l_@@_tmpb_gtl }
+ \@@_print_action:e { \gtl_to_str:N \l_@@_tmpb_gtl }
\@@_prev_input_gpop_gtl:N \l_@@_tmpb_gtl
- \tl_set:Nx \l_@@_tmpa_tl { \gtl_head_do:NN \l_@@_head_gtl \tex_meaning:D }
+ \tl_set:Ne \l_@@_tmpa_tl { \gtl_head_do:NN \l_@@_head_gtl \tex_meaning:D }
\@@_back_input:V \l_@@_tmpa_tl
- \@@_print_expansion:x
+ \@@_print_expansion:e
{ \gtl_to_str:N \l_@@_tmpb_gtl = \tl_to_str:N \l_@@_tmpa_tl }
}
{
@@ -7754,34 +7805,34 @@
{ % \unexpanded, \detokenize
\@@_scan_toks:NN \c_false_bool \c_false_bool
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_set_action_text:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_set_action_text:e { \tl_to_str:N \l_@@_head_tl }
}
{ % \the
\@@_get_x_next:
\@@_rescan_something_internal:n { 5 }
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_set_action_text:x
+ \@@_set_action_text:e
{
\tl_head:N \l_@@_head_tl
=> \tl_tail:N \l_@@_head_tl
}
- \tl_set:Nx \l_@@_head_tl
+ \tl_set:Ne \l_@@_head_tl
{ \exp_not:N \exp_not:n { \tl_tail:N \l_@@_head_tl } }
}
\cs_if_eq:NNTF #1 \@@_get_token_xdef:
{
\tl_put_right:NV \l_@@_defining_tl \l_@@_head_tl
- \@@_prev_input_silent:x { \l_@@_head_tl }
+ \@@_prev_input_silent:e { \l_@@_head_tl }
\@@_print_action:
}
{
\cs_if_eq:NNTF #1 \@@_get_token_x:
{
- \@@_exp_args:NNx \gtl_set:Nn \l_@@_tmpb_gtl { \l_@@_head_tl }
+ \exp_args:NNe \gtl_set:Nn \l_@@_tmpb_gtl { \l_@@_head_tl }
\@@_prev_input_gtl:N \l_@@_tmpb_gtl
}
{
- \tl_set:Nx \l_@@_tmpa_tl { \exp_args:NV \exp_not:o \l_@@_head_tl }
+ \tl_set:Ne \l_@@_tmpa_tl { \exp_args:NV \exp_not:o \l_@@_head_tl }
\@@_back_input:V \l_@@_tmpa_tl
}
\@@_print_expansion:
@@ -7894,7 +7945,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_cond_push:
{
- \tl_gput_left:Nx \g_@@_if_limit_tl
+ \tl_gput_left:Ne \g_@@_if_limit_tl
{ { \int_use:N \g_@@_if_limit_int } }
\int_gincr:N \g_@@_if_depth_int
\int_gzero:N \g_@@_if_limit_int
@@ -7904,7 +7955,7 @@
\fi:
\int_gset:Nn \g_@@_if_limit_int
{ \tl_head:N \g_@@_if_limit_tl }
- \tl_gset:Nx \g_@@_if_limit_tl
+ \tl_gset:Ne \g_@@_if_limit_tl
{ \tl_tail:N \g_@@_if_limit_tl }
\int_gdecr:N \g_@@_if_depth_int
}
@@ -7921,12 +7972,12 @@
\tl_clear:N \l_@@_tmpa_tl
\prg_replicate:nn { \g_@@_if_depth_int - #2 - 1 }
{
- \tl_put_right:Nx \l_@@_tmpa_tl
+ \tl_put_right:Ne \l_@@_tmpa_tl
{ { \tl_head:N \g_@@_if_limit_tl } }
- \tl_gset:Nx \g_@@_if_limit_tl
+ \tl_gset:Ne \g_@@_if_limit_tl
{ \tl_tail:N \g_@@_if_limit_tl }
}
- \tl_gset:Nx \g_@@_if_limit_tl
+ \tl_gset:Ne \g_@@_if_limit_tl
{ \l_@@_tmpa_tl {#1} \tl_tail:N \g_@@_if_limit_tl }
}
}
@@ -7980,7 +8031,7 @@
{ 24 } { \@@_scan_font_ident: } % ifjfont, iftfont
}
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_set_action_text:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_set_action_text:e { \tl_to_str:N \l_@@_head_tl }
\l_@@_head_tl \scan_stop:
\@@_cond_true:NNNn
\else:
@@ -7997,7 +8048,7 @@
\cs_new_protected:Npn \@@_cond_true:NNNn #1#2#3#4
{
\@@_change_if_limit:nn { 3 } {#4} % wait for else/fi
- \@@_print_expansion:x { \g_@@_action_text_str = true }
+ \@@_print_expansion:e { \g_@@_action_text_str = true }
}
% \end{macrocode}
% \end{macro}
@@ -8009,7 +8060,7 @@
{
\@@_cond_false_loop:n {#2}
\@@_cond_false_common:
- \@@_print_expansion:x
+ \@@_print_expansion:e
{
\g_@@_action_text_str = false ~
=> ~ skip ~ to ~ \tl_to_str:N \l_@@_head_tl
@@ -8069,7 +8120,7 @@
\@@_test_two_chars_get:n {#1}
\@@_test_two_chars_get:n {#1}
\@@_prev_input_gpop_gtl:N \l_@@_head_gtl
- \@@_set_action_text:x { \gtl_to_str:N \l_@@_head_gtl }
+ \@@_set_action_text:e { \gtl_to_str:N \l_@@_head_gtl }
\gtl_pop_left_item:NNTF \l_@@_head_gtl \l_@@_head_tl { } { }
\exp_args:No \tl_if_head_eq_meaning:nNT \l_@@_head_tl \reverse_if:N
{
@@ -8091,14 +8142,14 @@
\int_compare:nNnT {#1} = 0
{
\gtl_if_head_is_N_type:NF \l_@@_head_gtl
- { \gtl_set:Nx \l_@@_head_gtl { \gtl_to_str:N \l_@@_head_gtl } }
+ { \gtl_set:Ne \l_@@_head_gtl { \gtl_to_str:N \l_@@_head_gtl } }
}
\@@_prev_input_gtl:N \l_@@_head_gtl
- \@@_print_action:x { \gtl_to_str:N \l_@@_head_gtl }
+ \@@_print_action:e { \gtl_to_str:N \l_@@_head_gtl }
}
\cs_new_protected:Npn \@@_test_two_chars_gtl:N #1
{
- \tl_put_right:Nx \l_@@_head_tl
+ \tl_put_right:Ne \l_@@_head_tl
{
\gtl_if_head_is_group_begin:NTF #1 { \c_group_begin_token }
{
@@ -8136,7 +8187,7 @@
\cs_set_eq:NN \l_@@_tmpb_token \l_@@_head_token
\@@_get_next:
\@@_prev_input_gpop:N \l_@@_tmpa_tl
- \@@_set_action_text:x
+ \@@_set_action_text:e
{
Compare:~ \tl_to_str:N \l_@@_tmpa_tl
\@@_test_ifx_str:NN \l_@@_tmpb_token \l_@@_tmpb_gtl
@@ -8184,7 +8235,7 @@
\bool_if:NT \g_@@_internal_debug_bool { \iow_term:n { {\ifcase level~#1} } }
\@@_scan_int:
\@@_prev_input_get:N \l_@@_head_tl
- \tl_set:Nx \l_@@_head_tl { \tl_tail:N \l_@@_head_tl }
+ \tl_set:Ne \l_@@_head_tl { \tl_tail:N \l_@@_head_tl }
% ^^A does text_case_aux use prev_input_seq?
\int_compare:nNnF { \l_@@_head_tl } = 0
{
@@ -8194,7 +8245,7 @@
}
\exp_args:No \@@_test_case_aux:nn { \l_@@_head_tl } {#1}
\@@_prev_input_gpop:N \l_@@_head_tl
- \@@_print_expansion:x { \tl_to_str:N \l_@@_head_tl }
+ \@@_print_expansion:e { \tl_to_str:N \l_@@_head_tl }
}
\cs_new_protected:Npn \@@_test_case_aux:nn #1#2
{
@@ -8243,12 +8294,12 @@
{ \@@_pass_text_empty: }
{
\@@_input_gpop:N \l_@@_tmpb_gtl
- \@@_set_action_text:x
+ \@@_set_action_text:e
{
Conditional:~ \tl_to_str:N \l_@@_head_tl
\gtl_to_str:N \l_@@_tmpb_gtl
}
- \@@_prev_input:x
+ \@@_prev_input:e
{
\gtl_if_tl:NTF \l_@@_tmpb_gtl
{ \gtl_head:N \l_@@_tmpb_gtl }
@@ -8288,7 +8339,7 @@
\int_compare:nNnF \l_@@_head_char_int = 2
{
\@@_fi_or_else_loop:
- \@@_set_action_text:x
+ \@@_set_action_text:e
{
\g_@@_action_text_str \c_space_tl
=> ~ skip ~ to ~ \tl_to_str:N \l_@@_head_tl
@@ -8326,7 +8377,7 @@
\tl_new:N \l_@@_print_tl
\sys_if_engine_luatex:TF
{
- \cs_new_protected:Npx \@@_print_normalize_null:
+ \cs_new_protected:Npe \@@_print_normalize_null:
{
\tl_replace_all:Nnn \exp_not:N \l_@@_print_tl
{ \char_generate:nn { 0 } { 12 } }
@@ -8338,21 +8389,40 @@
% \end{variable}
% \end{macro}
%
-% \begin{macro}{\@@_print:n, \@@_print:x, \@@_log:n}
+% \begin{macro}{\@@_print:n, \@@_print:e, \@@_log:n}
% \begin{macrocode}
\cs_new_protected:Npn \@@_print:n #1
{
\tl_set:Nn \l_@@_print_tl {#1}
\@@_print_normalize_null:
- \@@_exp_args:Nx \iow_term:n { \l_@@_print_tl }
+ \iow_term:e { \l_@@_print_tl }
+ \tl_if_empty:NF \g_@@_output_file_tl
+ { \iow_now:Ne \g_@@_iow { \l_@@_print_tl } }
}
-\cs_new_protected:Npn \@@_print:x
- { \@@_exp_args:Nx \@@_print:n }
+\cs_generate_variant:Nn \@@_print:n { e }
\cs_new_protected:Npn \@@_log:n #1
{
\tl_set:Nn \l_@@_print_tl {#1}
\@@_print_normalize_null:
- \@@_exp_args:Nx \iow_log:n { \l_@@_print_tl }
+ \tl_if_empty:NTF \g_@@_output_file_tl
+ { \iow_log:e { \l_@@_print_tl } }
+ { \iow_now:Ne \g_@@_iow { \l_@@_print_tl } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@_print_step:n}
+% Steps are printed or not according to the option value, unaffected
+% by a prompt such as |s10|.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_print_step:n #1
+ {
+ \int_compare:nNnF \g_@@_online_int < 0
+ {
+ \int_compare:nNnTF \g_@@_online_int = 0
+ { \@@_log:n {#1} }
+ { \@@_print:n {#1} }
+ }
}
% \end{macrocode}
% \end{macro}
@@ -8361,13 +8431,14 @@
% The message to be printed should come already detokenized, as~|#2|.
% It will be wrapped to 80 characters per line, with~|#1| before each
% line. The message is properly suppressed (or sent only to the log)
-% according to \cs{g_@@_online_int}.
+% according to \cs{g_@@_current_online_int} so as to be sensitive to
+% the prompt.
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_message:nn #1 #2
{
- \int_compare:nNnF \g_@@_online_int < 0
+ \int_compare:nNnF \g_@@_current_online_int < 0
{
- \int_compare:nNnTF \g_@@_online_int = 0
+ \int_compare:nNnTF \g_@@_current_online_int = 0
{ \iow_wrap:nnnN { #1 #2 } { #1 } { } \@@_log:n }
{ \iow_wrap:nnnN { #1 #2 } { #1 } { } \@@_print:n }
}
@@ -8375,13 +8446,13 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_set_action_text:x}
+% \begin{macro}{\@@_set_action_text:e}
% \begin{macrocode}
-\cs_new_protected:Npn \@@_set_action_text:x #1
+\cs_new_protected:Npn \@@_set_action_text:e #1
{
\group_begin:
\@@_set_escapechar:n { 92 }
- \str_gset:Nx \g_@@_action_text_str {#1}
+ \str_gset:Ne \g_@@_action_text_str {#1}
\group_end:
}
% \end{macrocode}
@@ -8391,7 +8462,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_set_action_text:
{
- \@@_set_action_text:x
+ \@@_set_action_text:e
{
\tl_to_str:N \l_@@_head_tl
\tl_if_single_token:VT \l_@@_head_tl
@@ -8408,7 +8479,7 @@
\group_begin:
\@@_set_escapechar:n { 92 }
\tl_use:N \g_@@_before_print_state_tl
- \int_compare:nNnT \g_@@_online_int > 0
+ \int_compare:nNnF \g_@@_current_online_int < 0
{
\@@_print_state_output:
\@@_print_state_prev:
@@ -8426,14 +8497,14 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_state_output:
{
- \@@_exp_args:Nx \@@_print_state_output:n
+ \exp_args:Ne \@@_print_state_output:n
{ \gtl_to_str:N \g_@@_output_gtl }
}
\cs_new_protected:Npn \@@_print_state_output:n #1
{
\tl_if_empty:nF {#1}
{
- \@@_print_message:nn { <| ~ }
+ \@@_print_message:nn { <| ~ } % |
{ \@@_str_truncate_left:nn {#1} { \g_@@_max_output_int } }
}
}
@@ -8445,7 +8516,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_state_prev:
{
- \seq_set_map_x:NNn \l_@@_tmpa_seq \g_@@_prev_input_seq
+ \seq_set_map_e:NNn \l_@@_tmpa_seq \g_@@_prev_input_seq
{ \@@_to_str:Nn ##1 }
\seq_remove_all:Nn \l_@@_tmpa_seq { }
\seq_if_empty:NTF \l_@@_tmpa_seq
@@ -8467,12 +8538,12 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_state_input:
{
- \@@_exp_args:Nx \@@_print_state_input:n
+ \exp_args:Ne \@@_print_state_input:n
{ \@@_input_to_str: }
}
\cs_new_protected:Npn \@@_print_state_input:n #1
{
- \@@_print_message:nn { |> ~ }
+ \@@_print_message:nn { |> ~ } % |
{ \@@_str_truncate_right:nn {#1} { \g_@@_max_input_int } }
}
% \end{macrocode}
@@ -8496,29 +8567,29 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_print_action:, \@@_print_action:x, \@@_print_assignment:, \@@_print_assignment:x, \@@_print_expansion:, \@@_print_expansion:x, \@@_print_action_aux:N}
+% \begin{macro}{\@@_print_action:, \@@_print_action:e, \@@_print_assignment:, \@@_print_assignment:e, \@@_print_expansion:, \@@_print_expansion:e, \@@_print_action_aux:N}
% Some of these commands are currently synonyms but we may decide to
% make some options act differently on them.
% \begin{macrocode}
\cs_new_protected:Npn \@@_print_action:
{ \@@_print_action_aux:N \g_@@_trace_other_bool }
-\cs_new_protected:Npn \@@_print_action:x #1
+\cs_new_protected:Npn \@@_print_action:e #1
{
- \@@_set_action_text:x {#1}
+ \@@_set_action_text:e {#1}
\@@_print_action:
}
\cs_new_protected:Npn \@@_print_assignment:
{ \@@_print_action_aux:N \g_@@_trace_assigns_bool }
-\cs_new_protected:Npn \@@_print_assignment:x #1
+\cs_new_protected:Npn \@@_print_assignment:e #1
{
- \@@_set_action_text:x {#1}
+ \@@_set_action_text:e {#1}
\@@_print_assignment:
}
\cs_new_protected:Npn \@@_print_expansion:
{ \@@_print_action_aux:N \g_@@_trace_expansion_bool }
-\cs_new_protected:Npn \@@_print_expansion:x #1
+\cs_new_protected:Npn \@@_print_expansion:e #1
{
- \@@_set_action_text:x {#1}
+ \@@_set_action_text:e {#1}
\@@_print_expansion:
}
\cs_new_protected:Npn \@@_print_action_aux:N #1
@@ -8527,7 +8598,7 @@
\int_gincr:N \g_@@_step_int
\bool_if:NT #1
{
- \@@_print:x
+ \exp_args:Ne \@@_print_step:n
{
[=====
\bool_if:NT \g_@@_number_steps_bool
@@ -8549,11 +8620,12 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_just_print_assigned_token:, \@@_print_assigned_token:, \@@_print_assigned_register:}
+% \begin{macro}{\@@_just_print_assigned_token:, \@@_print_assigned_token:, \@@_print_assigned_register:, \@@_print_assigned_parshape:, \@@_print_assigned_set_shape:}
+% \begin{macro}[EXP]{\@@_print_assigned_set_shape_aux:n}
% \begin{macrocode}
\cs_new_protected:Npn \@@_just_print_assigned_token:
{
- \@@_print_assignment:x
+ \@@_print_assignment:e
{
Set~ \exp_after:wN \token_to_str:N \l_@@_defined_tl
= \exp_after:wN \token_to_meaning:N \l_@@_defined_tl
@@ -8565,23 +8637,52 @@
\@@_just_print_assigned_token:
\@@_omit_after_assignment:w
}
+\cs_new:Npn \@@_print_assigned_aux_name:
+ {
+ Set~ \exp_after:wN \token_to_str:N \l_@@_defined_tl
+ \tl_if_single:NT \l_@@_defined_tl
+ { ( \exp_after:wN \token_to_meaning:N \l_@@_defined_tl ) }
+ }
\cs_new_protected:Npn \@@_print_assigned_register:
{
\@@_after_assignment:
- \@@_exp_args:Nx \@@_print_assignment:x
+ \exp_args:Ne \@@_print_assignment:e % needed to stringify a \toks
{
- \exp_not:n
- {
- Set~ \exp_after:wN \token_to_str:N \l_@@_defined_tl
- \tl_if_single:NT \l_@@_defined_tl
- { ( \exp_after:wN \token_to_meaning:N \l_@@_defined_tl ) }
- }
+ \exp_not:N \@@_print_assigned_aux_name:
= \exp_not:N \tl_to_str:n { \@@_the:w \l_@@_defined_tl }
}
\@@_omit_after_assignment:w
}
+\cs_new_protected:Npn \@@_print_assigned_parshape:
+ {
+ \@@_after_assignment:
+ \tl_set:Nn \l_@@_tmpa_tl { \tex_parshapedimen:D }
+ \@@_print_assignment:e
+ {
+ \@@_print_assigned_aux_name: = \@@_the:w \l_@@_defined_tl
+ \int_step_function:nN { 2 * \l_@@_defined_tl }
+ \@@_print_assigned_set_shape_aux:n
+ }
+ \@@_omit_after_assignment:w
+ }
+\cs_new_protected:Npn \@@_print_assigned_set_shape:
+ {
+ \@@_after_assignment:
+ \tl_set_eq:NN \l_@@_tmpa_tl \l_@@_defined_tl
+ \@@_print_assignment:e
+ {
+ \@@_print_assigned_aux_name:
+ = \@@_the:w \l_@@_defined_tl 0 \exp_stop_f:
+ \int_step_function:nN { \l_@@_defined_tl 0 }
+ \@@_print_assigned_set_shape_aux:n
+ }
+ \@@_omit_after_assignment:w
+ }
+\cs_new:Npn \@@_print_assigned_set_shape_aux:n #1
+ { ~ \@@_the:w \l_@@_tmpa_tl #1 \exp_stop_f: }
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@_print_welcome:}
% Welcome message.
@@ -8659,7 +8760,7 @@
\clist_gpop:NN \g_@@_prompt_input_clist \l_@@_tmpa_tl
\group_begin:
\@@_set_escapechar:n { 92 }
- \@@_print:x
+ \@@_print:e
{
\bool_if:NT \g_@@_explicit_prompt_bool { Your~input= }
\tl_to_str:N \l_@@_tmpa_tl
@@ -8672,12 +8773,12 @@
{
\tl_if_empty:nF {#1}
{
- \@@_exp_args:Nx \str_case:nnF { \tl_head:n {#1} }
+ \str_case:enF { \tl_head:n {#1} }
{
{ m } { \@@_print_meaning: \@@_prompt_aux: }
{ q }
{
- \int_gset:Nn \g_@@_online_int { -1 }
+ \int_gset:Nn \g_@@_current_online_int { -1 }
\int_gzero:N \g_@@_nonstop_int
}
{ x }
@@ -8693,10 +8794,10 @@
{ s } { \@@_prompt_scan_int:nn {#1}
\@@_prompt_silent_steps:n }
{ o } { \@@_prompt_scan_int:nn {#1}
- { \int_gset:Nn \g_@@_online_int } }
+ { \int_gset:Nn \g_@@_current_online_int } }
{ C }
{
- \@@_exp_args:Nx \use:n
+ \use:e
{
\tl_gset_rescan:Nnn \exp_not:N \g_@@_tmpc_tl
{ \exp_not:N \ExplSyntaxOn } { \tl_tail:n {#1} }
@@ -8706,7 +8807,8 @@
\group_insert_after:N \g_@@_tmpc_tl
\group_insert_after:N \@@_prompt:
}
- { | } { \@@_prompt_scan_int:nn {#1}
+ { | } % |
+ { \@@_prompt_scan_int:nn {#1}
\@@_prompt_vert:n }
{ u } { \@@_prompt_until:n {#1} }
{ a } { \@@_prompt_all: }
@@ -8744,10 +8846,10 @@
{
\int_compare:nNnF {#1} < 0
{
- \int_gset:Nn \g_@@_online_int { -1 }
+ \int_gset:Nn \g_@@_current_online_int { -1 }
\tl_gset:Nn \g_@@_before_prompt_tl
{
- \int_gset:Nn \g_@@_online_int { 1 }
+ \int_gset_eq:NN \g_@@_current_online_int \g_@@_online_int
\tl_gclear:N \g_@@_before_prompt_tl
}
\int_gset:Nn \g_@@_nonstop_int {#1}
@@ -8761,7 +8863,7 @@
}
\cs_new_protected:Npn \@@_prompt_vert:Nn #1#2
{
- \int_gset:Nn \g_@@_online_int { -1 }
+ \int_gset:Nn \g_@@_current_online_int { -1 }
\tl_gset:Nf \g_@@_before_print_state_tl
{
\exp_args:NNf \exp_stop_f: \int_compare:nNnTF
@@ -8772,14 +8874,14 @@
{ \int_max:nn { \g_@@_nonstop_int } { 2 } }
}
{
- \int_gset:Nn \g_@@_online_int { 1 }
+ \int_gset_eq:NN \g_@@_current_online_int \g_@@_online_int
\tl_gclear:N \g_@@_before_print_state_tl
}
}
}
\cs_new_protected:Npn \@@_prompt_all:
{
- \tl_gset:Nx \g_@@_tmpc_tl
+ \tl_gset:Ne \g_@@_tmpc_tl
{
\exp_not:n
{
@@ -8808,12 +8910,12 @@
\tl_new:N \g_@@_until_tl
\cs_new_protected:Npn \@@_prompt_until:n #1
{
- \tl_gset:Nx \g_@@_until_tl { \tl_tail:n {#1} }
- \int_gset:Nn \g_@@_online_int { -1 }
+ \tl_gset:Ne \g_@@_until_tl { \tl_tail:n {#1} }
+ \int_gset:Nn \g_@@_current_online_int { -1 }
\tl_gset:Nn \g_@@_before_print_state_tl
{
\@@_input_get_left:N \l_@@_tmpa_tl
- \@@_exp_args:Nx \use:n
+ \use:e
{
\exp_not:N \tl_if_in:nnTF
{ \exp_not:N \@@:nn \tl_to_str:N \l_@@_tmpa_tl }
@@ -8821,7 +8923,7 @@
}
{
\int_gzero:N \g_@@_nonstop_int
- \int_gset:Nn \g_@@_online_int { 1 }
+ \int_gset_eq:NN \g_@@_current_online_int \g_@@_online_int
\tl_gclear:N \g_@@_before_print_state_tl
}
{
@@ -8843,7 +8945,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@@_error:nnnnn, \@@_error:nxxxx}
+% \begin{macro}{\@@_error:nnnnn, \@@_error:neeee}
% Errors within a group to make sure that none of the \pkg{l3msg}
% variables (or others) that may be currently in use in the code being
% debugged are modified.
@@ -8854,10 +8956,10 @@
\msg_error:nnnnnn { unravel } {#1} {#2} {#3} {#4} {#5}
\group_end:
}
-\cs_new_protected:Npn \@@_error:nxxxx #1#2#3#4#5
+\cs_new_protected:Npn \@@_error:neeee #1#2#3#4#5
{
\group_begin:
- \msg_error:nnxxxx { unravel } {#1} {#2} {#3} {#4} {#5}
+ \msg_error:nneeee { unravel } {#1} {#2} {#3} {#4} {#5}
\group_end:
}
% \end{macrocode}
@@ -8880,12 +8982,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tex_error:nn #1#2
{
- \group_begin:
- \msg_error:nnxxx { unravel } { tex-error }
+ \@@_error:neeee { tex-error }
{ \tl_to_str:n {#2} }
{ \use:c { @@_tex_msg_error_#1: } }
{ \use:c { @@_tex_msg_help_#1: } }
- \group_end:
+ { }
}
\cs_generate_variant:Nn \@@_tex_error:nn { nV }
% \end{macrocode}
@@ -8898,7 +8999,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tex_fatal_error:nn #1#2
{
- \@@_error:nxxxx { tex-fatal }
+ \@@_error:neeee { tex-fatal }
{ \tl_to_str:n {#2} }
{ \use:c { @@_tex_msg_error_#1: } }
{ \use:c { @@_tex_msg_help_#1: } }
@@ -8925,6 +9026,10 @@
max-input .int_gset:N = \g_@@_default_max_input_int ,
number-steps .bool_gset:N = \g_@@_default_number_steps_bool ,
online .int_gset:N = \g_@@_default_online_int ,
+ output-file .code:n = {
+ \int_gzero:N \g_@@_default_online_int
+ \tl_gset:Nn \g_@@_default_output_file_tl {#1}
+ } ,
prompt-input .code:n
= \@@_prompt_input:Nn \g_@@_default_prompt_input_clist {#1} ,
trace-assigns .bool_gset:N = \g_@@_default_trace_assigns_bool ,
@@ -8941,6 +9046,10 @@
max-input .int_gset:N = \g_@@_max_input_int ,
number-steps .bool_gset:N = \g_@@_number_steps_bool ,
online .int_gset:N = \g_@@_online_int ,
+ output-file .code:n = {
+ \int_gzero:N \g_@@_online_int
+ \tl_gset:Nn \g_@@_output_file_tl {#1}
+ } ,
prompt-input .code:n
= \@@_prompt_input:Nn \g_@@_prompt_input_clist {#1} ,
trace-assigns .bool_gset:N = \g_@@_trace_assigns_bool ,
@@ -9040,7 +9149,7 @@
\cs_new_protected:Npn \unravel_get:nnN #1#2#3
{
\unravel:nn {#1} {#2}
- \tl_set:Nx #3 { \gtl_left_tl:N \g_@@_output_gtl }
+ \tl_set:Ne #3 { \gtl_left_tl:N \g_@@_output_gtl }
}
% \end{macrocode}
% \end{macro}
@@ -9056,6 +9165,7 @@
\bool_gset_eq:NN \g_@@_internal_debug_bool \g_@@_default_internal_debug_bool
\bool_gset_eq:NN \g_@@_number_steps_bool \g_@@_default_number_steps_bool
\int_gset_eq:NN \g_@@_online_int \g_@@_default_online_int
+ \tl_gset_eq:NN \g_@@_output_file_tl \g_@@_default_output_file_tl
\clist_gset_eq:NN \g_@@_prompt_input_clist \g_@@_default_prompt_input_clist
\bool_gset_eq:NN \g_@@_trace_assigns_bool \g_@@_default_trace_assigns_bool
\bool_gset_eq:NN \g_@@_trace_expansion_bool \g_@@_default_trace_expansion_bool
@@ -9065,6 +9175,8 @@
\int_gset_eq:NN \g_@@_max_output_int \g_@@_default_max_output_int
\int_gset_eq:NN \g_@@_max_input_int \g_@@_default_max_input_int
\int_gzero:N \g_@@_nonstop_int
+ \tl_gclear:N \g_@@_before_print_state_tl
+ \tl_gclear:N \g_@@_before_prompt_tl
}
% \end{macrocode}
% \end{macro}
@@ -9076,6 +9188,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_init_vars:
{
+ \int_gset_eq:NN \g_@@_current_online_int \g_@@_online_int
+ \tl_if_eq:NNF \g_@@_output_file_tl \g_@@_current_output_file_tl
+ {
+ \iow_close:N \g_@@_iow
+ \iow_open:Nn \g_@@_iow \g_@@_output_file_tl
+ \tl_gset_eq:NN \g_@@_current_output_file_tl \g_@@_output_file_tl
+ }
\seq_gclear:N \g_@@_prev_input_seq
\gtl_gclear:N \g_@@_output_gtl
\int_gzero:N \g_@@_step_int
@@ -9125,10 +9244,10 @@
{
\@@_set_action_text:
\bool_if:NT \g_@@_internal_debug_bool
- { \@@_exp_args:Nx \iow_term:n { Cmd:~\int_to_arabic:n { \l_@@_head_cmd_int } } }
+ { \iow_term:e { Cmd:~\int_to_arabic:n { \l_@@_head_cmd_int } } }
\cs_if_exist_use:cF
{ @@_cmd_ \int_use:N \l_@@_head_cmd_int : }
- { \@@_error:nxxxx { internal } { unknown-command } { } { } { } }
+ { \@@_error:neeee { internal } { unknown-command } { } { } { } }
}
% \end{macrocode}
% \end{macro}
@@ -9161,12 +9280,12 @@
\cs_new_protected:Npn \@@_final_conditionals:
{
\group_begin:
- \msg_warning:nnx { unravel } { dangling-conditionals }
+ \msg_warning:nne { unravel } { dangling-conditionals }
{ \tl_count:N \g_@@_if_limit_tl }
\group_end:
\tl_greverse:N \g_@@_if_limit_tl
\tl_gput_right:NV \g_@@_if_limit_tl \g_@@_if_limit_int
- \tl_gset:Nx \g_@@_if_limit_tl { \tl_tail:N \g_@@_if_limit_tl } % remove the {0}
+ \tl_gset:Ne \g_@@_if_limit_tl { \tl_tail:N \g_@@_if_limit_tl } % remove the {0}
\prg_replicate:nn { \tl_count:N \g_@@_if_limit_tl } { \fi: }
\tl_map_function:NN \g_@@_if_limit_tl \@@_final_cond_aux:n
}
diff --git a/macros/latex/contrib/unravel/unravel.pdf b/macros/latex/contrib/unravel/unravel.pdf
index e21bda64ef..8dadcfd811 100644
--- a/macros/latex/contrib/unravel/unravel.pdf
+++ b/macros/latex/contrib/unravel/unravel.pdf
Binary files differ