[latex3-commits] [git/LaTeX3-latex3-latex3] peek-regex: In l3regex keep track of the current token as \l_@@_curr_token_tl (c5a8cb6d8)
Bruno Le Floch
blflatex at gmail.com
Mon Jul 20 02:19:19 CEST 2020
Repository : https://github.com/latex3/latex3
On branch : peek-regex
Link : https://github.com/latex3/latex3/commit/c5a8cb6d84989c50181ba9d5c889c39796e9a051
>---------------------------------------------------------------
commit c5a8cb6d84989c50181ba9d5c889c39796e9a051
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Fri Jul 17 12:42:00 2020 +0200
In l3regex keep track of the current token as \l_@@_curr_token_tl
>---------------------------------------------------------------
c5a8cb6d84989c50181ba9d5c889c39796e9a051
l3kernel/l3regex.dtx | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 8ca021612..de929f994 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -1002,7 +1002,7 @@
\cs_new:Npn \@@_curr_cs_to_str:
{
\exp_after:wN \exp_after:wN \exp_after:wN \cs_to_str:N
- \tex_the:D \tex_toks:D \l_@@_curr_pos_int
+ \l_@@_curr_token_tl
}
% \end{macrocode}
% \end{macro}
@@ -3794,6 +3794,7 @@
% \meta{key} is |<| or |>| for the beginning or end of group
% numbered \meta{group}. This causes the current position in the
% query to be stored as the \meta{key} submatch boundary.
+% \item One of these actions, within a conditional.
% \end{itemize}
%
% We strive to preserve the following properties while building.
@@ -4501,11 +4502,13 @@
% {
% \l_@@_curr_char_int,
% \l_@@_curr_catcode_int,
+% \l_@@_curr_token_tl,
% \l_@@_last_char_int,
% \l_@@_case_changed_char_int
% }
% The character and category codes of the token at the current
-% position; the character code of the token at the previous position;
+% position and a token list expanding to that token; the character
+% code of the token at the previous position;
% and the character code of the result of changing the case of the
% current token (|A-Z|$\leftrightarrow$|a-z|). This last integer is
% only computed when necessary, and is otherwise \cs{c_max_int}. The
@@ -4514,6 +4517,7 @@
% \begin{macrocode}
\int_new:N \l_@@_curr_char_int
\int_new:N \l_@@_curr_catcode_int
+\tl_new:N \l_@@_curr_token_tl
\int_new:N \l_@@_last_char_int
\int_new:N \l_@@_case_changed_char_int
% \end{macrocode}
@@ -4859,12 +4863,18 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_query_get:
{
- \l_@@_curr_char_int
- = \__kernel_intarray_item:Nn \g_@@_charcode_intarray
- { \l_@@_curr_pos_int } \scan_stop:
- \l_@@_curr_catcode_int
- = \__kernel_intarray_item:Nn \g_@@_catcode_intarray
- { \l_@@_curr_pos_int } \scan_stop:
+ \int_set:Nn \l_@@_curr_char_int
+ {
+ \__kernel_intarray_item:Nn \g_@@_charcode_intarray
+ { \l_@@_curr_pos_int }
+ }
+ \int_set:Nn \l_@@_curr_catcode_int
+ {
+ \__kernel_intarray_item:Nn \g_@@_catcode_intarray
+ { \l_@@_curr_pos_int }
+ }
+ \tl_set:Nx \l_@@_curr_token_tl
+ { \tex_the:D \tex_toks:D \l_@@_curr_pos_int }
}
% \end{macrocode}
% \end{macro}
More information about the latex3-commits
mailing list.