summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3toks.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3toks.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3toks.sty45
1 files changed, 28 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3toks.sty b/Master/texmf-dist/tex/latex/expl3/l3toks.sty
index 2ed07333187..afe5ff158a9 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3toks.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3toks.sty
@@ -48,24 +48,35 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3toks.dtx 1412 2009-06-14 17:55:48Z joseph $
+\GetIdInfo$Id: l3toks.dtx 1867 2010-03-23 13:03:12Z will $
{L3 Experimental Token Registers}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
\package_check_loaded_expl:
-\cs_set_eq:NN \toks_new:N \newtoks % nick from LaTeX for the moment
+\cs_new_protected_nopar:Npn \toks_new:N #1 {
+ \chk_if_free_cs:N #1
+ \newtoks #1
+}
+\cs_new_protected_nopar:Npn \toks_new_local:N #1 {
+ \chk_if_free_cs:N #1
+ \int_compare:nNnTF
+ \tex_currentgrouplevel:D = 0
+ \newtoks \loctoks
+ #1
+}
\cs_generate_variant:Nn \toks_new:N {c}
+\cs_generate_variant:Nn \toks_new_local:N {c}
\cs_new_eq:NN \toks_use:N \tex_the:D
\cs_generate_variant:Nn \toks_use:N {c}
\cs_new_eq:NN \toks_set:Nn \prg_do_nothing:
-\cs_new:Npn \toks_set:NV #1#2 {
+\cs_new_protected:Npn \toks_set:NV #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0 \exp_eval_register:N #2 }
}
-\cs_new:Npn \toks_set:Nv #1#2 {
+\cs_new_protected:Npn \toks_set:Nv #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0 \exp_eval_register:c {#2} }
}
-\cs_new:Npn \toks_set:No #1#2 { #1 \exp_after:wN {#2} }
-\cs_new:Npn \toks_set:Nf #1#2 {
+\cs_new_protected:Npn \toks_set:No #1#2 { #1 \exp_after:wN {#2} }
+\cs_new_protected:Npn \toks_set:Nf #1#2 {
#1 \exp_after:wN { \int_to_roman:w -`0#2 }
}
\cs_generate_variant:Nn \toks_set:Nn {Nx,cn,cV,cv,co,cx,cf}
@@ -75,19 +86,19 @@
\cs_new_eq:NN \toks_gset_eq:NN \pref_global:D
\cs_generate_variant:Nn \toks_set_eq:NN {Nc,cN,cc}
\cs_generate_variant:Nn \toks_gset_eq:NN {Nc,cN,cc}
-\cs_new_nopar:Npn \toks_clear:N #1 {
+\cs_new_protected_nopar:Npn \toks_clear:N #1 {
#1\c_empty_toks
}
-\cs_new_nopar:Npn \toks_gclear:N {
+\cs_new_protected_nopar:Npn \toks_gclear:N {
\pref_global:D
\toks_clear:N
}
\cs_generate_variant:Nn \toks_clear:N {c}
\cs_generate_variant:Nn \toks_gclear:N {c}
-\cs_new_nopar:Npn \toks_use_clear:N #1 {
+\cs_new_protected_nopar:Npn \toks_use_clear:N #1 {
\exp_last_unbraced:NNV \toks_clear:N #1 #1
}
-\cs_new_nopar:Npn \toks_use_gclear:N {
+\cs_new_protected_nopar:Npn \toks_use_gclear:N {
\pref_global:D
\toks_use_clear:N
}
@@ -95,12 +106,12 @@
\cs_generate_variant:Nn \toks_use_gclear:N {c}
\cs_new_eq:NN \toks_show:N \tex_showthe:D
\cs_generate_variant:Nn \toks_show:N {c}
-\cs_new_nopar:Npn \toks_put_left:Nn #1 {
+\cs_new_protected_nopar:Npn \toks_put_left:Nn #1 {
\exp_after:wN \toks_put_left_aux:w \exp_after:wN \q_mark
\toks_use:N #1 \q_stop #1
}
\cs_generate_variant:Nn \toks_put_left:Nn {NV,No,Nx,cn,co,cV}
-\cs_new_nopar:Npn \toks_gput_left:Nn {
+\cs_new_protected_nopar:Npn \toks_gput_left:Nn {
\pref_global:D
\toks_put_left:Nn
}
@@ -108,27 +119,27 @@
\cs_new:Npn \toks_put_left_aux:w #1\q_stop #2#3 {
#2 \exp_after:wN { \use_i:nn {#3} #1 }
}
-\cs_new:Npn \toks_put_right:Nn #1#2 {
+\cs_new_protected:Npn \toks_put_right:Nn #1#2 {
#1 \exp_after:wN { \toks_use:N #1 #2 }
}
-\cs_new_nopar:Npn \toks_gput_right:Nn {
+\cs_new_protected_nopar:Npn \toks_gput_right:Nn {
\pref_global:D
\toks_put_right:Nn
}
-\cs_new:Npn \toks_put_right:NV #1#2 {
+\cs_new_protected:Npn \toks_put_right:NV #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1
\int_to_roman:w -`0 \exp_eval_register:N #2
}
}
-\cs_new:Npn \toks_put_right:No #1#2 {
+\cs_new_protected:Npn \toks_put_right:No #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1 #2
}
}
\cs_generate_variant:Nn \toks_put_right:Nn {Nx,cn,cV,co}
\cs_generate_variant:Nn \toks_gput_right:Nn {NV,No,Nx,cn,cV,co}
-\cs_new:Npn \toks_put_right:Nf #1#2 {
+\cs_new_protected:Npn \toks_put_right:Nf #1#2 {
#1 \exp_after:wN \exp_after:wN \exp_after:wN {
\exp_after:wN \toks_use:N \exp_after:wN #1 \int_to_roman:w -`0#2
}