summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-29 23:03:42 +0000
committerKarl Berry <karl@freefriends.org>2011-12-29 23:03:42 +0000
commit7a50f35d6fd3bd705c78298b1ccc085991638f87 (patch)
tree7f749391d34aa12a37a30a33c00b3098b2320e7c /Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
parent0bc9393ae50667d7ff769a76321a9548a70351fc (diff)
l3kernel 3109 (29dec11)
git-svn-id: svn://tug.org/texlive/trunk@24971 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3basics.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3basics.sty77
1 files changed, 46 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
index c9e56e990e1..6faa1110ad1 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3basics.sty
@@ -46,7 +46,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3basics.dtx 3023 2011-12-04 07:25:04Z bruno $
+\GetIdInfo$Id: l3basics.dtx 3090 2011-12-23 03:12:53Z bruno $
{L3 Experimental basic definitions}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -86,10 +86,30 @@
\tex_let:D \tex_long:D \tex_long:D
\tex_let:D \tex_protected:D \etex_protected:D
\tex_long:D \tex_def:D \exp_args:Nc #1#2 { \exp_after:wN #1 \cs:w #2 \cs_end: }
-%% A small number of variants by hand.
-\tex_def:D \cs_meaning:c { \exp_args:Nc \cs_meaning:N }
\tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N }
-\tex_def:D \cs_show:c { \exp_args:Nc \cs_show:N }
+\tex_long:D \tex_def:D \cs_meaning:c #1
+ {
+ \if_cs_exist:w #1 \cs_end:
+ \exp_after:wN \use_i:nn
+ \else:
+ \exp_after:wN \use_ii:nn
+ \fi:
+ { \exp_args:Nc \cs_meaning:N {#1} }
+ { \tl_to_str:n {undefined} }
+ }
+\tex_protected:D \tex_def:D \cs_show:c
+ { \group_begin: \exp_args:NNc \group_end: \cs_show:N }
+\tex_let:D \c_minus_one \m@ne
+\tex_chardef:D \c_sixteen = 16~
+\tex_chardef:D \c_zero = 0~
+\tex_chardef:D \c_six = 6~
+\tex_chardef:D \c_seven = 7~
+\tex_chardef:D \c_twelve = 12~
+\etex_ifdefined:D \luatex_luatexversion:D
+ \tex_chardef:D \c_max_register_int = 65 535 ~
+\tex_else:D
+ \tex_mathchardef:D \c_max_register_int = 32 767 ~
+\tex_fi:D
\tex_let:D \cs_set_nopar:Npn \tex_def:D
\tex_let:D \cs_set_nopar:Npx \tex_edef:D
\tex_protected:D \cs_set_nopar:Npn \cs_set:Npn
@@ -327,13 +347,13 @@
\tex_chardef:D \c_false_bool = 0~
\cs_set_nopar:Npn \cs_to_str:N
{
- \if:w \int_to_roman:w - `0 \token_to_str:N \ %
- \cs_to_str_aux:w
- \fi:
- \exp_after:wN \use_none:n \token_to_str:N
- }
-\cs_set_nopar:Npn \cs_to_str_aux:w #1 \use_none:n
- { ~ \int_to_roman:w - `0 \fi: }
+ \int_to_roman:w
+ \if:w \token_to_str:N \ \cs_to_str_aux:w \fi:
+ \exp_after:wN \cs_to_str_aux:N \token_to_str:N
+ }
+\cs_set:Npn \cs_to_str_aux:N #1 { \c_zero }
+\cs_set:Npn \cs_to_str_aux:w #1 \cs_to_str_aux:N
+ { - \int_value:w \fi: \exp_after:wN \c_zero }
\group_begin:
\tex_lccode:D `\@ = `\: \scan_stop:
\tex_catcode:D `\@ = 12~
@@ -342,8 +362,9 @@
\group_end:
\cs_set:Npn \cs_split_function:NN #1#2
{
+ \exp_after:wN \exp_after:wN
\exp_after:wN \cs_split_function_aux:w
- \int_to_roman:w - `\q \cs_to_str:N #1 @ a \q_stop #2
+ \cs_to_str:N #1 @ a \q_stop #2
}
\cs_set:Npn \cs_split_function_aux:w #1 @ #2#3 \q_stop #4
{
@@ -434,18 +455,11 @@
{ \cs_if_exist:cTF {#1} { \use:c {#1} #2 } { } }
\cs_set:Npn \cs_if_exist_use:c #1
{ \cs_if_exist:cTF {#1} { \use:c {#1} } { } }
-\tex_let:D \c_minus_one \m@ne
-\tex_chardef:D \c_sixteen = 16~
-\tex_chardef:D \c_zero = 0~
-\tex_chardef:D \c_six = 6~
-\tex_chardef:D \c_seven = 7~
-\tex_chardef:D \c_twelve = 12~
-\tex_mathchardef:D \c_max_register_int = 32 767 \scan_stop:
\cs_set_protected_nopar:Npn \iow_log:x
{ \tex_immediate:D \tex_write:D \c_minus_one }
\cs_set_protected_nopar:Npn \iow_term:x
{ \tex_immediate:D \tex_write:D \c_sixteen }
-\cs_set_protected_nopar:Npn \msg_kernel_error:nnxx #1#2#3#4
+\cs_set_protected:Npn \msg_kernel_error:nnxx #1#2#3#4
{
\tex_errmessage:D
{
@@ -457,13 +471,13 @@
}
\tex_end:D
}
-\cs_set_protected_nopar:Npn \msg_kernel_error:nnx #1#2#3
+\cs_set_protected:Npn \msg_kernel_error:nnx #1#2#3
{ \msg_kernel_error:nnxx {#1} {#2} {#3} { } }
-\cs_set_protected_nopar:Npn \msg_kernel_error:nn #1#2
+\cs_set_protected:Npn \msg_kernel_error:nn #1#2
{ \msg_kernel_error:nnxx {#1} {#2} { } { } }
\cs_set_nopar:Npn \msg_line_context:
{ on~line~\tex_the:D \tex_inputlineno:D }
-\cs_set_protected_nopar:Npn \chk_if_free_cs:N #1
+\cs_set_protected:Npn \chk_if_free_cs:N #1
{
\cs_if_free:NF #1
{
@@ -472,7 +486,7 @@
}
}
\tex_ifodd:D \l@expl@log@functions@bool
- \cs_set_protected_nopar:Npn \chk_if_free_cs:N #1
+ \cs_set_protected:Npn \chk_if_free_cs:N #1
{
\cs_if_free:NF #1
{
@@ -484,7 +498,7 @@
\fi:
\cs_set_protected_nopar:Npn \chk_if_free_cs:c
{ \exp_args:Nc \chk_if_free_cs:N }
-\cs_set_protected_nopar:Npn \chk_if_exist_cs:N #1
+\cs_set_protected:Npn \chk_if_exist_cs:N #1
{
\cs_if_exist:NF #1
{
@@ -496,7 +510,7 @@
{ \exp_args:Nc \chk_if_exist_cs:N }
\cs_set:Npn \cs_tmp:w #1#2
{
- \cs_set_protected_nopar:Npn #1 ##1
+ \cs_set_protected:Npn #1 ##1
{
\chk_if_free_cs:N ##1
#2 ##1
@@ -552,9 +566,9 @@
\cs_new_protected_nopar:Npn \cs_gset_eq:Nc { \exp_args:NNc \cs_gset_eq:NN }
\cs_new_protected_nopar:Npn \cs_gset_eq:cN { \exp_args:Nc \cs_gset_eq:NN }
\cs_new_protected_nopar:Npn \cs_gset_eq:cc { \exp_args:Ncc \cs_gset_eq:NN }
-\cs_new_protected_nopar:Npn \cs_undefine:N #1
+\cs_new_protected:Npn \cs_undefine:N #1
{ \cs_gset_eq:NN #1 \c_undefined:D }
-\cs_new_protected_nopar:Npn \cs_undefine:c #1
+\cs_new_protected:Npn \cs_undefine:c #1
{
\if_cs_exist:w #1 \cs_end:
\exp_after:wN \use:n
@@ -601,7 +615,7 @@
{#2#1}
{#4}
}
-\cs_new_protected_nopar:Npn
+\cs_new_protected:Npn
\cs_generate_from_arg_count_aux:nwn #1 #2 \fi: #3
{ \fi: #3 #1 }
\cs_new_nopar:Npn \cs_generate_from_arg_count:cNnn
@@ -693,7 +707,7 @@
\cs_new_nopar:Npn \cs_if_eq:ccTF { \exp_args:Ncc \cs_if_eq:NNTF }
\cs_new_nopar:Npn \cs_if_eq:ccT { \exp_args:Ncc \cs_if_eq:NNT }
\cs_new_nopar:Npn \cs_if_eq:ccF { \exp_args:Ncc \cs_if_eq:NNF }
-\cs_new_nopar:Npn \kernel_register_show:N #1
+\cs_new:Npn \kernel_register_show:N #1
{
\cs_if_exist:NTF #1
{ \tex_showthe:D #1 }
@@ -702,7 +716,8 @@
{ \token_to_str:N #1 }
}
}
-\cs_new_nopar:Npn \kernel_register_show:c { \exp_args:Nc \int_show:N }
+\cs_new_nopar:Npn \kernel_register_show:c
+ { \exp_args:Nc \kernel_register_show:N }
\cs_new_eq:NN \luatex_if_engine:T \use_none:n
\cs_new_eq:NN \luatex_if_engine:F \use:n
\cs_new_eq:NN \luatex_if_engine:TF \use_ii:nn