Debian Codegraph @

texmf-dist/tex/latex/l3packages/xparse/xparse-2020-10-01.sty

raw
1 %%
2 %% This is file `xparse-2020-10-01.sty', generated from
3 %% xparse.dtx (with options: `package', on 2021-01-20)
4 %% then adapted and frozen for compatibility. Development of
5 %% xparse.dtx will continue in the LaTeX2e kernel as ltcmd.dtx.
6 %%
7 %% Copyright (C) 2009-2021 The LaTeX Project
8 %%
9 %% It may be distributed and/or modified under the conditions of
10 %% the LaTeX Project Public License (LPPL), either version 1.3c of
11 %% this license or (at your option) any later version. The latest
12 %% version of this license is in the file:
13 %%
14 %% http://www.latex-project.org/lppl.txt
15 %%
16 %% This file is part of the "l3packages bundle" (The Work in LPPL)
17 %% and all files in that bundle must be distributed together.
18 %%
19 %% File: xparse.dtx
20 \RequirePackage{expl3}[2018-04-12]
21 \@ifpackagelater{expl3}{2018-04-12}
22 {}
23 {%
24 \PackageError{xparse}{Support package l3kernel too old}
25 {%
26 Please install an up to date version of l3kernel\MessageBreak
27 using your TeX package manager or from CTAN.\MessageBreak
28 \MessageBreak
29 Loading xparse will abort!%
30 }%
31 \endinput
32 }
33 % \ProvidesExplPackage{xparse}{2021-01-09}{}
34 % {L3 Experimental document command parser}
35 \expandafter\protected@xdef\csname [email protected]\endcsname
36 {2021-01-09 L3 Experimental document command parser}
37 \ExplSyntaxOn
38 \clist_new:N \l__xparse_options_clist
39 \DeclareOption* { \clist_put_right:NV \l__xparse_options_clist \CurrentOption }
40 \ProcessOptions \relax
41 \keys_define:nn { xparse }
42 {
43 log-declarations .bool_set:N = \l__xparse_log_bool ,
44 log-declarations .initial:n = false
45 }
46 \keys_set:nV { xparse } \l__xparse_options_clist
47 \bool_if:NF \l__xparse_log_bool
48 { \msg_redirect_module:nnn { LaTeX / xparse } { info } { none } }
49 \input xparse-generic.tex ~
50 \cs_gset_protected:Npn \__xparse_normalize_arg_spec_loop:n #1
51 {
52 \quark_if_recursion_tail_stop:n {#1}
53 \int_incr:N \l__xparse_current_arg_int
54 \cs_if_exist_use:cF { __xparse_normalize_type_ \tl_to_str:n {#1} :w }
55 {
56 \__kernel_msg_error:nnxx { xparse } { unknown-argument-type }
57 { \__xparse_environment_or_command: } { \tl_to_str:n {#1} }
58 \__xparse_bad_def:wn
59 }
60 }
61 \cs_new_protected:Npx \__xparse_normalize_type_g:w
62 { \exp_not:N \__xparse_normalize_type_G:w { \exp_not:V \c_novalue_tl } }
63 \cs_new_protected:Npn \__xparse_normalize_type_G:w #1
64 {
65 \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
66 \__xparse_normalize_check_gv:N G
67 \__xparse_add_arg_spec:n { G {#1} }
68 \tl_put_right:Nn \l__xparse_last_delimiters_tl { { } }
69 \__xparse_normalize_arg_spec_loop:n
70 }
71 \cs_new_protected:Npn \__xparse_normalize_type_l:w
72 {
73 \__xparse_normalize_check_lu:N l
74 \__xparse_add_arg_spec_mandatory:n { l }
75 \__xparse_normalize_arg_spec_loop:n
76 }
77 \cs_new_protected:Npn \__xparse_normalize_type_u:w #1
78 {
79 \quark_if_recursion_tail_stop_do:nn {#1} { \__xparse_bad_arg_spec:wn }
80 \__xparse_normalize_check_lu:N u
81 \__xparse_add_arg_spec_mandatory:n { u {#1} }
82 \__xparse_normalize_arg_spec_loop:n
83 }
84 \cs_new_protected:Npn \__xparse_add_type_G:w #1
85 {
86 \__xparse_flush_m_args:
87 \__xparse_add_default:n {#1}
88 \__xparse_add_grabber:N G
89 \__xparse_prepare_signature:N
90 }
91 \cs_new_protected:Npn \__xparse_add_type_l:w
92 {
93 \__xparse_flush_m_args:
94 \__xparse_add_default:
95 \__xparse_add_grabber:N l
96 \__xparse_prepare_signature:N
97 }
98 \cs_new_protected:Npn \__xparse_add_type_u:w #1
99 {
100 \__xparse_flush_m_args:
101 \__xparse_add_default:
102 \__xparse_add_grabber:N u
103 \tl_put_right:Nn \l__xparse_signature_tl { {#1} }
104 \__xparse_prepare_signature:N
105 }
106 \cs_new_protected:Npn \__xparse_add_expandable_type_l:w
107 { \__xparse_add_expandable_type_u:w ## }
108 \cs_new_protected:Npn \__xparse_add_expandable_type_u:w #1
109 {
110 \__xparse_add_default:
111 \bool_if:NTF \l__xparse_long_bool
112 { \cs_set:cpn }
113 { \cs_set_nopar:cpn }
114 { \l__xparse_expandable_aux_name_tl } ##1 \q__xparse ##2 ##3 ##4 #1
115 { ##1 {##4} \q__xparse ##2 ##3 }
116 \__xparse_add_expandable_grabber:nn { u }
117 { \exp_not:c { \l__xparse_expandable_aux_name_tl } }
118 \__xparse_prepare_signature:N
119 }
120 \cs_new_protected:Npn \__xparse_grab_G:w #1 \__xparse_run_code:
121 {
122 \__xparse_grab_G_aux:nNN {#1} \cs_set_protected_nopar:Npn
123 \__xparse_peek_nonspace:NTF
124 }
125 \cs_new_protected:Npn \__xparse_grab_G_long:w #1 \__xparse_run_code:
126 {
127 \__xparse_grab_G_aux:nNN {#1} \cs_set_protected:Npn
128 \__xparse_peek_nonspace:NTF
129 }
130 \cs_new_protected:Npn \__xparse_grab_G_obey_spaces:w #1 \__xparse_run_code:
131 {
132 \__xparse_grab_G_aux:nNN {#1} \cs_set_protected_nopar:Npn
133 \peek_meaning:NTF
134 }
135 \cs_new_protected:Npn \__xparse_grab_G_long_obey_spaces:w #1 \__xparse_run_code:
136 {
137 \__xparse_grab_G_aux:nNN {#1} \cs_set_protected:Npn
138 \peek_meaning:NTF
139 }
140 \cs_new_protected:Npn \__xparse_grab_G_aux:nNN #1#2#3
141 {
142 \tl_set:Nn \l__xparse_signature_tl {#1}
143 \exp_after:wN #2 \l__xparse_fn_tl ##1
144 { \__xparse_add_arg:n {##1} }
145 #3 \c_group_begin_token
146 { \l__xparse_fn_tl }
147 { \__xparse_add_arg:o \c_novalue_tl }
148 }
149 \cs_new_protected:Npn \__xparse_grab_l:w #1 \__xparse_run_code:
150 { \__xparse_grab_l_aux:nN {#1} \cs_set_protected_nopar:Npn }
151 \cs_new_protected:Npn \__xparse_grab_l_long:w #1 \__xparse_run_code:
152 { \__xparse_grab_l_aux:nN {#1} \cs_set_protected:Npn }
153 \cs_new_protected:Npn \__xparse_grab_l_aux:nN #1#2
154 {
155 \tl_set:Nn \l__xparse_signature_tl {#1}
156 \exp_after:wN #2 \l__xparse_fn_tl ##1##
157 { \__xparse_add_arg:n {##1} }
158 \l__xparse_fn_tl
159 }
160 \cs_new_protected:Npn \__xparse_grab_u:w #1#2 \__xparse_run_code:
161 { \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected_nopar:Npn }
162 \cs_new_protected:Npn \__xparse_grab_u_long:w #1#2 \__xparse_run_code:
163 { \__xparse_grab_u_aux:nnN {#1} {#2} \cs_set_protected:Npn }
164 \cs_new_protected:Npn \__xparse_grab_u_aux:nnN #1#2#3
165 {
166 \tl_set:Nn \l__xparse_signature_tl {#2}
167 \exp_after:wN #3 \l__xparse_fn_tl ##1 #1
168 { \__xparse_add_arg:n {##1} }
169 \l__xparse_fn_tl
170 }
171 \cs_new_eq:NN \__xparse_expandable_grab_u:w \prg_do_nothing:
172 %%
173 %%
174 %% End of file `xparse-2020-10-01.sty'.