summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-02-23 21:54:14 +0000
committerKarl Berry <karl@freefriends.org>2018-02-23 21:54:14 +0000
commit87d871a3d83784d48b71fa3712b9f525bfc710d2 (patch)
treef12f9ffdc697b5af9ee14c06874ec0e2f72c9f94 /Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
parentccc63194ce7813106830c8a8755c54d89de831b4 (diff)
l3 (22feb18)
git-svn-id: svn://tug.org/texlive/trunk@46720 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3doc.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3doc.dtx84
1 files changed, 54 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
index 7f600a15642..4341ff018a1 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3doc.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3doc.dtx Copyright (C) 1990-2017 The LaTeX3 project
+%% File: l3doc.dtx Copyright (C) 1990-2018 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
@@ -70,14 +70,14 @@ and all files in that bundle must be distributed together.
% This isn't included in the typeset documentation because it's a bit
% ugly:
%<*class>
-\ProvidesExplClass{l3doc}{2017/12/16}{}
+\ProvidesExplClass{l3doc}{2018/02/21}{}
{L3 Experimental documentation class}
%</class>
% \fi
%
% \title{The \cls{l3doc} class}
% \author{\Team}
-% \date{Released 2017/12/16}
+% \date{Released 2018/02/21}
% \maketitle
% \tableofcontents
%
@@ -949,7 +949,7 @@ and all files in that bundle must be distributed together.
\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNT { o }
\cs_generate_variant:Nn \tl_if_head_eq_charcode:nNF { o }
\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNF { V }
-\cs_generate_variant:Nn \tl_if_in:nnTF { no }
+\cs_generate_variant:Nn \tl_if_in:nnTF { no , oo }
\cs_generate_variant:Nn \tl_if_in:NnTF { No }
\cs_generate_variant:Nn \tl_if_in:NnT { No }
\cs_generate_variant:Nn \tl_if_in:NnF { No }
@@ -995,6 +995,22 @@ and all files in that bundle must be distributed together.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[TF]{\@@_str_if_begin:nn, \@@_str_if_begin:oo}
+% True if the first string starts with the second.
+% \begin{macrocode}
+\prg_new_protected_conditional:Npnn \@@_str_if_begin:nn #1#2 { TF , T , F }
+ {
+ \tl_if_in:ooTF
+ { \exp_after:wN \scan_stop: \tl_to_str:n {#1} }
+ { \exp_after:wN \scan_stop: \tl_to_str:n {#2} }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+\prg_generate_conditional_variant:Nnn \@@_str_if_begin:nn
+ { oo } { TF , T , F }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_replace_at_at:N}
% \begin{macro}{\@@_replace_at_at_aux:Nn}
% The goal is to replace |@@| by the current module name. We take
@@ -1035,14 +1051,16 @@ and all files in that bundle must be distributed together.
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@@_detect_internals:N}
+% \begin{macro}{\@@_detect_internals:N, \@@_if_detect_internals_ok:NF}
% After splitting at each |__| and removing the leading item from the
% sequence (since it does not follow |__|), remove everything after
% any space or end-of-line to get a good approximation of the control
-% sequence (for the warning message), then remove anything after any
-% |_| or |:| (with either catcode) to get the module name. If that
-% name is not empty and differs from the current |@@| name then
-% complain.
+% sequence (for the warning message). Then check if that starts with
+% something allowed: |@@| module name and |:| or |_|, or if the
+% relevant boolean is set |kernel_| (it seems safe to assume we will
+% not define a |\__kernel:...| command). For the message itself
+% remove anything after any |_| or |:| (with either catcode) to get a
+% guess of the module name.
% \begin{macrocode}
\group_begin:
\char_set_catcode_active:N \^^M
@@ -1057,32 +1075,38 @@ and all files in that bundle must be distributed together.
\@@_trim_right:No \l_@@_detect_internals_tl
\c_catcode_active_space_tl
\@@_trim_right:Nn \l_@@_detect_internals_tl ^^M
- \tl_set_eq:NN \l_@@_detect_internals_cs_tl \l_@@_detect_internals_tl
- \@@_trim_right:Nn \l_@@_detect_internals_tl _
- \@@_trim_right:Nn \l_@@_detect_internals_tl :
- \@@_trim_right:No \l_@@_detect_internals_tl { \token_to_str:N : }
- \tl_if_empty:NF \l_@@_detect_internals_tl
+ \@@_if_detect_internals_ok:NF \l_@@_detect_internals_tl
{
- \str_if_eq:NNF \l_@@_detect_internals_tl \g_@@_module_name_tl
- {
- \bool_lazy_and:nnF
- { \g_@@_kernel_bool }
- {
- \str_if_eq_x_p:nn
- { \tl_to_str:N \l_@@_detect_internals_tl }
- { kernel }
- }
- {
- \msg_warning:nnxxx { l3doc } { foreign-internal }
- { \tl_to_str:N \l_@@_detect_internals_cs_tl }
- { \tl_to_str:N \l_@@_detect_internals_tl }
- { \tl_to_str:N \g_@@_module_name_tl }
- }
- }
+ \tl_set_eq:NN \l_@@_detect_internals_cs_tl \l_@@_detect_internals_tl
+ \@@_trim_right:Nn \l_@@_detect_internals_tl _
+ \@@_trim_right:Nn \l_@@_detect_internals_tl :
+ \@@_trim_right:No \l_@@_detect_internals_tl { \token_to_str:N : }
+ \msg_warning:nnxxx { l3doc } { foreign-internal }
+ { \tl_to_str:N \l_@@_detect_internals_cs_tl }
+ { \tl_to_str:N \l_@@_detect_internals_tl }
+ { \tl_to_str:N \g_@@_module_name_tl }
}
}
}
\group_end:
+\prg_new_protected_conditional:Npnn \@@_if_detect_internals_ok:N #1 { F }
+ {
+ \@@_str_if_begin:ooTF {#1} { \g_@@_module_name_tl _ }
+ { \prg_return_true: }
+ {
+ \@@_str_if_begin:ooTF {#1} { \g_@@_module_name_tl : }
+ { \prg_return_true: }
+ {
+ \bool_if:NTF \g_@@_kernel_bool
+ {
+ \@@_str_if_begin:ooTF {#1} { kernel _ }
+ { \prg_return_true: }
+ { \prg_return_false: }
+ }
+ { \prg_return_false: }
+ }
+ }
+ }
% \end{macrocode}
% \end{macro}
%