diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/expl3.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 282 |
1 files changed, 71 insertions, 211 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index dd27359ed69..1f9b7d2eaad 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -4,7 +4,7 @@ %% %% The original source files were: %% -%% expl3.dtx (with options: `package') +%% expl3.dtx (with options: `package,loader') %% %% EXPERIMENTAL CODE %% @@ -45,196 +45,63 @@ %% prior consultation with the LaTeX3 Project. %% %% ----------------------------------------------------------------------- -\RequirePackage{l3names}[2012/12/07] -\@ifpackagelater{l3names}{2012/12/07} - {} - {% - \PackageError{expl3}{Mismatched LaTeX3 packages detected.} - {% - Please install an up to date version of l3kernel - using your TeX package manager or from CTAN.% - \MessageBreak \MessageBreak - Loading expl3 will abort!% - }% - \endinput - } \def\ExplFileName{expl3} -\def\ExplFileDescription{L3 Experimental code bundle wrapper} -\def\ExplFileDate{2014/01/07} -\def\ExplFileVersion{4646} -\RequirePackage{etex} -\relax -\reserveinserts{32} -\ProvidesExplPackage - {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\newcommand \expl@create@bool@option [ 2 ] - { - \DeclareOption {#1} { \renewcommand* #2 { 1 } } - \DeclareOption { #1 = true } { \renewcommand* #2 { 1 } } - \DeclareOption { #1 = false } { \renewcommand* #2 { 0 } } - \newcommand* #2 { 0 } +\def\ExplFileDescription{L3 programming layer} +\def\ExplFileDate{2014/05/05} +\def\ExplFileVersion{4742} +\let\ExplLoaderFileVersion\ExplFileVersion +\ProvidesPackage{\ExplFileName} + [% + \ExplFileDate\space v\ExplFileVersion\space + \ExplFileDescription\space (loader) + ] +\RequirePackage{ifpdf} +\newcommand\expl@create@bool@option[2]% + {% + \DeclareOption{#1}{\chardef #2=1 }% + \DeclareOption{#1=true}{\chardef #2=1 }% + \DeclareOption{#1=false}{\chardef #2=0 }% + \newcommand*#2{}% + \chardef #2=0 % } -\expl@create@bool@option { check-declarations } \l@expl@check@declarations@bool -\expl@create@bool@option { log-functions } \l@expl@log@functions@bool -\let \expl@create@bool@option \@undefined -\newcommand* \l@expl@options@clist { } +\expl@create@bool@option{check-declarations}\l@expl@check@declarations@bool +\expl@create@bool@option{log-functions}\l@expl@log@functions@bool +\let\expl@create@bool@option\@undefined +\newcommand*\l@expl@options@clist{} \DeclareOption* - { - \ifx \l@expl@options@clist \@empty - \let \l@expl@options@clist \CurrentOption + {% + \ifx\l@expl@options@clist\@empty + \let\l@expl@options@clist\CurrentOption \else - \edef \l@expl@options@clist - { - \unexpanded \expandafter \expandafter \expandafter - { - \expandafter \l@expl@options@clist \expandafter , \CurrentOption - } - } + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\l@expl@options@clist + \expandafter\expandafter\expandafter + {\expandafter\l@expl@options@clist\expandafter,\CurrentOption} \fi } -\ProcessOptions \relax -\RequirePackage { l3basics, l3expan, l3tl } -\ifodd \l@expl@check@declarations@bool \relax - \cs_new_protected:Npn \__cs_check_exists:N #1 - { - \cs_if_exist:NF #1 - { - \__msg_kernel_error:nnx { check } { non-declared-variable } - { \token_to_str:N #1 } - } - } - \cs_set_protected:Npn \__cs_tmp:w #1 - { - \if_meaning:w ? #1 - \exp_after:wN \use_none_delimit_by_q_recursion_stop:w - \fi: - \use:x - { - \cs_set_protected:Npn #1 \exp_not:n { ##1 ##2 } - { - \__cs_check_exists:N \exp_not:n {##1} - \exp_not:o { #1 {##1} {##2} } - } - } - \__cs_tmp:w - } - \__cs_tmp:w - \tl_set:Nn \tl_set:No \tl_set:Nx - \tl_gset:Nn \tl_gset:No \tl_gset:Nx - \tl_put_left:Nn \tl_put_left:NV - \tl_put_left:No \tl_put_left:Nx - \tl_gput_left:Nn \tl_gput_left:NV - \tl_gput_left:No \tl_gput_left:Nx - \tl_put_right:Nn \tl_put_right:NV - \tl_put_right:No \tl_put_right:Nx - \tl_gput_right:Nn \tl_gput_right:NV - \tl_gput_right:No \tl_gput_right:Nx - ? \q_recursion_stop - \cs_set_protected:Npn \tl_set_eq:NN #1#2 - { - \__cs_check_exists:N #1 - \__cs_check_exists:N #2 - \cs_set_eq:NN #1 #2 - } - \cs_set_protected:Npn \tl_gset_eq:NN #1#2 - { - \__cs_check_exists:N #1 - \__cs_check_exists:N #2 - \cs_gset_eq:NN #1 #2 - } - \cs_set_protected:Npn \tl_concat:NNN #1#2#3 - { - \__cs_check_exists:N #1 - \__cs_check_exists:N #2 - \__cs_check_exists:N #3 - \tl_set:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } - } - \cs_set_protected:Npn \tl_gconcat:NNN #1#2#3 - { - \__cs_check_exists:N #1 - \__cs_check_exists:N #2 - \__cs_check_exists:N #3 - \tl_gset:Nx #1 { \exp_not:o {#2} \exp_not:o {#3} } - } -\fi -\RequirePackage { l3seq, l3int, l3quark, l3prg } -\ifodd \l@expl@check@declarations@bool \relax - \cs_set_protected:Npn \bool_set_true:N #1 - { - \__cs_check_exists:N #1 - \cs_set_eq:NN #1 \c_true_bool - } - \cs_set_protected:Npn \bool_set_false:N #1 - { - \__cs_check_exists:N #1 - \cs_set_eq:NN #1 \c_false_bool - } - \cs_set_protected:Npn \bool_gset_true:N #1 - { - \__cs_check_exists:N #1 - \cs_gset_eq:NN #1 \c_true_bool - } - \cs_set_protected:Npn \bool_gset_false:N #1 - { - \__cs_check_exists:N #1 - \cs_gset_eq:NN #1 \c_false_bool - } - \cs_set_protected:Npn \bool_set_eq:NN #1 - { - \__cs_check_exists:N #1 - \cs_set_eq:NN #1 - } - \cs_set_protected:Npn \bool_gset_eq:NN #1 - { - \__cs_check_exists:N #1 - \cs_gset_eq:NN #1 - } - \cs_set_protected:Npn \bool_set:Nn #1#2 - { - \__cs_check_exists:N #1 - \tex_chardef:D #1 = \bool_if_p:n {#2} - } - \cs_set_protected:Npn \bool_gset:Nn #1#2 - { - \__cs_check_exists:N #1 - \tex_global:D \tex_chardef:D #1 = \bool_if_p:n {#2} - } -\fi -\RequirePackage - { - l3clist, - l3token, - l3prop, - l3msg, - l3file, - l3skip, - l3keys, - l3fp, - l3box, - l3coffins, - l3color, - l3luatex, - l3candidates +\ProcessOptions\relax +\protected\def\ProvidesExplPackage#1#2#3#4% + {% + \ProvidesPackage{#1}[#2 v#3 #4]% + \ExplSyntaxOn } -\bool_if:nT { \l@expl@check@declarations@bool } - { - \__msg_kernel_new:nnnn { check } { non-declared-variable } - { The~variable~#1~has~not~been~declared~\msg_line_context:. } - { - Checking~is~active,~and~you~have~tried~do~so~something~like: \\ - \ \ \tl_set:Nn ~ #1 ~ \{ ~ ... ~ \} \\ - without~first~having: \\ - \ \ \tl_new:N ~ #1 \\ - \\ - LaTeX~will~create~the~variable~and~continue. - } +\protected\def\ProvidesExplClass#1#2#3#4% + {% + \ProvidesClass{#1}[#2 v#3 #4]% + \ExplSyntaxOn + } +\protected\def\ProvidesExplFile#1#2#3#4% + {% + \ProvidesFile{#1}[#2 v#3 #4]% + \ExplSyntaxOn } +\input{expl3-code.tex} +\protected\def\GetIdInfoLog{} \AtBeginDocument { \cs_if_exist:NF \color { \DeclareRobustCommand \color [2] [ ] { } } } -\RequirePackage{ifpdf} \__msg_kernel_new:nnnn { expl } { wrong-driver } { Driver~request~inconsistent~with~engine:~using~'#2'~driver. } { @@ -392,48 +259,41 @@ } } { + \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4 + { \ProvidesFile {#1} [ #2~v#3~#4 ] } \tl_const:Nn \c__expl_def_ext_tl { def } \@onefilewithoptions { l3 \l__expl_driver_tl } [ ] [ ] \c__expl_def_ext_tl + \cs_set_protected:Npn \ProvidesExplFile #1#2#3#4 + { + \ProvidesFile {#1} [ #2~v#3~#4 ] + \ExplSyntaxOn + } } -\cs_set_protected_nopar:Npn \ExplSyntaxOn +\tl_put_left:Nn \@pushfilename { - \bool_if:NF \l__kernel_expl_bool + \tl_put_left:Nx \l__expl_status_stack_tl { - \cs_set_protected_nopar:Npx \ExplSyntaxOff - { - \char_set_catcode:nn { 9 } { \char_value_catcode:n { 9 } } - \char_set_catcode:nn { 32 } { \char_value_catcode:n { 32 } } - \char_set_catcode:nn { 34 } { \char_value_catcode:n { 34 } } - \char_set_catcode:nn { 36 } { \char_value_catcode:n { 36 } } - \char_set_catcode:nn { 38 } { \char_value_catcode:n { 38 } } - \char_set_catcode:nn { 58 } { \char_value_catcode:n { 58 } } - \char_set_catcode:nn { 94 } { \char_value_catcode:n { 94 } } - \char_set_catcode:nn { 95 } { \char_value_catcode:n { 95 } } - \char_set_catcode:nn { 124 } { \char_value_catcode:n { 124 } } - \char_set_catcode:nn { 126 } { \char_value_catcode:n { 126 } } - \tex_endlinechar:D = \tex_the:D \tex_endlinechar:D \scan_stop: - \bool_set_false:N \l__kernel_expl_bool - \cs_set_protected_nopar:Npn \ExplSyntaxOff { } - } + \bool_if:NTF \l__kernel_expl_bool + { 1 } + { 0 } } - \char_set_catcode_ignore:n { 9 } % tab - \char_set_catcode_ignore:n { 32 } % space - \char_set_catcode_other:n { 34 } % double quote - \char_set_catcode_math_toggle:n { 36 } % dollar - \char_set_catcode_alignment:n { 38 } % ampersand - \char_set_catcode_letter:n { 58 } % colon - \char_set_catcode_math_superscript:n { 94 } % circumflex - \char_set_catcode_letter:n { 95 } % underscore - \char_set_catcode_other:n { 124 } % pipe - \char_set_catcode_space:n { 126 } % tilde - \tex_endlinechar:D = 32 \scan_stop: - \bool_set_true:N \l__kernel_expl_bool + \ExplSyntaxOff + } +\tl_put_right:Nn \@popfilename + { + \tl_if_empty:NTF \l__expl_status_stack_tl + { \ExplSyntaxOff } + { \exp_after:wN \__expl_status_pop:w \l__expl_status_stack_tl \q_stop } } -\cs_set_protected_nopar:Npx \ExplSyntaxOff +\cs_new_protected:Npn \__expl_status_pop:w #1#2 \q_stop { - \exp_not:o \ExplSyntaxOff - \cs_set_protected_nopar:Npn \ExplSyntaxOff { } + \tl_set:Nn \l__expl_status_stack_tl {#2} + \int_if_odd:nTF {#1} + { \ExplSyntaxOn } + { \ExplSyntaxOff } } +\tl_new:N \l__expl_status_stack_tl +\tl_set:Nn \l__expl_status_stack_tl { 0 } %% %% %% End of file `expl3.sty'. |