summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3doc.cls')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3doc.cls57
1 files changed, 54 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
index f65fc2134c6..9040af56ff9 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls
@@ -20,11 +20,15 @@
%%
%% File: l3doc.dtx Copyright (C) 1990-2017 The LaTeX3 project
\RequirePackage{expl3,xparse,calc}
-\ProvidesExplClass{l3doc}{2017/07/19}{}
+\ProvidesExplClass{l3doc}{2017/09/18}{}
{L3 Experimental documentation class}
\clist_new:N \g_docinput_clist
\seq_new:N \g_doc_functions_seq
\seq_new:N \g_doc_macros_seq
+\bool_new:N \l__codedoc_detect_internals_bool
+\bool_set_true:N \l__codedoc_detect_internals_bool
+\tl_new:N \l__codedoc_detect_internals_tl
+\tl_new:N \l__codedoc_detect_internals_cs_tl
\coffin_new:N \l__codedoc_output_coffin
\coffin_new:N \l__codedoc_functions_coffin
\coffin_new:N \l__codedoc_descr_coffin
@@ -123,8 +127,19 @@
{ \prg_return_true: }
}
\cs_generate_variant:Nn \__codedoc_if_almost_str:nT { V }
+\cs_new_protected:Npn \__codedoc_trim_right:Nn #1#2
+ {
+ \cs_set:Npn \__codedoc_tmp:w ##1 #2 ##2 \q_stop { \exp_not:n {##1} }
+ \tl_set:Nx #1 { \exp_after:wN \__codedoc_tmp:w #1 #2 \q_stop }
+ }
+\cs_generate_variant:Nn \__codedoc_trim_right:Nn { No }
\cs_new_protected:Npn \__codedoc_replace_at_at:N #1
{
+ \bool_if:NT \l__codedoc_in_implementation_bool
+ {
+ \bool_if:NT \l__codedoc_detect_internals_bool
+ { \__codedoc_detect_internals:N #1 }
+ }
\tl_if_empty:NF \g__codedoc_module_name_tl
{
\exp_args:NNo \__codedoc_replace_at_at_aux:Nn
@@ -141,6 +156,36 @@
\tl_replace_all:Nnn #1 { @ @ } { _ _ #2 }
\tl_replace_all:Nnn #1 { \token_to_str:N a a } { @ @ }
}
+\group_begin:
+ \char_set_catcode_active:N \^^M
+ \cs_new_protected:Npn \__codedoc_detect_internals:N #1
+ {
+ \tl_set_eq:NN \l__codedoc_detect_internals_tl #1
+ \tl_replace_all:Non \l__codedoc_detect_internals_tl { \token_to_str:N _ } { _ }
+ \seq_set_split:NnV \l__codedoc_tmpa_seq { _ _ } \l__codedoc_detect_internals_tl
+ \seq_pop_left:NN \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
+ \seq_map_variable:NNn \l__codedoc_tmpa_seq \l__codedoc_detect_internals_tl
+ {
+ \__codedoc_trim_right:No \l__codedoc_detect_internals_tl
+ \c_catcode_active_space_tl
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl ^^M
+ \tl_set_eq:NN \l__codedoc_detect_internals_cs_tl \l__codedoc_detect_internals_tl
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl _
+ \__codedoc_trim_right:Nn \l__codedoc_detect_internals_tl :
+ \__codedoc_trim_right:No \l__codedoc_detect_internals_tl { \token_to_str:N : }
+ \tl_if_empty:NF \l__codedoc_detect_internals_tl
+ {
+ \str_if_eq:NNF \l__codedoc_detect_internals_tl \g__codedoc_module_name_tl
+ {
+ \msg_warning:nnxxx { l3doc } { foreign-internal }
+ { \tl_to_str:N \l__codedoc_detect_internals_cs_tl }
+ { \tl_to_str:N \l__codedoc_detect_internals_tl }
+ { \tl_to_str:N \g__codedoc_module_name_tl }
+ }
+ }
+ }
+ }
+\group_end:
\cs_new:Npn \__codedoc_signature_base_form:n #1
{ \__codedoc_signature_base_form_aux:n #1 \q_stop }
\cs_new:Npn \__codedoc_signature_base_form_aux:n #1
@@ -310,6 +355,12 @@
The~'syntax'~environment~should~only~be~used~once~in~
a~'function'~environment.
}
+\msg_new:nnn { l3doc } { foreign-internal }
+ {
+ A~control~sequence~of~the~form~'...__#1'~was~used.~
+ It~should~only~be~used~in~the~module~'#2'
+ \tl_if_empty:nF {#3} { ,~not~in~'#3' } .
+ }
\DeclareOption { a5paper } { \@latexerr { Option~not~supported } { } }
\DeclareOption { full }
{
@@ -939,7 +990,7 @@
\cs_new_protected:Npn \__codedoc_function_assemble:
{
\hcoffin_set:Nn \l__codedoc_syntax_coffin
- { \box_use_clear:N \g__codedoc_syntax_box }
+ { \box_use_drop:N \g__codedoc_syntax_box }
\bool_if:NTF \l__codedoc_long_name_bool
{
\coffin_join:NnnNnnnn
@@ -1106,7 +1157,7 @@
{
\begin{quote}
\mode_leave_vertical:
- \box_use_clear:N \g__codedoc_syntax_box
+ \box_use_drop:N \g__codedoc_syntax_box
\end{quote}
}
}