[latex3-commits] [l3svn] r7424 - Add \c_catcode_active_space_tl
noreply at latex-project.org
noreply at latex-project.org
Mon Aug 7 17:30:30 CEST 2017
Author: bruno
Date: 2017-08-07 17:30:30 +0200 (Mon, 07 Aug 2017)
New Revision: 7424
Modified:
trunk/l3kernel/l3candidates.dtx
trunk/l3kernel/l3file.dtx
trunk/l3kernel/l3token.dtx
trunk/l3kernel/testfiles/m3expl001.luatex.tlg
trunk/l3kernel/testfiles/m3expl001.ptex.tlg
trunk/l3kernel/testfiles/m3expl001.tlg
trunk/l3kernel/testfiles/m3expl001.uptex.tlg
trunk/l3kernel/testfiles/m3expl001.xetex.tlg
trunk/l3kernel/testfiles/m3expl003.luatex.tlg
trunk/l3kernel/testfiles/m3expl003.ptex.tlg
trunk/l3kernel/testfiles/m3expl003.tlg
trunk/l3kernel/testfiles/m3expl003.uptex.tlg
trunk/l3kernel/testfiles/m3expl003.xetex.tlg
Log:
Add \c_catcode_active_space_tl
This will be useful in l3doc, and there was so far no (reasonable) supported
way to get an active space character without using \tex_lowercase:D.
Modified: trunk/l3kernel/l3candidates.dtx
===================================================================
--- trunk/l3kernel/l3candidates.dtx 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/l3candidates.dtx 2017-08-07 15:30:30 UTC (rev 7424)
@@ -937,6 +937,11 @@
%
% \section{Additions to \pkg{l3token}}
%
+% \begin{variable}[added = 2017-08-07]{\c_catcode_active_space_tl}
+% Token list containing one character with category code $13$,
+% (\enquote{active}), and character code $32$ (space).
+% \end{variable}
+%
% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:}
% \begin{syntax}
% \cs{peek_N_type:TF} \Arg{true code} \Arg{false code}
@@ -4062,7 +4067,22 @@
%
% \subsection{Additions to \pkg{l3token}}
%
+% \begin{variable}{\c_catcode_active_space_tl}
+% While \cs{__char_generate:nn} can produce active characters in some
+% engines it cannot in general. It would be possible to simply change
+% the catcode of space but then the code would need to avoid all
+% spaces, making it quite unreadable. Instead we use the primitive
+% \cs{tex_lowercase:D} trick.
% \begin{macrocode}
+\group_begin:
+ \char_set_catcode_active:N *
+ \char_set_lccode:nn { `* } { `\ }
+ \tex_lowercase:D { \tl_const:Nn \c_catcode_active_space_tl { * } }
+\group_end:
+% \end{macrocode}
+% \end{variable}
+%
+% \begin{macrocode}
%<@@=peek>
% \end{macrocode}
%
Modified: trunk/l3kernel/l3file.dtx
===================================================================
--- trunk/l3kernel/l3file.dtx 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/l3file.dtx 2017-08-07 15:30:30 UTC (rev 7424)
@@ -600,11 +600,6 @@
% and MiK\TeX{} systems.
% \end{variable}
%
-% \begin{variable}[added = 2011-09-05]{\c_catcode_other_space_tl}
-% Token list containing one character with category code $12$,
-% (\enquote{other}), and character code $32$ (space).
-% \end{variable}
-%
% \subsection{Constant input--output streams}
%
% \begin{variable}{\c_term_ior}
@@ -1754,13 +1749,6 @@
% used by the messaging system, but is designed such that it is
% available for other uses.
%
-% \begin{macro}{\c_catcode_other_space_tl}
-% Create a space with category code $12$: an \enquote{other} space.
-% \begin{macrocode}
-\tl_const:Nx \c_catcode_other_space_tl { \char_generate:nn { `\ } { 12 } }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{variable}{\l_iow_line_count_int}
% This is the \enquote{raw} number of characters in a line which
% can be written to the terminal.
Modified: trunk/l3kernel/l3token.dtx
===================================================================
--- trunk/l3kernel/l3token.dtx 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/l3token.dtx 2017-08-07 15:30:30 UTC (rev 7424)
@@ -146,6 +146,11 @@
% range ($0$ to $255$) is accepted due to engine limitations.
% \end{function}
%
+% \begin{variable}[added = 2011-09-05]{\c_catcode_other_space_tl}
+% Token list containing one character with category code $12$,
+% (\enquote{other}), and character code $32$ (space).
+% \end{variable}
+%
% \section{Manipulating and interrogating character tokens}
%
% \begin{function}[updated = 2015-11-11]
@@ -1597,6 +1602,13 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\c_catcode_other_space_tl}
+% Create a space with category code $12$: an \enquote{other} space.
+% \begin{macrocode}
+\tl_const:Nx \c_catcode_other_space_tl { \char_generate:nn { `\ } { 12 } }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Generic tokens}
%
% \begin{macrocode}
Modified: trunk/l3kernel/testfiles/m3expl001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.luatex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl001.luatex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2217,6 +2217,7 @@
Defining \l__char_tmp_tl on line ...
Defining \c__char_max_int on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2945,7 +2946,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5660,6 +5660,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.ptex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl001.ptex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count118
Defining \l__iow_newline_tl on line ...
@@ -5651,6 +5651,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl001.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5852,6 +5852,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.uptex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl001.uptex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count118
Defining \l__iow_newline_tl on line ...
@@ -5850,6 +5850,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.xetex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl001.xetex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2215,6 +2215,7 @@
Defining \l__char_tmp_tl on line ...
Defining \c__char_max_int on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2943,7 +2944,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5634,6 +5634,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.luatex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl003.luatex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2217,6 +2217,7 @@
Defining \l__char_tmp_tl on line ...
Defining \c__char_max_int on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2945,7 +2946,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5660,6 +5660,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.ptex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl003.ptex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count118
Defining \l__iow_newline_tl on line ...
@@ -5651,6 +5651,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl003.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5852,6 +5852,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.uptex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl003.uptex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2205,6 +2205,7 @@
Defining \c__char_ccliv_tl on line ...
Defining \c__char_cclv_tl on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2933,7 +2934,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count118
Defining \l__iow_newline_tl on line ...
@@ -5850,6 +5850,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
Modified: trunk/l3kernel/testfiles/m3expl003.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.xetex.tlg 2017-08-07 15:21:19 UTC (rev 7423)
+++ trunk/l3kernel/testfiles/m3expl003.xetex.tlg 2017-08-07 15:30:30 UTC (rev 7424)
@@ -2215,6 +2215,7 @@
Defining \l__char_tmp_tl on line ...
Defining \c__char_max_int on line ...
Defining \__char_generate_aux:nnw on line ...
+Defining \c_catcode_other_space_tl on line ...
Defining \token_new:Nn on line ...
Defining \c_group_begin_token on line ...
Defining \c_group_end_token on line ...
@@ -2943,7 +2944,6 @@
Defining \iow_term:n on line ...
Defining \iow_newline: on line ...
Defining \iow_char:N on line ...
-Defining \c_catcode_other_space_tl on line ...
Defining \l_iow_line_count_int on line ...
\l_iow_line_count_int=\count120
Defining \l__iow_newline_tl on line ...
@@ -5634,6 +5634,7 @@
Defining \__tl_range_collect_group:nn on line ...
Defining \__tl_range_collect:ff on line ...
Defining \__tl_range_normalize:nn on line ...
+Defining \c_catcode_active_space_tl on line ...
Defining \__peek_execute_branches_N_type: on line ...
Defining \__peek_N_type:w on line ...
Defining \__peek_N_type_aux:nnw on line ...
More information about the latex3-commits
mailing list