summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3kernel/l3unicode.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/l3kernel/l3unicode.dtx')
-rw-r--r--macros/latex/contrib/l3kernel/l3unicode.dtx46
1 files changed, 26 insertions, 20 deletions
diff --git a/macros/latex/contrib/l3kernel/l3unicode.dtx b/macros/latex/contrib/l3kernel/l3unicode.dtx
index 74a1156707..7795efd6a8 100644
--- a/macros/latex/contrib/l3kernel/l3unicode.dtx
+++ b/macros/latex/contrib/l3kernel/l3unicode.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2019-09-08}
+% \date{Released 2019-09-19}
%
% \maketitle
%
@@ -84,29 +84,35 @@
{
\group_begin:
% \end{macrocode}
-% Set up a private copy of the char-generation primitive.
+% Access the primitive but suppress further expansion: active chars are
+% otherwise an issue.
% \begin{macrocode}
- \cs_set_eq:NN \@@_generate:w \tex_Uchar:D
+ \cs_set:Npn \@@_generate_char:n #1
+ { \tex_detokenize:D \tex_expandafter:D { \tex_Uchar:D " #1 } }
% \end{macrocode}
-% A fast local implementation for generating characters.
+% A fast local implementation for generating characters; the chars may
+% be active, so we prevent further expansion.
% \begin{macrocode}
\cs_set:Npx \@@_generate:n #1
{
- \sys_if_engine_luatex:TF
+ \exp_not:N \tex_unexpanded:D \exp_not:N \exp_after:wN
{
- \exp_not:N \lua_now:e
+ \sys_if_engine_luatex:TF
{
- l3kernel.charcat
- (
- \exp_not:N \tex_number:D #1 ,
- \exp_not:N \tex_the:D \tex_catcode:D #1
- )
+ \exp_not:N \tex_directlua:D
+ {
+ l3kernel.charcat
+ (
+ \exp_not:N \tex_number:D #1 ,
+ \exp_not:N \tex_the:D \tex_catcode:D #1
+ )
+ }
+ }
+ {
+ \exp_not:N \tex_Ucharcat:D
+ #1 ~
+ \tex_catcode:D #1 ~
}
- }
- {
- \exp_not:N \tex_Ucharcat:D
- #1 ~
- \tex_catcode:D #1 ~
}
}
% \end{macrocode}
@@ -127,7 +133,7 @@
\cs_set_nopar:Npn \l_@@_tmpb_tl {#5}
\reverse_if:N \if_meaning:w \l_@@_tmpa_tl \l_@@_tmpb_tl
\tl_const:cx
- { c_@@_mixed_case_ \@@_generate:w "#1 _tl }
+ { c_@@_mixed_case_ \@@_generate_char:n {#1} _tl }
{ \@@_generate:n { "#7 } }
\fi:
\fi:
@@ -155,7 +161,7 @@
\reverse_if:N \if_int_compare:w
\char_value_lccode:n {"#1} = "#3 ~
\tl_const:cx
- { c_@@_fold_case_ \@@_generate:w "#1 _tl }
+ { c_@@_fold_case_ \@@_generate_char:n {#1} _tl }
{ \@@_generate:n { "#3 } }
\fi:
\else:
@@ -166,7 +172,7 @@
}
\cs_set_protected:Npn \@@_data_auxii:w #1 ~ #2 ~ #3 ~ #4 \q_stop
{
- \tl_const:cx { c_@@_fold_case_ \@@_generate:w "#1 _tl }
+ \tl_const:cx { c_@@_fold_case_ \@@_generate_char:n {#1} _tl }
{
\@@_generate:n { "#2 }
\@@_generate:n { "#3 }
@@ -200,7 +206,7 @@
{
\tl_if_empty:nF {#4}
{
- \tl_const:cx { c_@@_ #2 _case_ \@@_generate:w "#1 _tl }
+ \tl_const:cx { c_@@_ #2 _case_ \@@_generate_char:n {#1} _tl }
{
\@@_generate:n { "#3 }
\@@_generate:n { "#4 }