From 58716ee4be6eb8b578e9e7097971079d0e9d0b6a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 28 Jan 2019 22:07:57 +0000 Subject: l3 (28jan19) git-svn-id: svn://tug.org/texlive/trunk@49853 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/l3kernel/l3token.dtx | 40 ++++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'Master/texmf-dist/source/latex/l3kernel/l3token.dtx') diff --git a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx index d94b08dc5a4..3725929968d 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3token.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3token.dtx @@ -1,6 +1,8 @@ % \iffalse meta-comment % -%% File: l3token.dtx Copyright (C) 2005-2019 The LaTeX3 Project +%% File: l3token.dtx +% +% Copyright (C) 2005-2019 The LaTeX3 Project % % It may be distributed and/or modified under the conditions of the % LaTeX Project Public License (LPPL), either version 1.3c of this @@ -41,7 +43,7 @@ % }^^A % } % -% \date{Released 2019-01-13} +% \date{Released 2019-01-28} % % \maketitle % @@ -121,7 +123,7 @@ % be an active character. % \end{function} % -% \begin{function}[EXP, added = 2015-09-09, updated = 2018-04-19] +% \begin{function}[EXP, added = 2015-09-09, updated = 2019-01-16] % {\char_generate:nn} % \begin{syntax} % \cs{char_generate:nn} \Arg{charcode} \Arg{catcode} @@ -144,6 +146,9 @@ % and other values raise an error. The \meta{charcode} may be any one valid % for the engine in use. % Active characters cannot be generated in older versions of \XeTeX{}. +% \begin{texnote} +% Exactly two expansions are needed to produce the character. +% \end{texnote} % \end{function} % % \begin{variable}[added = 2011-09-05]{\c_catcode_other_space_tl} @@ -1415,7 +1420,9 @@ % Engine-dependent definitions are now needed for the implementation. For % \LuaTeX{} and \XeTeX{} there is engine-level support. % They can do cases that macro emulation can't. All of those are filtered -% out here using a primitive-based boolean expression for speed. +% out here using a primitive-based boolean expression to avoid fixing +% the category code of the null character used in the false branch +% (for 8-bit engines). % The final level is the basic definition at the engine level: the arguments % here are integers so there is no need to worry about them too much. % Older versions of \XeTeX{} cannot generate active characters so we filter @@ -1465,7 +1472,7 @@ } \else: % \end{macrocode} -% For engines where \tn{Ucharcat} isn't available (or emulated) then we have +% For engines where \tn{Ucharcat} isn't available or emulated, we have % to work in macros, and cover only the $8$-bit range. The first stage is % to build up a |tl| containing |^^@| with each category code that can % be accessed in this way, with an error set up for the other cases. This @@ -1483,21 +1490,8 @@ \tl_set:Nx \l_@@_tmp_tl { \l_@@_tmp_tl } \char_set_catcode_math_toggle:n { 0 } \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } -% \end{macrocode} -% As \TeX{} is very unhappy if if finds an alignment character inside -% a primitive \tn{halign} even when skipping false branches, some precautions -% are required. \TeX{} is happy if the token is hidden inside -% \tn{unexpanded} (which needs to be the primitive). The expansion chain here -% is required so that the conditional gets cleaned up correctly (other code -% assumes there is exactly one token to skip during the clean-up). -% \begin{macrocode} \char_set_catcode_alignment:n { 0 } - \tl_put_right:Nn \l_@@_tmp_tl - { - \or: - \__kernel_exp_not:w \exp_after:wN - { \exp_after:wN ^^@ \exp_after:wN } - } + \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } \tl_put_right:Nn \l_@@_tmp_tl { \or: } \char_set_catcode_parameter:n { 0 } \tl_put_right:Nn \l_@@_tmp_tl { \or: ^^@ } @@ -1550,15 +1544,23 @@ %<*initex> \int_step_function:nnN { 0 } { 255 } \@@_tmp:n % +% \end{macrocode} +% As \TeX{} is very unhappy if if finds an alignment character inside +% a primitive \tn{halign} even when skipping false branches, some +% precautions are required. \TeX{} is happy if the token is hidden +% between braces within \cs{if_false:} \dots{} \cs{fi:}. +% \begin{macrocode} \cs_new:Npn \@@_generate_aux:nnw #1#2#3 \exp_end: { #3 + \if_false: { \fi: \exp_after:wN \exp_after:wN \exp_after:wN \exp_end: \exp_after:wN \exp_after:wN \if_case:w #2 \exp_last_unbraced:Nv \exp_stop_f: { c_@@_ \@@_int_to_roman:w #1 _tl } + \or: } \fi: } \fi: -- cgit v1.2.3