diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-23 17:15:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-23 17:15:00 +0000 |
commit | 134349701bddf7cbbacf6030c6b9f9838aff96fa (patch) | |
tree | ec1140c46e1c0347a671a6fa3cf8af5a79e95f93 /Master/texmf-dist/tex/latex/l3kernel/l3msg.sty | |
parent | f7855c12c18bb97b7b9e49ab685ee558d8c0b47b (diff) |
l3kernel 3990 (17jul12)
git-svn-id: svn://tug.org/texlive/trunk@27108 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3msg.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3msg.sty | 830 |
1 files changed, 422 insertions, 408 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty index 2e5ae99d6a4..bfce368f0d0 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/l3msg.sty @@ -46,59 +46,59 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3msg.dtx 3568 2012-04-23 13:23:58Z joseph $ - {L3 Experimental messages} +\GetIdInfo$Id: l3msg.dtx 3986 2012-07-15 19:23:51Z joseph $ + {L3 Messages} \ProvidesExplPackage {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription} -\package_check_loaded_expl: -\tl_new:N \l_msg_internal_tl -\tl_const:Nn \c_msg_text_prefix_tl { msg~text~>~ } -\tl_const:Nn \c_msg_more_text_prefix_tl { msg~extra~text~>~ } +\__expl_package_check: +\tl_new:N \l__msg_internal_tl +\tl_const:Nn \c__msg_text_prefix_tl { msg~text~>~ } +\tl_const:Nn \c__msg_more_text_prefix_tl { msg~extra~text~>~ } \prg_new_conditional:Npnn \msg_if_exist:nn #1#2 { p , T , F , TF } { - \cs_if_exist:cTF { \c_msg_text_prefix_tl #1 / #2 } + \cs_if_exist:cTF { \c__msg_text_prefix_tl #1 / #2 } { \prg_return_true: } { \prg_return_false: } } -\cs_new_protected:Npn \chk_if_free_msg:nn #1#2 +\cs_new_protected:Npn \__chk_if_free_msg:nn #1#2 { \msg_if_exist:nnT {#1} {#2} { - \msg_kernel_error:nnxx { msg } { message-already-defined } + \__msg_kernel_error:nnxx { kernel } { message-already-defined } {#1} {#2} } } \tex_ifodd:D \l@expl@log@functions@bool - \cs_gset_protected:Npn \chk_if_free_msg:nn #1#2 + \cs_gset_protected:Npn \__chk_if_free_msg:nn #1#2 { \msg_if_exist:nnT {#1} {#2} { - \msg_kernel_error:nnxx { msg } { message-already-defined } + \__msg_kernel_error:nnxx { kernel } { message-already-defined } {#1} {#2} } - \iow_log:x { Defining~message~#1/#2~ \msg_line_context: } + \iow_log:x { Defining~message~ #1 / #2 ~\msg_line_context: } } \fi: \cs_new_protected:Npn \msg_new:nnnn #1#2 { - \chk_if_free_msg:nn {#1} {#2} + \__chk_if_free_msg:nn {#1} {#2} \msg_gset:nnnn {#1} {#2} } \cs_new_protected:Npn \msg_new:nnn #1#2#3 { \msg_new:nnnn {#1} {#2} {#3} { } } \cs_new_protected:Npn \msg_set:nnnn #1#2#3#4 { - \cs_set:cpn { \c_msg_text_prefix_tl #1 / #2 } + \cs_set:cpn { \c__msg_text_prefix_tl #1 / #2 } ##1##2##3##4 {#3} - \cs_set:cpn { \c_msg_more_text_prefix_tl #1 / #2 } + \cs_set:cpn { \c__msg_more_text_prefix_tl #1 / #2 } ##1##2##3##4 {#4} } \cs_new_protected:Npn \msg_set:nnn #1#2#3 { \msg_set:nnnn {#1} {#2} {#3} { } } \cs_new_protected:Npn \msg_gset:nnnn #1#2#3#4 { - \cs_gset:cpn { \c_msg_text_prefix_tl #1 / #2 } + \cs_gset:cpn { \c__msg_text_prefix_tl #1 / #2 } ##1##2##3##4 {#3} - \cs_gset:cpn { \c_msg_more_text_prefix_tl #1 / #2 } + \cs_gset:cpn { \c__msg_more_text_prefix_tl #1 / #2 } ##1##2##3##4 {#4} } \cs_new_protected:Npn \msg_gset:nnn #1#2#3 @@ -135,8 +135,6 @@ More~errors~will~almost~certainly~follow: \\ the~LaTeX~run~should~be~aborted. } -\cs_new_nopar:Npn \msg_newline: { ^^J } -\cs_new_nopar:Npn \msg_two_newlines: { ^^J ^^J } \cs_new_nopar:Npn \msg_line_number: { \int_use:N \tex_inputlineno:D } \cs_gset_nopar:Npn \msg_line_context: { @@ -144,24 +142,24 @@ \c_space_tl \msg_line_number: } -\cs_new_protected:Npn \msg_interrupt:xxx #1#2#3 +\cs_new_protected:Npn \msg_interrupt:nnn #1#2#3 { \tl_if_empty:nTF {#3} { - \msg_interrupt_wrap:xx { \\ \c_msg_no_info_text_tl } + \__msg_interrupt_wrap:nn { \\ \c_msg_no_info_text_tl } {#1 \\\\ #2 \\\\ \c_msg_continue_text_tl } } { - \msg_interrupt_wrap:xx { \\ #3 } + \__msg_interrupt_wrap:nn { \\ #3 } {#1 \\\\ #2 \\\\ \c_msg_help_text_tl } } } -\cs_new_protected:Npn \msg_interrupt_wrap:xx #1#2 +\cs_new_protected:Npn \__msg_interrupt_wrap:nn #1#2 { - \iow_wrap:xnnnN {#1} { | ~ } { 2 } { } \msg_interrupt_more_text:n - \iow_wrap:xnnnN {#2} { ! ~ } { 2 } { } \msg_interrupt_text:n + \iow_wrap:nnnN {#1} { | ~ } { } \__msg_interrupt_more_text:n + \iow_wrap:nnnN {#2} { ! ~ } { } \__msg_interrupt_text:n } -\cs_new_protected:Npn \msg_interrupt_more_text:n #1 +\cs_new_protected:Npn \__msg_interrupt_more_text:n #1 { \exp_args:Nx \tex_errhelp:D { @@ -175,13 +173,10 @@ \char_set_lccode:nn {`\}} {`\ } \char_set_lccode:nn {`\&} {`\!} \char_set_catcode_active:N \& - \char_set_catcode_letter:N \. - \tl_new:N - \c_msg_hide_tl............................................ \tl_to_lowercase:n { \group_end: - \cs_new_protected:Npn \msg_interrupt_text:n #1 + \cs_new_protected:Npn \__msg_interrupt_text:n #1 { \iow_term:x { @@ -196,7 +191,8 @@ \tex_errmessage:D { #1 - \c_msg_hide_tl............................................ + \use_none:n + { ............................................ } } } \exp_after:wN @@ -204,347 +200,314 @@ & } } -\cs_new_protected:Npn \msg_log:x #1 +\cs_new_protected:Npn \msg_log:n #1 { - \iow_log:x { ................................................. } - \iow_wrap:xnnnN { . ~ #1} { . ~ } { 2 } { } - \iow_log:x - \iow_log:x { ................................................. } + \iow_log:n { ................................................. } + \iow_wrap:nnnN { . ~ #1} { . ~ } { } \iow_log:n + \iow_log:n { ................................................. } } -\cs_new_protected:Npn \msg_term:x #1 +\cs_new_protected:Npn \msg_term:n #1 { - \iow_term:x { ************************************************* } - \iow_wrap:xnnnN { * ~ #1} { * ~ } { 2 } { } - \iow_term:x - \iow_term:x { ************************************************* } + \iow_term:n { ************************************************* } + \iow_wrap:nnnN { * ~ #1} { * ~ } { } \iow_term:n + \iow_term:n { ************************************************* } } -\int_gset:Nn \tex_errorcontextlines:D { -1 } \cs_new:Npn \msg_fatal_text:n #1 { Fatal~#1~error } \cs_new:Npn \msg_critical_text:n #1 { Critical~#1~error } \cs_new:Npn \msg_error_text:n #1 { #1~error } \cs_new:Npn \msg_warning_text:n #1 { #1~warning } \cs_new:Npn \msg_info_text:n #1 { #1~info } \cs_new:Npn \msg_see_documentation_text:n #1 - { \\ \\ See~the~#1~documentation~for~further~information. } -\cs_new_protected:Npn \msg_class_set:nn #1#2 - { - \prop_clear_new:c { l_msg_redirect_ #1 _prop } - \cs_set_protected:cpn { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 - { \msg_use:nnnnxxxx {#1} {#2} {##1} {##2} {##3} {##4} {##5} {##6} } - \cs_set_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5 - { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } - \cs_set_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4 - { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } - \cs_set_protected:cpx { msg_ #1 :nnx } ##1##2##3 - { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } - \cs_set_protected:cpx { msg_ #1 :nn } ##1##2 - { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} { } { } { } { } } - } -\prg_new_conditional:Npnn \msg_if_more_text:N #1 { p , T , F , TF } - { - \cs_if_eq:NNTF #1 \msg_no_more_text:xxxx - { \prg_return_false: } - { \prg_return_true: } - } -\cs_new:Npn \msg_no_more_text:xxxx #1#2#3#4 { } -\cs_generate_variant:Nn \msg_if_more_text_p:N { c } -\cs_generate_variant:Nn \msg_if_more_text:NT { c } -\cs_generate_variant:Nn \msg_if_more_text:NF { c } -\cs_generate_variant:Nn \msg_if_more_text:NTF { c } -\msg_class_set:nn { fatal } { - \msg_interrupt:xxx - { \msg_fatal_text:n {#1} : ~ "#2" } - { - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n {#1} - } - { \c_msg_fatal_text_tl } - \tex_end:D + \\ \\ See~the~ + \str_if_eq:nnTF {#1} { LaTeX } { LaTeX3 } {#1} ~ + documentation~for~further~information. } -\msg_class_set:nn { critical } +\group_begin: + \cs_set_protected:Npn \__msg_class_new:nn #1#2 + { + \prop_new:c { l__msg_redirect_ #1 _prop } + \cs_new_protected:cpn { __msg_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2} + \cs_new_protected:cpn { msg_ #1 :nnnnnn } ##1##2##3##4##5##6 + { + \__msg_use:nnnnnnn {#1} {##1} {##2} + { \tl_to_str:n {##3} } { \tl_to_str:n {##4} } + { \tl_to_str:n {##5} } { \tl_to_str:n {##6} } + } + \cs_new_protected:cpx { msg_ #1 :nnnnn } ##1##2##3##4##5 + { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { msg_ #1 :nnnn } ##1##2##3##4 + { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { msg_ #1 :nnn } ##1##2##3 + { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } } + \cs_new_protected:cpx { msg_ #1 :nn } ##1##2 + { \exp_not:c { msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } } + \cs_new_protected:cpn { msg_ #1 :nnxxxx } ##1##2##3##4##5##6 + { + \use:x + { + \__msg_use:nnnnnnn + { \exp_not:n {#1} } { \exp_not:n {##1} } { \exp_not:n {##2} } + {##3} {##4} {##5} {##6} + } + } + \cs_new_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { msg_ #1 :nnx } ##1##2##3 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } + } + \__msg_class_new:nn { fatal } + { + \msg_interrupt:nnn + { \msg_fatal_text:n {#1} : ~ "#2" } + { + \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + \msg_see_documentation_text:n {#1} + } + { \c_msg_fatal_text_tl } + \tex_end:D + } + \__msg_class_new:nn { critical } + { + \msg_interrupt:nnn + { \msg_critical_text:n {#1} : ~ "#2" } + { + \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + \msg_see_documentation_text:n {#1} + } + { \c_msg_critical_text_tl } + \tex_endinput:D + } + \__msg_class_new:nn { error } + { + \__msg_error:cnnnnn + { \c__msg_more_text_prefix_tl #1 / #2 } + {#3} {#4} {#5} {#6} + { + \msg_interrupt:nnn + { \msg_error_text:n {#1} : ~ "#2" } + { + \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + \msg_see_documentation_text:n {#1} + } + } + } + \cs_new_protected:Npn \__msg_error:cnnnnn #1#2#3#4#5#6 + { + \cs_if_eq:cNTF {#1} \__msg_no_more_text:nnnn + { #6 { } } + { #6 { \use:c {#1} {#2} {#3} {#4} {#5} } } + } + \cs_new:Npn \__msg_no_more_text:nnnn #1#2#3#4 { } + \__msg_class_new:nn { warning } + { + \msg_term:n + { + \msg_warning_text:n {#1} : ~ "#2" \\ \\ + \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + } + } + \__msg_class_new:nn { info } + { + \msg_log:n + { + \msg_info_text:n {#1} : ~ "#2" \\ \\ + \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + } + } + \__msg_class_new:nn { log } + { + \iow_wrap:nnnN + { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } + { } { } \iow_log:n + } + \__msg_class_new:nn { none } { } +\group_end: +\cs_new:Npn \__msg_class_chk_exist:nT #1 { - \msg_interrupt:xxx - { \msg_critical_text:n {#1} : ~ "#2" } - { - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n {#1} - } - { \c_msg_critical_text_tl } - \tex_endinput:D + \cs_if_free:cTF { __msg_ #1 _code:nnnnnn } + { \__msg_kernel_error:nnx { kernel } { message-class-unknown } {#1} } } -\msg_class_set:nn { error } +\tl_new:N \l__msg_class_tl +\tl_new:N \l__msg_current_class_tl +\prop_new:N \l__msg_redirect_prop +\seq_new:N \l__msg_hierarchy_seq +\seq_new:N \l__msg_class_loop_seq +\cs_new_protected:Npn \__msg_use:nnnnnnn #1#2#3#4#5#6#7 { - \msg_if_more_text:cTF { \c_msg_more_text_prefix_tl #1 / #2 } + \msg_if_exist:nnTF {#2} {#3} { - \msg_interrupt:xxx - { \msg_error_text:n {#1} : ~ "#2" } + \__msg_class_chk_exist:nT {#1} { - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n {#1} - } - { \use:c { \c_msg_more_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } - } - { - \msg_interrupt:xxx - { \msg_error_text:n {#1} : ~ "#2" } - { - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n {#1} + \tl_set:Nn \l__msg_current_class_tl {#1} + \cs_set_protected_nopar:Npx \__msg_use_code: + { + \exp_not:n + { + \use:c { __msg_ \l__msg_class_tl _code:nnnnnn } + {#2} {#3} {#4} {#5} {#6} {#7} + } + } + \__msg_use_redirect_name:n { #2 / #3 } } - { } - } - } -\msg_class_set:nn { warning } - { - \msg_term:x - { - \msg_warning_text:n {#1} : ~ "#2" \\ \\ - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } + { \__msg_kernel_error:nnxx { kernel } { message-unknown } {#2} {#3} } } -\msg_class_set:nn { info } +\cs_new_protected_nopar:Npn \__msg_use_code: { } +\cs_new_protected:Npn \__msg_use_redirect_name:n #1 { - \msg_log:x + \prop_get:NnNTF \l__msg_redirect_prop { / #1 } \l__msg_class_tl + { \__msg_use_code: } { - \msg_info_text:n {#1} : ~ "#2" \\ \\ - \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} + \seq_clear:N \l__msg_hierarchy_seq + \__msg_use_hierarchy:nwwN { } + #1 \q_mark \__msg_use_hierarchy:nwwN + / \q_mark \use_none_delimit_by_q_stop:w + \q_stop + \__msg_use_redirect_module:n { } } } -\msg_class_set:nn { log } +\cs_new_protected:Npn \__msg_use_hierarchy:nwwN #1#2 / #3 \q_mark #4 { - \msg_log:x - { \use:c { \c_msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } + \seq_put_left:Nn \l__msg_hierarchy_seq {#1} + #4 { #1 / #2 } #3 \q_mark #4 } -\msg_class_set:nn { none } { } -\tl_new:N \l_msg_class_tl -\tl_new:N \l_msg_current_class_tl -\prop_new:N \l_msg_redirect_classes_prop -\prop_new:N \l_msg_redirect_names_prop -\prop_new:N \l_msg_redirect_prop -\bool_new:N \l_msg_use_direct_bool -\cs_new_protected:Npn \msg_use:nnnnxxxx #1#2#3#4#5#6#7#8 +\cs_new_protected:Npn \__msg_use_redirect_module:n #1 { - \msg_if_exist:nnTF {#3} {#4} + \seq_map_inline:Nn \l__msg_hierarchy_seq { - \cs_if_exist:cTF { msg_ #1 :nnxxxx } + \prop_get:cnNTF { l__msg_redirect_ \l__msg_current_class_tl _prop } + {##1} \l__msg_class_tl { - \tl_set:Nn \l_msg_current_class_tl {#1} - \cs_set_protected_nopar:Npx \msg_use_code: { \exp_not:n {#2} } - \cs_set_protected_nopar:Npn \msg_use_or_change_class: + \seq_map_break:n { - \tl_if_eq:NNTF \l_msg_current_class_tl \l_msg_class_tl - { \msg_use_code: } + \tl_if_eq:NNTF \l__msg_current_class_tl \l__msg_class_tl + { \__msg_use_code: } { - \use:c { msg_ \l_msg_class_tl :nnxxxx } - {#3} {#4} {#5} {#6} {#7} {#8} + \tl_set_eq:NN \l__msg_current_class_tl \l__msg_class_tl + \__msg_use_redirect_module:n {##1} } } - \bool_if:NTF \l_msg_use_direct_bool + } + { + \str_if_eq:nnT {##1} {#1} { - \bool_set_false:N \l_msg_use_direct_bool - \msg_use_code: + \tl_set_eq:NN \l__msg_class_tl \l__msg_current_class_tl + \seq_map_break:n { \__msg_use_code: } } - { \msg_use_aux_i:nn {#3} {#4} } } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#1} } } - { \msg_kernel_error:nnxx { msg } { message-unknown } {#3} {#4} } } -\cs_new_protected_nopar:Npn \msg_use_code: { } -\cs_new_protected_nopar:Npn \msg_use_or_change_class: { } -\cs_new_protected:Npn \msg_use_aux_i:nn #1#2 +\cs_new_protected:Npn \msg_redirect_name:nnn #1#2#3 { - \prop_get:NnNTF \l_msg_redirect_prop { #1 / #2 } \l_msg_class_tl + \tl_if_empty:nTF {#3} + { \prop_remove:Nn \l__msg_redirect_prop { / #1 / #2 } } { - \bool_set_true:N \l_msg_use_direct_bool - \msg_use_or_change_class: + \__msg_class_chk_exist:nT {#3} + { \prop_put:Nnn \l__msg_redirect_prop { / #1 / #2 } {#3} } } - { \msg_use_aux_ii:nn {#1} {#2} } } -\cs_new_protected:Npn \msg_use_aux_ii:nn #1#2 +\cs_new_protected_nopar:Npn \msg_redirect_class:nn + { \__msg_redirect:nnn { } } +\cs_new_protected:Npn \msg_redirect_module:nnn #1 + { \__msg_redirect:nnn { / #1 } } +\cs_new_protected:Npn \__msg_redirect:nnn #1#2#3 { - \prop_get:coNTF { l_msg_redirect_ \l_msg_current_class_tl _ prop } - { \msg_use_aux_iii:w #1 / #2 / \q_stop } \l_msg_class_tl - { \msg_use_or_change_class: } + \__msg_class_chk_exist:nT {#2} { - \prop_get:coNTF { l_msg_redirect_ \l_msg_current_class_tl _ prop } - { \msg_use_aux_iv:w #1 / #2 \q_stop } \l_msg_class_tl - { \msg_use_or_change_class: } - { \msg_use_aux_v: } - } - } -\cs_new:Npn \msg_use_aux_iii:w #1 / #2 / #3 \q_stop { #1 / #2 } -\cs_new:Npn \msg_use_aux_iv:w #1 / #2 \q_stop { #1 } -\cs_new_protected:Npn \msg_use_aux_v: - { - \prop_get:cnNF { l_msg_redirect_ \l_msg_current_class_tl _ prop } - { * } \l_msg_class_tl - { \tl_set_eq:NN \l_msg_class_tl \l_msg_current_class_tl } - \msg_use_or_change_class: - } -\cs_new_protected:Npn \msg_redirect_class:nn #1#2 - { - \cs_if_exist:cTF { msg_ #1 :nnxxxx } - { - \cs_if_exist:cTF { msg_ #2 :nnxxxx } + \tl_if_empty:nTF {#3} + { \prop_remove:cn { l__msg_redirect_ #2 _prop } {#1} } { - \tl_set:Nn \l_msg_current_class_tl {#1} - \msg_redirect_class_aux:nnn {#1} {#2} {#2} + \__msg_class_chk_exist:nT {#3} + { + \prop_put:cnn { l__msg_redirect_ #2 _prop } {#1} {#3} + \tl_set:Nn \l__msg_current_class_tl {#2} + \seq_clear:N \l__msg_class_loop_seq + \__msg_redirect_loop_chk:nnn {#2} {#3} {#1} + } } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#2} } } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#1} } } -\cs_new_protected:Npn \msg_redirect_class_aux:nnn #1#2#3 +\cs_new_protected:Npn \__msg_redirect_loop_chk:nnn #1#2#3 { - \prop_get:cnNTF { l_msg_redirect_ #2 _prop } { * } \l_msg_class_tl + \seq_put_right:Nn \l__msg_class_loop_seq {#1} + \prop_get:cnNT { l__msg_redirect_ #1 _prop } {#3} \l__msg_class_tl { - \tl_if_eq:NNTF \l_msg_class_tl \l_msg_current_class_tl - { \msg_kernel_error:nnxx { msg } { message-loop } {#1} {#3} } - { \msg_redirect_class_aux:nVn {#1} \l_msg_class_tl {#3} } - } - { \prop_put:cnn { l_msg_redirect_ #1 _prop } { * } {#3} } - } -\cs_generate_variant:Nn \msg_redirect_class_aux:nnn { nV } -\cs_new_protected:Npn \msg_redirect_module:nnn #1#2#3 - { - \cs_if_exist:cTF { msg_ #2 :nnxxxx } - { - \cs_if_exist:cTF { msg_ #3 :nnxxxx } + \str_if_eq_x:nnF { \l__msg_class_tl } {#1} { - \tl_set:Nn \l_msg_current_class_tl {#1} - \msg_redirect_module_aux:nnnn {#1} {#2} {#3} {#3} + \tl_if_eq:NNTF \l__msg_class_tl \l__msg_current_class_tl + { + \prop_put:cnn { l__msg_redirect_ #2 _prop } {#3} {#2} + \__msg_kernel_warning:nnxxxx { kernel } { message-redirect-loop } + { \seq_item:Nn \l__msg_class_loop_seq { \c_one } } + { \seq_item:Nn \l__msg_class_loop_seq { \c_two } } + {#3} + { + \seq_map_function:NN \l__msg_class_loop_seq + \__msg_redirect_loop_list:n + { \seq_item:Nn \l__msg_class_loop_seq { \c_one } } + } + } + { \__msg_redirect_loop_chk:onn \l__msg_class_tl {#2} {#3} } } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#3} } - } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#2} } - } -\cs_new_protected:Npn \msg_redirect_module_aux:nnnn #1#2#3#4 - { - \prop_get:cnNTF { l_msg_redirect_ #3 _prop } {#1} \l_msg_class_tl - { - \tl_if_eq:NNTF \l_msg_class_tl \l_msg_current_class_tl - { \msg_kernel_error:nnxx { msg } { message-loop } {#2} {#4} } - { \msg_redirect_moduel_aux:nVn {#1} {#2} \l_msg_class_tl {#4} } } - { \prop_put:cnn { l_msg_redirect_ #2 _prop } {#1} {#4} } - } -\cs_generate_variant:Nn \msg_redirect_module_aux:nnnn { nnV } -\cs_new_protected:Npn \msg_redirect_name:nnn #1#2#3 - { - \cs_if_exist:cTF { msg_ #3 :nnxxxx } - { \prop_put:Nnn \l_msg_redirect_prop { #1 / #2 } {#3} } - { \msg_kernel_error:nnx { msg } { message-class-unknown } {#3} } } -\cs_new_protected:Npn \msg_kernel_new:nnnn #1#2 +\cs_generate_variant:Nn \__msg_redirect_loop_chk:nnn { o } +\cs_new:Npn \__msg_redirect_loop_list:n #1 { {#1} ~ => ~ } +\cs_new_protected:Npn \__msg_kernel_new:nnnn #1#2 { \msg_new:nnnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \msg_kernel_new:nnn #1#2 +\cs_new_protected:Npn \__msg_kernel_new:nnn #1#2 { \msg_new:nnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \msg_kernel_set:nnnn #1#2 +\cs_new_protected:Npn \__msg_kernel_set:nnnn #1#2 { \msg_set:nnnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \msg_kernel_set:nnn #1#2 +\cs_new_protected:Npn \__msg_kernel_set:nnn #1#2 { \msg_set:nnn { LaTeX } { #1 / #2 } } -\cs_new_protected:Npn \msg_kernel_fatal:nnxxxx #1#2#3#4#5#6 - { - \msg_interrupt:xxx - { \msg_fatal_text:n { LaTeX } : ~ "#1 / #2" } - { - \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n { LaTeX3 } - } - { \c_msg_fatal_text_tl } - \tex_end:D - } -\cs_new_protected:Npn \msg_kernel_fatal:nnxxx #1#2#3#4#5 - {\msg_kernel_fatal:nnxxxx {#1} {#2} {#3} {#4} {#5} { } } -\cs_new_protected:Npn \msg_kernel_fatal:nnxx #1#2#3#4 - { \msg_kernel_fatal:nnxxxx {#1} {#2} {#3} {#4} { } { } } -\cs_new_protected:Npn \msg_kernel_fatal:nnx #1#2#3 - { \msg_kernel_fatal:nnxxxx {#1} {#2} {#3} { } { } { } } -\cs_new_protected:Npn \msg_kernel_fatal:nn #1#2 - { \msg_kernel_fatal:nnxxxx {#1} {#2} { } { } { } { } } -\cs_new_protected:Npn \msg_kernel_error:nnxxxx #1#2#3#4#5#6 - { - \msg_if_more_text:cTF { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 } - { - \msg_interrupt:xxx - { \msg_error_text:n { LaTeX } : ~ " #1 / #2 " } - { - \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n { LaTeX3 } - } - { - \use:c { \c_msg_more_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - } - } - { - \msg_interrupt:xxx - { \msg_error_text:n { LaTeX } : ~ " #1 / #2 " } - { - \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - \msg_see_documentation_text:n { LaTeX3 } - } - { } - } - } -\cs_new_protected:Npn \msg_kernel_error:nnxxx #1#2#3#4#5 - {\msg_kernel_error:nnxxxx {#1} {#2} {#3} {#4} {#5} { } } -\cs_gset_protected:Npn \msg_kernel_error:nnxx #1#2#3#4 - { \msg_kernel_error:nnxxxx {#1} {#2} {#3} {#4} { } { } } -\cs_gset_protected:Npn \msg_kernel_error:nnx #1#2#3 - { \msg_kernel_error:nnxxxx {#1} {#2} {#3} { } { } { } } -\cs_gset_protected:Npn \msg_kernel_error:nn #1#2 - { \msg_kernel_error:nnxxxx {#1} {#2} { } { } { } { } } -\prop_new:N \l_msg_redirect_kernel_warning_prop -\cs_new_protected:Npn \msg_kernel_warning:nnxxxx #1#2#3#4#5#6 - { - \msg_use:nnnnxxxx { warning } - { - \msg_term:x - { - \msg_warning_text:n { LaTeX } : ~ " #1 / #2 " \\ \\ - \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - } - } - { LaTeX } { #1 / #2 } {#3} {#4} {#5} {#6} - } -\cs_new_protected:Npn \msg_kernel_warning:nnxxx #1#2#3#4#5 - { \msg_kernel_warning:nnxxxx {#1} {#2} {#3} {#4} {#5} { } } -\cs_new_protected:Npn \msg_kernel_warning:nnxx #1#2#3#4 - { \msg_kernel_warning:nnxxxx {#1} {#2} {#3} {#4} { } { } } -\cs_new_protected:Npn \msg_kernel_warning:nnx #1#2#3 - { \msg_kernel_warning:nnxxxx {#1} {#2} {#3} { } { } { } } -\cs_new_protected:Npn \msg_kernel_warning:nn #1#2 - { \msg_kernel_warning:nnxxxx {#1} {#2} { } { } { } { } } -\prop_new:N \l_msg_redirect_kernel_info_prop -\cs_new_protected:Npn \msg_kernel_info:nnxxxx #1#2#3#4#5#6 - { - \msg_use:nnnnxxxx { info } - { - \msg_log:x - { - \msg_info_text:n { LaTeX } : ~ " #1 / #2 " \\ \\ - \use:c { \c_msg_text_prefix_tl LaTeX / #1 / #2 } - {#3} {#4} {#5} {#6} - } - } - { LaTeX } { #1 / #2 } {#3} {#4} {#5} {#6} - } -\cs_new_protected:Npn \msg_kernel_info:nnxxx #1#2#3#4#5 - { \msg_kernel_info:nnxxxx {#1} {#2} {#3} {#4} {#5} { } } -\cs_new_protected:Npn \msg_kernel_info:nnxx #1#2#3#4 - { \msg_kernel_info:nnxxxx {#1} {#2} {#3} {#4} { } { } } -\cs_new_protected:Npn \msg_kernel_info:nnx #1#2#3 - { \msg_kernel_info:nnxxxx {#1} {#2} {#3} { } { } { } } -\cs_new_protected:Npn \msg_kernel_info:nn #1#2 - { \msg_kernel_info:nnxxxx {#1} {#2} { } { } { } { } } -\msg_kernel_new:nnnn { msg } { message-already-defined } +\group_begin: + \cs_set_protected:Npn \__msg_kernel_class_new:nn #1 + { \__msg_kernel_class_new_aux:nn { kernel_ #1 } } + \cs_set_protected:Npn \__msg_kernel_class_new_aux:nn #1#2 + { + \cs_new_protected:cpn { __msg_ #1 :nnnnnn } ##1##2 {#2} + \cs_new_protected:cpx { __msg_ #1 :nnnnn } ##1##2##3##4##5 + { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { __msg_ #1 :nnnn } ##1##2##3##4 + { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { __msg_ #1 :nnn } ##1##2##3 + { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} {##3} { } { } { } } + \cs_new_protected:cpx { __msg_ #1 :nn } ##1##2 + { \exp_not:c { __msg_ #1 :nnnnnn } {##1} {##2} { } { } { } { } } + \cs_new_protected:cpx { __msg_ #1 :nnxxxx } ##1##2##3##4##5##6 + { + \use:x + { + \exp_not:c { __msg_ #1 :nnnnnn } + { \exp_not:N \exp_not:n {##1} } + { \exp_not:N \exp_not:n {##2} } + {##3} {##4} {##5} {##6} + } + } + \cs_new_protected:cpx { __msg_ #1 :nnxxx } ##1##2##3##4##5 + { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } + \cs_new_protected:cpx { __msg_ #1 :nnxx } ##1##2##3##4 + { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } + \cs_new_protected:cpx { __msg_ #1 :nnx } ##1##2##3 + { \exp_not:c { __msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } + } + \__msg_kernel_class_new:nn { fatal } + { \__msg_fatal_code:nnnnnn { LaTeX } { #1 / #2 } } + \cs_undefine:N \__msg_kernel_error:nnxx + \cs_undefine:N \__msg_kernel_error:nnx + \cs_undefine:N \__msg_kernel_error:nn + \__msg_kernel_class_new:nn { error } + { \__msg_error_code:nnnnnn { LaTeX } { #1 / #2 } } + \__msg_kernel_class_new:nn { warning } + { \msg_warning:nnxxxx { LaTeX } { #1 / #2 } } + \__msg_kernel_class_new:nn { info } + { \msg_info:nnxxxx { LaTeX } { #1 / #2 } } +\group_end: +\__msg_kernel_new:nnnn { kernel } { message-already-defined } { Message~'#2'~for~module~'#1'~already~defined. } { \c_msg_coding_error_text_tl @@ -552,37 +515,41 @@ by~the~module~'#1':~this~message~already~exists. \c_msg_return_text_tl } -\msg_kernel_new:nnnn { msg } { message-unknown } +\__msg_kernel_new:nnnn { kernel } { message-unknown } { Unknown~message~'#2'~for~module~'#1'. } { \c_msg_coding_error_text_tl LaTeX~was~asked~to~display~a~message~called~'#2'\\ - by~the~module~'#1'~module:~this~message~does~not~exist. + by~the~module~'#1':~this~message~does~not~exist. \c_msg_return_text_tl } -\msg_kernel_new:nnnn { msg } { message-class-unknown } +\__msg_kernel_new:nnnn { kernel } { message-class-unknown } { Unknown~message~class~'#1'. } { LaTeX~has~been~asked~to~redirect~messages~to~a~class~'#1':\\ this~was~never~defined. \c_msg_return_text_tl } -\msg_kernel_new:nnnn { msg } { redirect-loop } - { Message~redirection~loop~for~message~class~'#1'. } +\__msg_kernel_new:nnnn { kernel } { message-redirect-loop } { - LaTeX~has~been~asked~to~redirect~messages~in~an~infinite~loop.\\ - The~original~message~here~has~been~lost. - \c_msg_return_text_tl + Message~redirection~loop~caused~by~ {#1} ~=>~ {#2} + \tl_if_empty:nF {#3} { ~for~module~' \use_none:n #3 ' } . + } + { + Adding~the~message~redirection~ {#1} ~=>~ {#2} + \tl_if_empty:nF {#3} { ~for~the~module~' \use_none:n #3 ' } ~ + created~an~infinite~loop\\\\ + \iow_indent:n { #4 \\\\ } } -\msg_kernel_new:nnnn { kernel } { bad-number-of-arguments } +\__msg_kernel_new:nnnn { kernel } { bad-number-of-arguments } { Function~'#1'~cannot~be~defined~with~#2~arguments. } { \c_msg_coding_error_text_tl LaTeX~has~been~asked~to~define~a~function~'#1'~with~ - #2~arguments. \\ + #2~arguments.~ TeX~allows~between~0~and~9~arguments~for~a~single~function. } -\msg_kernel_new:nnnn { kernel } { command-already-defined } +\__msg_kernel_new:nnnn { kernel } { command-already-defined } { Control~sequence~#1~already~defined. } { \c_msg_coding_error_text_tl @@ -591,192 +558,239 @@ The~current~meaning~is:\\ \ \ #2 } -\msg_kernel_new:nnnn { kernel } { command-not-defined } +\__msg_kernel_new:nnnn { kernel } { command-not-defined } { Control~sequence~#1~undefined. } { \c_msg_coding_error_text_tl LaTeX~has~been~asked~to~use~a~command~#1,~but~this~has~not~ been~defined~yet. } -\msg_kernel_new:nnnn { kernel } { out-of-registers } +\__msg_kernel_new:nnnn { kernel } { empty-search-pattern } + { Empty~search~pattern. } + { + \c_msg_coding_error_text_tl + LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~ + would~lead~to~an~infinite~loop! + } +\__msg_kernel_new:nnnn { kernel } { out-of-registers } { No~room~for~a~new~#1. } { TeX~only~supports~\int_use:N \c_max_register_int \ of~each~type.~All~the~#1~registers~have~been~used.~ This~run~will~be~aborted~now. } -\msg_kernel_new:nnnn { kernel } { variable-not-defined } - { Variable~#1~undefined. } +\__msg_kernel_new:nnnn { kernel } { missing-colon } + { Function~'#1'~contains~no~':'. } { \c_msg_coding_error_text_tl - LaTeX~has~been~asked~to~show~a~variable~#1,~but~this~has~not~ - been~defined~yet. + Code-level~functions~must~contain~':'~to~separate~the~ + argument~specification~from~the~function~name.~This~is~ + needed~when~defining~conditionals~or~when~building~a~ + parameter~text~from~the~number~of~arguments~of~the~function. } -\msg_kernel_new:nnnn { seq } { empty-sequence } - { Empty~sequence~#1. } +\__msg_kernel_new:nnnn { kernel } { protected-predicate } + { Predicate~'#1'~must~be~expandable. } { \c_msg_coding_error_text_tl - LaTeX~has~been~asked~to~recover~an~entry~from~a~sequence~that~ - has~no~content:~that~cannot~happen! + LaTeX~has~been~asked~to~define~'#1'~as~a~protected~predicate.~ + Only~expandable~tests~can~have~a~predicate~version. } -\msg_kernel_new:nnnn { tl } { empty-search-pattern } - { Empty~search~pattern. } +\__msg_kernel_new:nnnn { kernel } { conditional-form-unknown } + { Conditional~form~'#1'~for~function~'#2'~unknown. } { \c_msg_coding_error_text_tl - LaTeX~has~been~asked~to~replace~an~empty~pattern~by~'#1':~that~% - would~lead~to~an~infinite~loop! + LaTeX~has~been~asked~to~define~the~conditional~form~'#1'~of~ + the~function~'#2',~but~only~'TF',~'T',~'F',~and~'p'~forms~exist. } -\msg_kernel_new:nnnn { scan } { already-defined } +\__msg_kernel_new:nnnn { kernel } { scanmark-already-defined } { Scan~mark~#1~already~defined. } { \c_msg_coding_error_text_tl LaTeX~has~been~asked~to~create~a~new~scan~mark~'#1'~ but~this~name~has~already~been~used~for~a~scan~mark. } -\msg_kernel_new:nnn { seq } { misused } - { A~sequence~was~misused. } -\msg_kernel_new:nnn { kernel } { bad-var } +\__msg_kernel_new:nnnn { kernel } { variable-not-defined } + { Variable~#1~undefined. } + { + \c_msg_coding_error_text_tl + LaTeX~has~been~asked~to~show~a~variable~#1,~but~this~has~not~ + been~defined~yet. + } +\__msg_kernel_new:nnnn { kernel } { variant-too-long } + { Variant~form~'#1'~longer~than~base~signature~of~'#2'. } + { + \c_msg_coding_error_text_tl + LaTeX~has~been~asked~to~create~a~variant~of~the~function~'#2'~ + with~a~signature~starting~with~'#1',~but~that~is~longer~than~ + the~signature~(part~after~the~colon)~of~'#2'. + } +\__msg_kernel_new:nnn { kernel } { bad-variable } { Erroneous~variable~#1 used! } -\msg_kernel_new:nnn { prg } { zero-step } - { Zero~step~size~for~stepwise~function~#1. } -\msg_kernel_new:nnn { prg } { replicate-neg } +\__msg_kernel_new:nnn { kernel } { misused-sequence } + { A~sequence~was~misused. } +\__msg_kernel_new:nnn { kernel } { negative-replication } { Negative~argument~for~\prg_replicate:nn. } -\msg_kernel_new:nnn { kernel } { unknown-comparison } +\__msg_kernel_new:nnn { kernel } { unknown-comparison } { Relation~symbol~'#1'~unknown:~use~=,~<,~>,~==,~!=,~<=,~>=. } -\msg_kernel_new:nnn { seq } { show } +\__msg_kernel_new:nnn { kernel } { zero-step } + { Zero~step~size~for~step~function~#1. } +\__msg_kernel_new:nnn { kernel } { show-clist } { - The~sequence~\token_to_str:N #1~ - \seq_if_empty:NTF #1 + The~comma~list~ + \str_if_eq:nnF {#1} { \l__clist_internal_clist } { \token_to_str:N #1~} + \clist_if_empty:NTF #1 { is~empty } { contains~the~items~(without~outer~braces): } } -\msg_kernel_new:nnn { prop } { show } +\__msg_kernel_new:nnn { kernel } { show-prop } { The~property~list~\token_to_str:N #1~ \prop_if_empty:NTF #1 { is~empty } { contains~the~pairs~(without~outer~braces): } } -\msg_kernel_new:nnn { clist } { show } +\__msg_kernel_new:nnn { kernel } { show-seq } { - The~comma~list~ - \str_if_eq:nnF {#1} { \l_clist_internal_clist } { \token_to_str:N #1~} - \clist_if_empty:NTF #1 + The~sequence~\token_to_str:N #1~ + \seq_if_empty:NTF #1 { is~empty } { contains~the~items~(without~outer~braces): } } -\msg_kernel_new:nnn { ior } { show-no-stream } - { No~input~streams~are~open } -\msg_kernel_new:nnn { ior } { show-open-streams } - { The~following~input~streams~are~in~use: } -\msg_kernel_new:nnn { iow } { show-no-stream } - { No~output~streams~are~open } -\msg_kernel_new:nnn { iow } { show-open-streams } - { The~following~output~streams~are~in~use: } +\__msg_kernel_new:nnn { kernel } { show-no-stream } + { No~ #1 ~streams~are~open } +\__msg_kernel_new:nnn { kernel } { show-open-streams } + { The~following~ #1 ~streams~are~in~use: } \group_begin: \char_set_catcode_math_superscript:N \^ -\char_set_lccode:nn {`^} {`\ } -\char_set_lccode:nn {`L} {`L} -\char_set_lccode:nn {`T} {`T} -\char_set_lccode:nn {`X} {`X} +\char_set_lccode:nn { `^ } { `\ } +\char_set_lccode:nn { `L } { `L } +\char_set_lccode:nn { `T } { `T } +\char_set_lccode:nn { `X } { `X } \tl_to_lowercase:n { - \cs_new:Npx \msg_expandable_error:n #1 + \cs_new:Npx \__msg_expandable_error:n #1 { \exp_not:n { \tex_romannumeral:D \exp_after:wN \exp_after:wN - \exp_after:wN \msg_expandable_error_aux:w + \exp_after:wN \__msg_expandable_error:w \exp_after:wN \exp_after:wN \exp_after:wN \c_zero } \exp_not:N \use:n { \exp_not:c { LaTeX3~error: } ^ #1 } ^ } - \cs_new:Npn \msg_expandable_error_aux:w #1 ^ #2 ^ { #1 } + \cs_new:Npn \__msg_expandable_error:w #1 ^ #2 ^ { #1 } } \group_end: -\cs_new:Npn \msg_expandable_kernel_error:nnnnnn #1#2#3#4#5#6 +\cs_new:Npn \__msg_kernel_expandable_error:nnnnnn #1#2#3#4#5#6 { - \exp_args:Nf \msg_expandable_error:n + \exp_args:Nf \__msg_expandable_error:n { \exp_args:NNc \exp_after:wN \exp_stop_f: - { \c_msg_text_prefix_tl LaTeX / #1 / #2 } + { \c__msg_text_prefix_tl LaTeX / #1 / #2 } {#3} {#4} {#5} {#6} } } -\cs_new:Npn \msg_expandable_kernel_error:nnnnn #1#2#3#4#5 +\cs_new:Npn \__msg_kernel_expandable_error:nnnnn #1#2#3#4#5 { - \msg_expandable_kernel_error:nnnnnn + \__msg_kernel_expandable_error:nnnnnn {#1} {#2} {#3} {#4} {#5} { } } -\cs_new:Npn \msg_expandable_kernel_error:nnnn #1#2#3#4 +\cs_new:Npn \__msg_kernel_expandable_error:nnnn #1#2#3#4 { - \msg_expandable_kernel_error:nnnnnn + \__msg_kernel_expandable_error:nnnnnn {#1} {#2} {#3} {#4} { } { } } -\cs_new:Npn \msg_expandable_kernel_error:nnn #1#2#3 +\cs_new:Npn \__msg_kernel_expandable_error:nnn #1#2#3 { - \msg_expandable_kernel_error:nnnnnn + \__msg_kernel_expandable_error:nnnnnn {#1} {#2} {#3} { } { } { } } -\cs_new:Npn \msg_expandable_kernel_error:nn #1#2 +\cs_new:Npn \__msg_kernel_expandable_error:nn #1#2 { - \msg_expandable_kernel_error:nnnnnn + \__msg_kernel_expandable_error:nnnnnn {#1} {#2} { } { } { } { } } -\cs_new_protected:Npn \msg_aux_use:nn #1#2 - { \msg_aux_use:nnxxxx {#1} {#2} { } { } { } { } } -\cs_new_protected:Npn \msg_aux_use:nnxxxx #1#2#3#4#5#6 +\cs_new_protected:Npn \__msg_term:nnnnnn #1#2#3#4#5#6 { - \iow_wrap:xnnnN - { - \use:c { \c_msg_text_prefix_tl #1 / #2 } - {#3} {#4} {#5} {#6} - } - { } \c_zero { } \iow_term:x + \iow_wrap:nnnN + { \use:c { \c__msg_text_prefix_tl #1 / #2 } {#3} {#4} {#5} {#6} } + { } { } \iow_term:n } -\cs_new_protected:Npn \msg_aux_show:Nnx #1#2#3 +\cs_generate_variant:Nn \__msg_term:nnnnnn { nnnnnV } +\cs_new_protected:Npn \__msg_term:nnnnn #1#2#3#4#5 + { \__msg_term:nnnnnn {#1} {#2} {#3} {#4} {#5} { } } +\cs_new_protected:Npn \__msg_term:nnn #1#2#3 + { \__msg_term:nnnnnn {#1} {#2} {#3} { } { } { } } +\cs_new_protected:Npn \__msg_term:nn #1#2 + { \__msg_term:nnnnnn {#1} {#2} { } { } { } { } } +\cs_new_protected:Npn \__msg_show_variable:Nnn #1#2#3 { \cs_if_exist:NTF #1 { - \msg_aux_use:nnxxxx { LaTeX / #2 } { show } {#1} { } { } { } - \msg_aux_show:x {#3} + \__msg_term:nnn { LaTeX / kernel } { show- #2 } {#1} + \__msg_show_variable:x {#3} } { - \msg_kernel_error:nnx { kernel } { variable-not-defined } + \__msg_kernel_error:nnx { kernel } { variable-not-defined } { \token_to_str:N #1 } } } -\cs_new_protected:Npn \msg_aux_show:x #1 +\cs_generate_variant:Nn \__msg_show_variable:Nnn { Nnx } +\cs_new_protected:Npn \__msg_show_variable:n #1 { - \tl_set:Nx \l_msg_internal_tl {#1} - \tl_if_empty:NT \l_msg_internal_tl - { \tl_set:Nx \l_msg_internal_tl { > } } - \exp_args:Nf \etex_showtokens:D + \tl_set:Nn \l__msg_internal_tl {#1} + \tl_if_empty:NTF \l__msg_internal_tl + { \etex_showtokens:D \exp_after:wN { } } { - \exp_after:wN \exp_after:wN - \exp_after:wN \msg_aux_show:w - \exp_after:wN \l_msg_internal_tl - \exp_after:wN + \exp_args:Nf \etex_showtokens:D + { + \exp_after:wN \exp_after:wN + \exp_after:wN \__msg_show_variable:w + \exp_after:wN \l__msg_internal_tl + } } - \prg_do_nothing: } -\cs_new:Npn \msg_aux_show:w #1 > { } -\cs_new:Npn \msg_aux_show:n #1 +\cs_generate_variant:Nn \__msg_show_variable:n { x } +\cs_new:Npn \__msg_show_variable:w #1 > { } +\cs_new:Npn \__msg_show_item:n #1 { \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} } } -\cs_new:Npn \msg_aux_show:nn #1#2 +\cs_new:Npn \__msg_show_item:nn #1#2 { \iow_newline: > \c_space_tl \c_space_tl { \exp_not:n {#1} } \c_space_tl \c_space_tl => \c_space_tl \c_space_tl { \exp_not:n {#2} } } -\cs_new:Npn \msg_aux_show_unbraced:nn #1#2 +\cs_new:Npn \__msg_show_item_unbraced:nn #1#2 { \iow_newline: > \c_space_tl \c_space_tl \exp_not:n {#1} \c_space_tl \c_space_tl => \c_space_tl \c_space_tl \exp_not:n {#2} } +\cs_new_nopar:Npn \msg_newline: { ^^J } +\cs_new_nopar:Npn \msg_two_newlines: { ^^J ^^J } +\cs_generate_variant:Nn \msg_log:n { x } +\cs_generate_variant:Nn \msg_term:n { x } +\cs_generate_variant:Nn \msg_interrupt:nnn { xxx } +\cs_new_protected:Npn \msg_class_set:nn #1#2 + { + \cs_if_exist:cTF { __msg_ #1 _code:nnnnnn } + \cs_set_protected:cpn + \cs_new_protected:cpn + { __msg_ #1 _code:nnnnnn } ##1##2##3##4##5##6 {#2} + \prop_clear_new:c { l__msg_redirect_ #1 _prop } + \cs_set_protected_nopar:cpn { msg_ #1 :nnxxxx } + { \__msg_use:nnnnnnn {#1} } + \cs_set_protected:cpx { msg_ #1 :nnxxx } ##1##2##3##4##5 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} {##5} { } } + \cs_set_protected:cpx { msg_ #1 :nnxx } ##1##2##3##4 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} {##4} { } { } } + \cs_set_protected:cpx { msg_ #1 :nnx } ##1##2##3 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} {##3} { } { } { } } + \cs_set_protected:cpx { msg_ #1 :nn } ##1##2 + { \exp_not:c { msg_ #1 :nnxxxx } {##1} {##2} { } { } { } { } } + } %% %% %% End of file `l3msg.sty'. |