summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-14 21:07:53 +0000
committerKarl Berry <karl@freefriends.org>2017-11-14 21:07:53 +0000
commit8c82df0007c957004cc2268b49ccf3ceca914f58 (patch)
treeae29044a1727ceb31a488437f43cde1a31e6e007 /Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
parent4bd2a337b834181c967e774caddf57b3f747e127 (diff)
l3 (14nov17)
git-svn-id: svn://tug.org/texlive/trunk@45802 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex192
1 files changed, 182 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
index 4e9108fafe9..a4bfbf009c9 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
@@ -62,7 +62,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx Copyright (C) 1990-2017 The LaTeX3 Project
-\def\ExplFileDate{2017/09/18}%
+\def\ExplFileDate{2017/11/14}%
\begingroup
\def\next{\endgroup}%
\expandafter\ifx\csname PackageError\endcsname\relax
@@ -1247,6 +1247,36 @@
\tex_let:D \tex_input:D \@@input
\tex_let:D \tex_italiccorrection:D \@@italiccorr
\tex_let:D \tex_underline:D \@@underline
+ \etex_ifdefined:D \@@shipout
+ \tex_let:D \tex_shipout:D \@@shipout
+ \tex_fi:D
+ \tex_begingroup:D
+ \tex_edef:D \l_tmpa_tl { \tex_string:D \shipout }
+ \tex_edef:D \l_tmpb_tl { \tex_meaning:D \shipout }
+ \tex_ifx:D \l_tmpa_tl \l_tmpb_tl
+ \tex_else:D
+ \tex_expandafter:D \@tfor \tex_expandafter:D \@tempa \tex_string:D :=
+ \CROP@shipout
+ \dup@shipout
+ \GPTorg@shipout
+ \LL@shipout
+ \mem@oldshipout
+ \opem@shipout
+ \pgfpages@originalshipout
+ \pr@shipout
+ \Shipout
+ \verso@orig@shipout
+ \do
+ {
+ \tex_edef:D \l_tmpb_tl
+ { \tex_expandafter:D \tex_meaning:D \@tempa }
+ \tex_ifx:D \l_tmpa_tl \l_tmpb_tl
+ \tex_global:D \tex_expandafter:D \tex_let:D
+ \tex_expandafter:D \tex_shipout:D \@tempa
+ \tex_fi:D
+ }
+ \tex_fi:D
+ \tex_endgroup:D
\tex_let:D \pdftex_tracingfonts:D \tex_undefined:D
\etex_ifdefined:D \pdftracingfonts
\tex_let:D \pdftex_tracingfonts:D \pdftracingfonts
@@ -2800,6 +2830,15 @@
\prg_new_eq_conditional:NNn \tl_if_exist:N \cs_if_exist:N { TF , T , F , p }
\prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p }
\tl_const:Nn \c_empty_tl { }
+\group_begin:
+\tex_lccode:D `A = `-
+\tex_lccode:D `N = `N
+\tex_lccode:D `V = `V
+\tex_lowercase:D
+ {
+ \group_end:
+ \tl_const:Nn \c_novalue_tl { ANoValue- }
+ }
\tl_const:Nn \c_space_tl { ~ }
\__debug_patch:nnNNpn { \__debug_chk_var_exist:N #1 } { }
\cs_new_protected:Npn \tl_set:Nn #1#2
@@ -3164,6 +3203,23 @@
\cs_generate_variant:Nn \tl_if_in:nnT { V , o , no }
\cs_generate_variant:Nn \tl_if_in:nnF { V , o , no }
\cs_generate_variant:Nn \tl_if_in:nnTF { V , o , no }
+\use:x
+ {
+ \prg_new_conditional:Npnn \exp_not:N \tl_if_novalue:n ##1
+ { T , F , TF }
+ {
+ \exp_not:N \str_if_eq:onTF
+ {
+ \exp_not:N \__tl_if_novalue:w ? ##1 { }
+ \c_novalue_tl
+ }
+ { ? { } \c_novalue_tl }
+ { \exp_not:N \prg_return_true: }
+ { \exp_not:N \prg_return_false: }
+ }
+ \cs_new:Npn \exp_not:N \__tl_if_novalue:w ##1 \c_novalue_tl
+ {##1}
+ }
\cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n }
\cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT }
\cs_new:Npn \tl_if_single:NF { \exp_args:No \tl_if_single:nF }
@@ -3303,6 +3359,7 @@
{ \exp_not:o { \use_none:nn #2 } }
\cs_new:Npn \tl_trim_spaces:n #1
{ \__tl_trim_spaces:nn { \q_mark #1 } \exp_not:o }
+\cs_generate_variant:Nn \tl_trim_spaces:n { o }
\cs_new_protected:Npn \tl_trim_spaces:N #1
{ \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } }
\cs_new_protected:Npn \tl_gtrim_spaces:N #1
@@ -3633,6 +3690,10 @@
\cs_new_eq:NN \str_gset_eq:NN \tl_gset_eq:NN
\cs_generate_variant:Nn \str_set_eq:NN { c , Nc , cc }
\cs_generate_variant:Nn \str_gset_eq:NN { c , Nc , cc }
+\cs_new_eq:NN \str_concat:NNN \tl_concat:NNN
+\cs_new_eq:NN \str_gconcat:NNN \tl_gconcat:NNN
+\cs_generate_variant:Nn \str_concat:NNN { ccc }
+\cs_generate_variant:Nn \str_gconcat:NNN { ccc }
\group_begin:
\cs_set_protected:Npn \__str_tmp:n #1
{
@@ -3654,6 +3715,58 @@
{ gput_right }
{ }
\group_end:
+\cs_new_protected:Npn \str_replace_once:Nnn
+ { \__str_replace:NNNnn \prg_do_nothing: \tl_set:Nx }
+\cs_new_protected:Npn \str_greplace_once:Nnn
+ { \__str_replace:NNNnn \prg_do_nothing: \tl_gset:Nx }
+\cs_new_protected:Npn \str_replace_all:Nnn
+ { \__str_replace:NNNnn \__str_replace_next:w \tl_set:Nx }
+\cs_new_protected:Npn \str_greplace_all:Nnn
+ { \__str_replace:NNNnn \__str_replace_next:w \tl_gset:Nx }
+\cs_generate_variant:Nn \str_replace_once:Nnn { c }
+\cs_generate_variant:Nn \str_greplace_once:Nnn { c }
+\cs_generate_variant:Nn \str_replace_all:Nnn { c }
+\cs_generate_variant:Nn \str_greplace_all:Nnn { c }
+\cs_new_protected:Npn \__str_replace:NNNnn #1#2#3#4#5
+ {
+ \tl_if_empty:nTF {#4}
+ {
+ \__msg_kernel_error:nnx { kernel } { empty-search-pattern } {#5}
+ }
+ {
+ \use:x
+ {
+ \exp_not:n { \__str_replace_aux:NNNnnn #1 #2 #3 }
+ { \tl_to_str:N #3 }
+ { \tl_to_str:n {#4} } { \tl_to_str:n {#5} }
+ }
+ }
+ }
+\cs_new_protected:Npn \__str_replace_aux:NNNnnn #1#2#3#4#5#6
+ {
+ \cs_set:Npn \__str_replace_next:w ##1 #5 { ##1 #6 #1 }
+ #2 #3
+ {
+ \__str_replace_next:w
+ #4
+ \use_none_delimit_by_q_stop:w
+ #5
+ \q_stop
+ }
+ }
+\cs_new_eq:NN \__str_replace_next:w ?
+\cs_new_protected:Npn \str_remove_once:Nn #1#2
+ { \str_replace_once:Nnn #1 {#2} { } }
+\cs_new_protected:Npn \str_gremove_once:Nn #1#2
+ { \str_greplace_once:Nnn #1 {#2} { } }
+\cs_generate_variant:Nn \str_remove_once:Nn { c }
+\cs_generate_variant:Nn \str_gremove_once:Nn { c }
+\cs_new_protected:Npn \str_remove_all:Nn #1#2
+ { \str_replace_all:Nnn #1 {#2} { } }
+\cs_new_protected:Npn \str_gremove_all:Nn #1#2
+ { \str_greplace_all:Nnn #1 {#2} { } }
+\cs_generate_variant:Nn \str_remove_all:Nn { c }
+\cs_generate_variant:Nn \str_gremove_all:Nn { c }
\prg_new_eq_conditional:NNn \str_if_exist:N \tl_if_exist:N { p , T , F , TF }
\prg_new_eq_conditional:NNn \str_if_exist:c \tl_if_exist:c { p , T , F , TF }
\prg_new_eq_conditional:NNn \str_if_empty:N \tl_if_empty:N { p , T , F , TF }
@@ -3717,6 +3830,21 @@
\cs_generate_variant:Nn \str_if_eq:NNF { c , Nc , cc }
\cs_generate_variant:Nn \str_if_eq:NNTF { c , Nc , cc }
\cs_generate_variant:Nn \str_if_eq_p:NN { c , Nc , cc }
+\prg_new_protected_conditional:Npnn \str_if_in:Nn #1#2 { T , F , TF }
+ {
+ \use:x
+ { \tl_if_in:nnTF { \tl_to_str:N #1 } { \tl_to_str:n {#2} } }
+ { \prg_return_true: } { \prg_return_false: }
+ }
+\cs_generate_variant:Nn \str_if_in:NnT { c }
+\cs_generate_variant:Nn \str_if_in:NnF { c }
+\cs_generate_variant:Nn \str_if_in:NnTF { c }
+\prg_new_protected_conditional:Npnn \str_if_in:nn #1#2 { T , F , TF }
+ {
+ \use:x
+ { \tl_if_in:nnTF { \tl_to_str:n {#1} } { \tl_to_str:n {#2} } }
+ { \prg_return_true: } { \prg_return_false: }
+ }
\cs_new:Npn \str_case:nn #1#2
{
\exp:w
@@ -3778,6 +3906,54 @@
{ \__str_case_x:nw {#1} }
}
\cs_new_eq:NN \__str_case_end:nw \__prg_case_end:nw
+\cs_new:Npn \str_map_function:nN #1#2
+ {
+ \exp_after:wN \__str_map_function:Nn \exp_after:wN #2
+ \etex_detokenize:n {#1}
+ \q_recursion_tail
+ \__prg_break_point:Nn \str_map_break: { }
+ }
+\cs_new:Npn \str_map_function:NN
+ { \exp_args:No \str_map_function:nN }
+\cs_new:Npn \__str_map_function:Nn #1#2
+ {
+ \__quark_if_recursion_tail_break:nN {#2} \str_map_break:
+ #1 {#2} \__str_map_function:Nn #1
+ }
+\cs_generate_variant:Nn \str_map_function:NN { c }
+\cs_new_protected:Npn \str_map_inline:nn #1#2
+ {
+ \int_gincr:N \g__prg_map_int
+ \cs_gset_protected:cpn
+ { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+ \exp_args:Nc \__str_map_function:Nn
+ { __prg_map_ \int_use:N \g__prg_map_int :w }
+ #1 \q_recursion_tail
+ \__prg_break_point:Nn \str_map_break: { \int_gdecr:N \g__prg_map_int }
+ }
+\cs_new_protected:Npn \str_map_inline:Nn
+ { \exp_args:No \str_map_inline:nn }
+\cs_generate_variant:Nn \str_map_inline:Nn { c }
+\cs_new_protected:Npn \str_map_variable:nNn #1#2#3
+ {
+ \__str_map_variable:Nnn #2 {#3} #1
+ \q_recursion_tail
+ \__prg_break_point:Nn \str_map_break: { }
+ }
+\cs_new_protected:Npn \str_map_variable:NNn
+ { \exp_args:No \str_map_variable:nNn }
+\cs_new_protected:Npn \__str_map_variable:Nnn #1#2#3
+ {
+ \str_set:Nn #1 {#3}
+ \__quark_if_recursion_tail_break:NN #1 \str_map_break:
+ \use:n {#2}
+ \__str_map_variable:Nnn #1 {#2}
+ }
+\cs_generate_variant:Nn \str_map_variable:NNn { c }
+\cs_new:Npn \str_map_break:
+ { \__prg_map_break:Nn \str_map_break: { } }
+\cs_new:Npn \str_map_break:n
+ { \__prg_map_break:Nn \str_map_break: }
\cs_new:Npn \__str_to_other:n #1
{
\exp_after:wN \__str_to_other_loop:w
@@ -3785,7 +3961,7 @@
}
\group_begin:
\tex_lccode:D `\* = `\ %
-\tex_lccode:D `\A = `\A
+\tex_lccode:D `\A = `\A %
\tex_lowercase:D
{
\group_end:
@@ -3808,7 +3984,7 @@
}
\group_begin:
\tex_lccode:D `\* = `\ %
-\tex_lccode:D `\A = `\A
+\tex_lccode:D `\A = `\A %
\tex_lowercase:D
{
\group_end:
@@ -10691,12 +10867,7 @@
}
}
\cs_new:Npn \__keys_remove_spaces:n #1
- {
- \exp_after:wN \__keys_remove_spaces:w \tl_to_str:n {#1}
- \use_none:nn ? ~
- }
-\cs_new:Npn \__keys_remove_spaces:w #1 ~
- { #1 \__keys_remove_spaces:w }
+ { \tl_trim_spaces:o { \tl_to_str:n {#1} } }
\prg_new_conditional:Npnn \keys_if_exist:nn #1#2 { p , T , F , TF }
{
\cs_if_exist:cTF
@@ -21659,7 +21830,8 @@
}
\cs_new_protected:Npn \color_ensure_current:
{
- \__driver_color_ensure_current:
+ \__driver_color_pickup:N \l__color_current_tl
+ \__driver_color_select:V \l__color_current_tl
\group_insert_after:N \__driver_color_reset:
}
\tl_new:N \l__color_current_tl