diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xinttools.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index cd5269ac268..732a24d643f 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -21,8 +21,8 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2j 2016/12/22 -%% Copyright (C) 2013-2016 by Jean-Francois Burnol +%% The xint bundle 1.2k 2017/01/06 +%% Copyright (C) 2013-2017 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- \begingroup\catcode61\catcode48\catcode32=10\relax% @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2016/12/22 1.2j Expandable and non-expandable utilities (JFB)]% + [2017/01/06 1.2k Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% @@ -1409,11 +1409,35 @@ \XINT_reverse:f:csv_finish #1% }% \long\def\XINT_reverse:f:csv_finish #1\xint_relax,{ }% +\def\xintFirstItem:f:csv {\romannumeral0\xintfirstitem:f:csv}% +\long\def\xintfirstitem:f:csv #1% +{% + \expandafter\XINT_first:f:csv_a\romannumeral`&&@#1,\xint_bye +}% +\long\def\XINT_first:f:csv_a #1,#2\xint_bye{ #1}% +\def\xintLastItem:f:csv {\romannumeral0\xintlastitem:f:csv}% +\long\def\xintlastitem:f:csv #1% +{% + \expandafter\XINT_last:f:csv_loop\expandafter{\expandafter}\expandafter.% + \romannumeral`&&@#1,% + \xint_relax\XINT_last_loop_enda,\xint_relax\XINT_last_loop_endb,% + \xint_relax\XINT_last_loop_endc,\xint_relax\XINT_last_loop_endd,% + \xint_relax\XINT_last_loop_ende,\xint_relax\XINT_last_loop_endf,% + \xint_relax\XINT_last_loop_endg,\xint_relax\XINT_last_loop_endh,\xint_bye +}% +\long\def\XINT_last:f:csv_loop #1.#2,#3,#4,#5,#6,#7,#8,#9,% +{% + \xint_gob_til_xint_relax #9% + {#8}{#7}{#6}{#5}{#4}{#3}{#2}{#1}\xint_relax + \XINT_last:f:csv_loop {#9}.% +}% \let\xintCSVLength \xintLength:f:csv \let\xintCSVKeep \xintKeep:f:csv \let\xintCSVTrim \xintTrim:f:csv \let\xintCSVNthEltPy \xintNthEltPy:f:csv \let\xintCSVReverse \xintReverse:f:csv +\let\xintCSVFirstItem\xintFirstItem:f:csv +\let\xintCSVLastItem \xintLastItem:f:csv \let\XINT_tmpa\relax \let\XINT_tmpb\relax \let\XINT_tmpc\relax \XINT_restorecatcodes_endinput% \endinput |