You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
5.8 KiB
172 lines
5.8 KiB
%%
|
|
%% This is file `xparse.sty',
|
|
%% generated with the docstrip utility.
|
|
%%
|
|
%% The original source files were:
|
|
%%
|
|
%% xparse.dtx (with options: `package')
|
|
%%
|
|
%% Copyright (C) 2009-2020 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 license or (at your option) any later version. The latest
|
|
%% version of this license is in the file:
|
|
%%
|
|
%% http://www.latex-project.org/lppl.txt
|
|
%%
|
|
%% This file is part of the "l3packages bundle" (The Work in LPPL)
|
|
%% and all files in that bundle must be distributed together.
|
|
%%
|
|
%% File: xparse.dtx
|
|
\RequirePackage{expl3}[2018-04-12]
|
|
\@ifpackagelater{expl3}{2018-04-12}
|
|
{}
|
|
{%
|
|
\PackageError{xparse}{Support package l3kernel too old}
|
|
{%
|
|
Please install an up to date version of l3kernel\MessageBreak
|
|
using your TeX package manager or from CTAN.\MessageBreak
|
|
\MessageBreak
|
|
Loading xparse will abort!%
|
|
}%
|
|
\endinput
|
|
}
|
|
\ProvidesExplPackage{xparse}{2020-05-15}{}
|
|
{L3 Experimental document command parser}
|
|
\clist_new:N \l__xparse_options_clist
|
|
\DeclareOption* { \clist_put_right:NV \l__xparse_options_clist \CurrentOption }
|
|
\ProcessOptions \relax
|
|
\keys_define:nn { xparse }
|
|
{
|
|
log-declarations .bool_set:N = \l__xparse_log_bool ,
|
|
log-declarations .initial:n = false
|
|
}
|
|
\keys_set:nV { xparse } \l__xparse_options_clist
|
|
\bool_if:NF \l__xparse_log_bool
|
|
{ \msg_redirect_module:nnn { LaTeX / xparse } { info } { none } }
|
|
\file_input:n { xparse-generic.tex }
|
|
\cs_gset_protected:Npn \__xparse_normalize_arg_spec_loop:n #1
|
|
{
|
|
\quark_if_recursion_tail_stop:n {#1}
|
|
\int_incr:N \l__xparse_current_arg_int
|
|
\cs_if_exist_use:cF { __xparse_normalize_type_ \tl_to_str:n {#1} :w }
|
|
{
|
|
\__kernel_msg_error:nnxx { xparse } { unknown-argument-type }
|
|
{ \__xparse_environment_or_command: } { \tl_to_str:n {#1} }
|
|
\__xparse_bad_def:wn
|
|
}
|
|
}
|
|
\cs_new_protected:Npx \__xparse_normalize_type_g:w
|
|
{ \exp_not:N \__xparse_normalize_type_G:w { \exp_not:V \c_novalue_tl } }
|
|
\cs_new_protected:Npn \__xparse_normalize_type_G:w #1
|
|
{
|
|
\quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
|
|
\__xparse_normalize_check_gv:N G
|
|
\__xparse_add_arg_spec:n { G {#1} }
|
|
\tl_put_right:Nn \l__xparse_last_delimiters_tl { { } }
|
|
\__xparse_normalize_arg_spec_loop:n
|
|
}
|
|
\cs_new_protected:Npn \__xparse_normalize_type_l:w
|
|
{
|
|
\__xparse_normalize_check_lu:N l
|
|
\__xparse_add_arg_spec_mandatory:n { l }
|
|
\__xparse_normalize_arg_spec_loop:n
|
|
}
|
|
\cs_new_protected:Npn \__xparse_normalize_type_u:w #1
|
|
{
|
|
\quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
|
|
\__xparse_normalize_check_lu:N u
|
|
\__xparse_add_arg_spec_mandatory:n { u {#1} }
|
|
\__xparse_normalize_arg_spec_loop:n
|
|
}
|
|
\cs_new_protected:Npn \__xparse_add_type_G:w #1
|
|
{
|
|
\__xparse_flush_m_args:
|
|
\__xparse_add_default:n {#1}
|
|
\__xparse_add_grabber:N G
|
|
\__xparse_prepare_signature:N
|
|
}
|
|
\cs_new_protected:Npn \__xparse_add_type_l:w
|
|
{
|
|
\__xparse_flush_m_args:
|
|
\__xparse_add_default:
|
|
\__xparse_add_grabber:N l
|
|
\__xparse_prepare_signature:N
|
|
}
|
|
\cs_new_protected:Npn \__xparse_add_type_u:w #1
|
|
{
|
|
\__xparse_flush_m_args:
|
|
\__xparse_add_default:
|
|
\__xparse_add_grabber:N u
|
|
\tl_put_right:Nn \l__xparse_signature_tl { {#1} }
|
|
\__xparse_prepare_signature:N
|
|
}
|
|
\cs_new_protected:Npn \__xparse_add_expandable_type_l:w
|
|
{ \__xparse_add_expandable_type_u:w ## }
|
|
\cs_new_protected:Npn \__xparse_add_expandable_type_u:w #1
|
|
{
|
|
\__xparse_add_default:
|
|
\bool_if:NTF \l__xparse_long_bool
|
|
{ \cs_set:cpn }
|
|
{ \cs_set_nopar:cpn }
|
|
{ \l__xparse_expandable_aux_name_tl } ##1 \q__xparse ##2 ##3 ##4 #1
|
|
{ ##1 {##4} \q__xparse ##2 ##3 }
|
|
\__xparse_add_expandable_grabber:nn { u }
|
|
{ \exp_not:c { \l__xparse_expandable_aux_name_tl } }
|
|
\__xparse_prepare_signature:N
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_G:w #1 \__xparse_run_code:
|
|
{
|
|
\__xparse_grab_G_aux:nNN {#1} \cs_set_protected_nopar:Npn
|
|
\__xparse_peek_nonspace:NTF
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_G_long:w #1 \__xparse_run_code:
|
|
{
|
|
\__xparse_grab_G_aux:nNN {#1} \cs_set_protected:Npn
|
|
\__xparse_peek_nonspace:NTF
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_G_obey_spaces:w #1 \__xparse_run_code:
|
|
{
|
|
\__xparse_grab_G_aux:nNN {#1} \cs_set_protected_nopar:Npn
|
|
\peek_meaning:NTF
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_G_long_obey_spaces:w #1 \__xparse_run_code:
|
|
{
|
|
\__xparse_grab_G_aux:nNN {#1} \cs_set_protected:Npn
|
|
\peek_meaning:NTF
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_G_aux:nNN #1#2#3
|
|
{
|
|
\tl_set:Nn \l__xparse_signature_tl {#1}
|
|
\exp_after:wN #2 \l__xparse_fn_tl ##1
|
|
{ \__xparse_add_arg:n {##1} }
|
|
#3 \c_group_begin_token
|
|
{ \l__xparse_fn_tl }
|
|
{ \__xparse_add_arg:o \c_novalue_tl }
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_l:w #1 \__xparse_run_code:
|
|
{ \__xparse_grab_l_aux:nN {#1} \cs_set_protected_nopar:Npn }
|
|
\cs_new_protected:Npn \__xparse_grab_l_long:w #1 \__xparse_run_code:
|
|
{ \__xparse_grab_l_aux:nN {#1} \cs_set_protected:Npn }
|
|
\cs_new_protected:Npn \__xparse_grab_l_aux:nN #1#2
|
|
{
|
|
\tl_set:Nn \l__xparse_signature_tl {#1}
|
|
\exp_after:wN #2 \l__xparse_fn_tl ##1##
|
|
{ \__xparse_add_arg:n {##1} }
|
|
\l__xparse_fn_tl
|
|
}
|
|
\cs_new_protected:Npn \__xparse_grab_u:w #1#2 \__xparse_run_code:
|
|
{ \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn }
|
|
\cs_new_protected:Npn \__xparse_grab_u_long:w #1#2 \__xparse_run_code:
|
|
{ \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected:Npn }
|
|
\cs_new_protected:Npn \__xparse_grab_u_aux:nnN #1#2#3
|
|
{
|
|
\tl_set:Nn \l__xparse_signature_tl {#2}
|
|
\exp_after:wN #3 \l__xparse_fn_tl ##1 #1
|
|
{ \__xparse_add_arg:n {##1} }
|
|
\l__xparse_fn_tl
|
|
}
|
|
%%
|
|
%%
|
|
%% End of file `xparse.sty'.
|
|
|