diff options
author | Karl Berry <karl@freefriends.org> | 2009-01-27 01:57:19 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-01-27 01:57:19 +0000 |
commit | 859083925d4a5369db7c4336785eab6ce24a155e (patch) | |
tree | b74e89145a103dc019dbd7bd8f679dea60ea79a9 /Master/texmf-dist/tex/latex/xfor/xfor.sty | |
parent | 0eafc5607fb62a88e9dba8e8ef3a11efae9fd904 (diff) |
xfor 1.04 (26jan09)
git-svn-id: svn://tug.org/texlive/trunk@11989 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/xfor/xfor.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/xfor/xfor.sty | 82 |
1 files changed, 30 insertions, 52 deletions
diff --git a/Master/texmf-dist/tex/latex/xfor/xfor.sty b/Master/texmf-dist/tex/latex/xfor/xfor.sty index 87f899aaaf5..8c64bba73fd 100644 --- a/Master/texmf-dist/tex/latex/xfor/xfor.sty +++ b/Master/texmf-dist/tex/latex/xfor/xfor.sty @@ -7,7 +7,7 @@ %% xfor.dtx (with options: `xfor.sty,package') %% %% xfor.dtx -%% Copyright 2007 Nicola Talbot +%% Copyright 2009 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -21,7 +21,7 @@ %% %% The Current Maintainer of this work is Nicola Talbot. %% -%% This work consists of the files xfor.dtx and xfor.ins and the derived file xfor.sty. +%% This work consists of the files xfor.dtx and xfor.ins and the derived files xfor.sty, sample.tex. %% %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -39,69 +39,47 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{xfor}[2007/08/21 v1.03 (NLCT)] +\ProvidesPackage{xfor}[2009/01/25 v1.04 (NLCT)] \newif\if@endfor -\long\def\@for#1:=#2\do#3{% +\long\def\@gobbleseven#1#2#3#4#5#6#7{} +\long\def\@for#1:=#2\do{% \@endforfalse \def\@forremainder{}% \expandafter\def\expandafter\@fortmp\expandafter{#2}% \ifx\@fortmp\@empty -\else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}% +\expandafter\@gobbleseven \fi +\expandafter\@@for\expandafter#1\expandafter{#2}% } -\long\def\@fornoop#1\@@#2#3{} -\long\def\@forloop#1,#2,#3\@@#4#5{% -\def#4{#1}% -\ifx#4\@nnil -\else - \@xfor@storenext#2,#3\@@% - #5% - \if@endfor - \@iforgatherrest#2,#3% - \else - \def#4{#2}% - \ifx#4\@nnil - \else - \@xfor@storenext#3,\@nil\@@% - #5% - \if@endfor - \@iforgatherrest#3% - \else - \@iforloop#3\@@#4{#5}% - \fi - \fi - \fi -\fi +\long\def\@@for#1#2#3{% +\@forloop#1{#3}#2,\@nil,\@nil,% + \@xfor@endmarker% magic end marker } -\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}% -\ifx\@fortmp\@empty - \def\@forremainder{}% -\else - \@forgatherrest#1\@nil,\@nil +\long\def\@xfornoop#1\@xfor@endmarker{} +\long\def\@forloop#1#2#3,#4,{% +\def#1{#3}% +\ifx#1\@nnil +\expandafter\@xfornoop +\fi +\def\@xfor@nextelement{#4}% +#2% +\if@endfor +\expandafter\@iforgatherrest \fi +\@forloop#1{#2}{#4},% } -\long\def\@iforloop#1,#2\@@#3#4{% -\def#3{#1}% -\ifx#3\@nnil - \let\@ifornext\@fornoop +\long\def\@iforgatherrest \@forloop#1#2#3,#4\@xfor@endmarker{% +\def\@fortmp{#3}% +\ifx\@fortmp\@nnil +\def\@forremainder{}% \else - \@xfor@storenext#2,\@nil\@@% - #4\relax - \if@endfor - \@iforgatherrest#2\relax - \let\@ifornext\@fornoop - \else - \let\@ifornext\@iforloop - \fi +\@forgatherrest{#3},#4\@xfor@endmarker% \fi -\@ifornext#2\@@#3{#4}% } +\long\def\@forgatherrest#1,\@nil,\@nil,\@xfor@endmarker{% +\def\@forremainder{#1}% +} + \endinput %% %% End of file `xfor.sty'. |