summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/xfor
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-08-17 00:39:27 +0000
committerKarl Berry <karl@freefriends.org>2007-08-17 00:39:27 +0000
commit9b2db6d4800d0edf3e03f9ebff38c3e4ecada25b (patch)
tree2c87e62e3cc16d9b59faf3c9949c4d6efd21991d /Master/texmf-dist/tex/latex/xfor
parent6882d3e9a8919f0ca16e0819528b15ff31775c78 (diff)
xfor 1.02
git-svn-id: svn://tug.org/texlive/trunk@4750 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xfor')
-rw-r--r--Master/texmf-dist/tex/latex/xfor/xfor.sty10
1 files changed, 9 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/xfor/xfor.sty b/Master/texmf-dist/tex/latex/xfor/xfor.sty
index b1992383595..77a81d5fe86 100644
--- a/Master/texmf-dist/tex/latex/xfor/xfor.sty
+++ b/Master/texmf-dist/tex/latex/xfor/xfor.sty
@@ -26,12 +26,14 @@
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
+%% last iteration
+%% not last iteration
%% store new list in \toks@
%% test current value against new value
%% append new stuff to new list
%% check to see if for loop was prematurely terminated
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xfor}[2007/07/11 v1.01 (NLCT)]
+\ProvidesPackage{xfor}[2007/08/16 v1.02 (NLCT)]
\newif\if@endfor
\long\def\@for#1:=#2\do#3{%
\@endforfalse
@@ -47,6 +49,7 @@
\def#4{#1}%
\ifx#4\@nnil
\else
+ \@xfor@storenext#2,#3\@@%
#5%
\if@endfor
\@iforgatherrest#2,#3%
@@ -54,6 +57,7 @@
\def#4{#2}%
\ifx#4\@nnil
\else
+ \@xfor@storenext#3,\@nil\@@%
#5%
\if@endfor
\@iforgatherrest#3%
@@ -64,6 +68,9 @@
\fi
\fi
}
+\def\@xfor@storenext#1,#2\@@{%
+\def\@xfor@nextelement{#1}%
+}
\long\def\@forgatherrest#1,\@nil,\@nil{\def\@forremainder{#1}}
\long\def\@iforgatherrest#1\@nil,\@nil{%
\def\@fortmp{#1}%
@@ -78,6 +85,7 @@
\ifx#3\@nnil
\let\@ifornext\@fornoop
\else
+ \@xfor@storenext#2,\@nil\@@%
#4\relax
\if@endfor
\@iforgatherrest#2\relax