summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/expl3/l3prg.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-08-06 23:37:15 +0000
committerKarl Berry <karl@freefriends.org>2008-08-06 23:37:15 +0000
commit7fe74d9b728f85523bb0a77b231fe16d379c6265 (patch)
tree4c55f17677758bd4ab08bb24a5fbcf58d3cb64f3 /Master/texmf-dist/tex/latex/expl3/l3prg.sty
parentf26efa972afb0a49e7d84d043c942f138122752c (diff)
expl3 update (6aug08)
git-svn-id: svn://tug.org/texlive/trunk@10123 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3prg.sty')
-rw-r--r--Master/texmf-dist/tex/latex/expl3/l3prg.sty42
1 files changed, 36 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3prg.sty b/Master/texmf-dist/tex/latex/expl3/l3prg.sty
index ccb7657e076..7cc170fef4f 100644
--- a/Master/texmf-dist/tex/latex/expl3/l3prg.sty
+++ b/Master/texmf-dist/tex/latex/expl3/l3prg.sty
@@ -48,7 +48,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
-\GetIdInfo$Id: l3prg.dtx 697 2007-11-27 14:14:54Z morten $
+\GetIdInfo$Id: l3prg.dtx 768 2008-08-05 19:45:06Z morten $
{L3 Experimental control structures}
\ProvidesExplPackage
{\filename}{\filedate}{\fileversion}{\filedescription}
@@ -143,16 +143,16 @@
{#2}{#3}{#4}
}
}
-\int_new:N\l_prg_inline_level_int
+\int_new:N\g_prg_inline_level_int
\def_long_new:NNn\prg_stepwise_inline:nnnn 4{
- \int_incr:N \l_prg_inline_level_int
- \def:cpn{prg_stepwise_inline_\int_use:N\l_prg_inline_level_int :n}##1{#4}
+ \int_gincr:N \g_prg_inline_level_int
+ \gdef:cpn{prg_stepwise_inline_\int_use:N\g_prg_inline_level_int :n}##1{#4}
\num_compare:nNnTF {#2}<\c_zero
{\exp_args:Nco \prg_stepwise_inline_decr:Nnnn }
{\exp_args:Nco \prg_stepwise_inline_incr:Nnnn }
- {prg_stepwise_inline_\int_use:N\l_prg_inline_level_int :n}
+ {prg_stepwise_inline_\int_use:N\g_prg_inline_level_int :n}
{\int_use:N\int_eval:n{#1}} {#2} {#3}
- \int_decr:N \l_prg_inline_level_int
+ \int_gdecr:N \g_prg_inline_level_int
}
\def_long_new:NNn \prg_stepwise_inline_incr:Nnnn 4{
\num_compare:nNnF {#2}>{#4}
@@ -295,6 +295,36 @@
\def_long_new:Npn \predicate_not_p:n #1{
\if:w \predicate_p:n{#1} \c_false \else: \c_true \fi:
}
+\def_long:Npn \prg_case_int:nnn #1 #2 {
+ \exp_args:No \prg_case_int_aux:nnn {\num_value:w \int_eval:n{#1}} #2
+ \q_recursion_tail ? \q_recursion_stop
+}
+\def_long_new:Npn \prg_case_int_aux:nnn #1#2#3{
+ \quark_if_recursion_tail_stop_do:nn{#2}{\use_arg_i:n}
+ \num_compare:nNnTF{#1}={#2}
+ { \use_arg_i_delimit_by_q_recursion_stop:nw {\use_arg_i:nn{#3}} }
+ { \prg_case_int_aux:nnn {#1}}
+}
+\def_long:Npn \prg_case_dim:nnn #1 #2 {
+ \exp_args:No \prg_case_dim_aux:nnn {\dim_use:N \dim_eval:n{#1}} #2
+ \q_recursion_tail ? \q_recursion_stop
+}
+\def_long_new:Npn \prg_case_dim_aux:nnn #1#2#3{
+ \quark_if_recursion_tail_stop_do:nn{#2}{\use_arg_i:n}
+ \dim_compare:nNnTF{#1}={#2}
+ { \use_arg_i_delimit_by_q_recursion_stop:nw {\use_arg_i:nn{#3}} }
+ { \prg_case_dim_aux:nnn {#1}}
+}
+\def_long:Npn \prg_case_str:nnn #1 #2 {
+ \prg_case_str_aux:nnn {#1} #2
+ \q_recursion_tail ? \q_recursion_stop
+}
+\def_long_new:Npn \prg_case_str_aux:nnn #1#2#3{
+ \quark_if_recursion_tail_stop_do:nn{#2}{\use_arg_i:n}
+ \tlist_if_eq:xxTF{#1}{#2}
+ { \use_arg_i_delimit_by_q_recursion_stop:nw {\use_arg_i:nn{#3}} }
+ { \prg_case_str_aux:nnn {#1}}
+}
\def_new:NNn \prg_define_quicksort:nnn 3 {
\def_long:cNx{#1_quicksort:n}1{
\exp_not:c{#1_quicksort_start_partition:w} ##1