diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xinttools.sty')
-rw-r--r-- | Master/texmf-dist/tex/generic/xint/xinttools.sty | 411 |
1 files changed, 175 insertions, 236 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xinttools.sty b/Master/texmf-dist/tex/generic/xint/xinttools.sty index 4cb247565da..1b33f23c4a5 100644 --- a/Master/texmf-dist/tex/generic/xint/xinttools.sty +++ b/Master/texmf-dist/tex/generic/xint/xinttools.sty @@ -21,7 +21,7 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% --------------------------------------------------------------- -%% The xint bundle 1.2h 2016/11/20 +%% The xint bundle 1.2i 2016/12/13 %% Copyright (C) 2013-2016 by Jean-Francois Burnol %% xinttools: Expandable and non-expandable utilities %% --------------------------------------------------------------- @@ -70,7 +70,7 @@ \XINTsetupcatcodes% defined in xintkernel.sty \XINT_providespackage \ProvidesPackage{xinttools}% - [2016/11/20 1.2h Expandable and non-expandable utilities (JFB)]% + [2016/12/13 1.2i Expandable and non-expandable utilities (JFB)]% \newtoks\XINT_toks \xint_firstofone{\let\XINT_sptoken= } %<- space here! \def\xintgodef {\global\xintodef }% @@ -237,57 +237,58 @@ \def\XINT_nthelt_a #1% {% \xint_UDzerominusfork - #1-{\XINT_nthelt_zero }% - 0#1{\XINT_nthelt_neg }% + #1-\XINT_nthelt_zero + 0#1\XINT_nthelt_neg 0-{\XINT_nthelt_pos #1}% \krof }% \def\XINT_nthelt_zero .{\xintlength }% \long\def\XINT_nthelt_neg #1.#2% {% - \expandafter\XINT_nthelt_neg_a\the\numexpr - \XINT_length_loop - 0.#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye +\xint_c_i -#1.% - #2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \expandafter\XINT_nthelt_neg_a\the\numexpr\xint_c_x\XINT_length_loop + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye + -#1.#2\xint_bye }% \def\XINT_nthelt_neg_a #1% {% \xint_UDzerominusfork - #1-{\XINT_nthelt_none }% - 0#1{\XINT_nthelt_none }% - 0-{\XINT_nthelt_loop_a #1}% + #1-\xint_byeandstop + 0#1\xint_byeandstop + 0-{}% \krof + \expandafter\XINT_nthelt_neg_b + \romannumeral\expandafter\XINT_gobble\the\numexpr-\xint_c_i+#1% }% -\long\def\XINT_nthelt_none #1\xint_bye{ }% +\long\def\XINT_nthelt_neg_b #1#2\xint_bye{ #1}% \long\def\XINT_nthelt_pos #1.#2% {% - \XINT_nthelt_loop_a #1.% + \expandafter\XINT_nthelt_loop\the\numexpr\xint_c_ix-#1.% #2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_nthelt_loop_a #1.% +\def\XINT_nthelt_loop #1% {% - \ifnum #1>\xint_c_viii - \expandafter\XINT_nthelt_loop_b - \else - \expandafter\XINT_nthelt_getit - \fi #1.% + \xint_UDsignfork + #1\XINT_nthelt_loop_a + -{\XINT_nthelt_getit #1}% + \krof }% -\long\def\XINT_nthelt_loop_b #1.#2#3#4#5#6#7#8#9% +\long\def\XINT_nthelt_loop_a #1.#2#3#4#5#6#7#8#9% {% - \xint_gob_til_xint_relax #9\XINT_nthelt_none\xint_relax - \expandafter\XINT_nthelt_loop_a\the\numexpr #1-\xint_c_viii.% + \xint_gob_til_xint_relax #9\xint_byeandstop\xint_relax + \expandafter\XINT_nthelt_loop\the\numexpr\xint_c_viii-#1.% }% \def\XINT_nthelt_getit #1.% {% \expandafter\expandafter\expandafter\XINT_nthelt_finish - \csname xint_gobble_\romannumeral\numexpr#1-\xint_c_i\endcsname + \csname xint_gobble_\romannumeral\numexpr\xint_c_viii-#1\endcsname }% \long\edef\XINT_nthelt_finish #1#2\xint_bye {\noexpand\xint_gob_til_xint_relax #1\noexpand\expandafter\space - \noexpand\xint_gobble_ii\xint_relax\space #1}% + \noexpand\xint_gobble_ii\xint_relax\space #1}% \def\xintKeep {\romannumeral0\xintkeep }% \def\xintKeepNoExpand {\romannumeral0\xintkeepnoexpand }% \long\def\xintkeep #1#2{\expandafter\XINT_keep_a\the\numexpr #1\expandafter.% @@ -296,8 +297,8 @@ \def\XINT_keep_a #1% {% \xint_UDzerominusfork - #1-{\XINT_keep_keepnone }% - 0#1{\XINT_keep_neg }% + #1-\XINT_keep_keepnone + 0#1\XINT_keep_neg 0-{\XINT_keep_pos #1}% \krof }% @@ -305,84 +306,55 @@ \long\def\XINT_keep_neg #1.#2% {% \expandafter\XINT_keep_neg_a\the\numexpr - \XINT_length_loop - 0.#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% - #2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + #1-\numexpr\xint_c_ix\XINT_length_loop + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye.#2% }% \def\XINT_keep_neg_a #1% {% - \xint_UDzerominusfork - #1-{\XINT_keep_keepall }% - 0#1{\XINT_keep_keepall }% - 0-{\XINT_trim_loop_a #1}% + \xint_UDsignfork + #1{\expandafter\space\romannumeral\XINT_gobble}% + -\XINT_keep_keepall \krof }% -\def\XINT_keep_keepall #1.{\XINT_keep_keepall_a \space}% -\def\XINT_keep_keepall_a #1\xint_relax #2\xint_bye {#1}% +\def\XINT_keep_keepall #1.{ }% \long\def\XINT_keep_pos #1.#2% {% - \XINT_keep_loop_a #1.% - {}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye -}% -\def\XINT_keep_loop_a #1.% -{% - \ifnum #1>\xint_c_vi - \expandafter\XINT_keep_loop_b - \else - \expandafter\XINT_keep_finish - \fi - #1.% -}% -\long\def\XINT_keep_loop_b #1.#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_xint_relax #9\XINT_keep_enda\xint_relax - \expandafter\XINT_keep_loop_c\the\numexpr #1-\xint_c_vii.% - {{#3}{#4}{#5}{#6}{#7}{#8}{#9}}{#2}% -}% -\long\def\XINT_keep_loop_c #1.#2#3{\XINT_keep_loop_a #1.{#3#2}}% -\long\def\XINT_keep_enda #1.#2#3#4\xint_bye -{% - \XINT_keep_endb #4\W\W\W\W\W\W\Z #2{#3}% -}% -\def\XINT_keep_endb #1#2#3#4#5#6#7\Z -{% - \xint_gob_til_W - #1\XINT_keep_endc_ - #2\XINT_keep_endc_i - #3\XINT_keep_endc_ii - #4\XINT_keep_endc_iii - #5\XINT_keep_endc_iv - #6\XINT_keep_endc_v - \W\XINT_keep_endc_vi\Z -}% -\long\def\XINT_keep_endc_ #1\Z #2#3#4#5#6#7#8#9{ #9}% -\long\def\XINT_keep_endc_i #1\Z #2#3#4#5#6#7#8#9{#9{#2}}% -\long\def\XINT_keep_endc_ii #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}}% -\long\def\XINT_keep_endc_iii #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}}% -\long\def\XINT_keep_endc_iv #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}{#5}}% -\long\def\XINT_keep_endc_v #1\Z #2#3#4#5#6#7#8#9{#9{#2}{#3}{#4}{#5}{#6}}% -\long\def\XINT_keep_endc_vi\Z #1#2#3#4#5#6#7#8{#8{#1}{#2}{#3}{#4}{#5}{#6}}% -\long\def\XINT_keep_finish #1.#2#3#4#5#6#7#8#9\xint_bye -{% - \XINT_keep_finish_a #1.% - #3\xint_c_ #4\xint_c_i #5\xint_c_ii #6\xint_c_iii #7\xint_c_iv - #8\xint_c_v\xint_relax\xint_c_vi\xint_bye - {#3}{#4}{#5}{#6}{#7}{#8}\xint_bye {#2}% -}% -\long\def\XINT_keep_finish_a #1.#2\xint_relax #3#4\xint_bye -{% - \csname XINT_keep_finish_b\romannumeral\ifnum#1>#3#3\else#1\fi\endcsname -}% -\long\def\XINT_keep_finish_b #1\xint_bye #2{ #2}% -\long\def\XINT_keep_finish_bi #1#2\xint_bye #3{#3{#1}}% -\long\def\XINT_keep_finish_bii #1#2#3\xint_bye #4{#4{#1}{#2}}% -\long\def\XINT_keep_finish_biii#1#2#3#4\xint_bye #5{#5{#1}{#2}{#3}}% -\long\def\XINT_keep_finish_biv #1#2#3#4#5\xint_bye #6{#6{#1}{#2}{#3}{#4}}% -\long\def\XINT_keep_finish_bv #1#2#3#4#5#6\xint_bye #7{#7{#1}{#2}{#3}{#4}{#5}}% -\long\def\XINT_keep_finish_bvi #1\xint_bye #2{#2#1}% + \expandafter\XINT_keep_loop + \the\numexpr#1-\XINT_lengthupto_loop + #1.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + -\xint_c_viii.{}#2\xint_bye% +}% +\def\XINT_keep_loop #1#2.% +{% + \xint_gob_til_minus#1\XINT_keep_loop_end-% + \expandafter\XINT_keep_loop + \the\numexpr#1#2-\xint_c_viii\expandafter.\XINT_keep_loop_pickeight +}% +\long\def\XINT_keep_loop_pickeight + #1#2#3#4#5#6#7#8#9{{#1{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}% +\def\XINT_keep_loop_end-\expandafter\XINT_keep_loop + \the\numexpr-#1-\xint_c_viii\expandafter.\XINT_keep_loop_pickeight + {\csname XINT_keep_end#1\endcsname}% +\long\expandafter\def\csname XINT_keep_end1\endcsname + #1#2#3#4#5#6#7#8#9\xint_bye { #1{#2}{#3}{#4}{#5}{#6}{#7}{#8}}% +\long\expandafter\def\csname XINT_keep_end2\endcsname + #1#2#3#4#5#6#7#8\xint_bye { #1{#2}{#3}{#4}{#5}{#6}{#7}}% +\long\expandafter\def\csname XINT_keep_end3\endcsname + #1#2#3#4#5#6#7\xint_bye { #1{#2}{#3}{#4}{#5}{#6}}% +\long\expandafter\def\csname XINT_keep_end4\endcsname + #1#2#3#4#5#6\xint_bye { #1{#2}{#3}{#4}{#5}}% +\long\expandafter\def\csname XINT_keep_end5\endcsname + #1#2#3#4#5\xint_bye { #1{#2}{#3}{#4}}% +\long\expandafter\def\csname XINT_keep_end6\endcsname + #1#2#3#4\xint_bye { #1{#2}{#3}}% +\long\expandafter\def\csname XINT_keep_end7\endcsname + #1#2#3\xint_bye { #1{#2}}% +\long\expandafter\def\csname XINT_keep_end8\endcsname + #1#2\xint_bye { #1}% \def\xintKeepUnbraced {\romannumeral0\xintkeepunbraced }% \def\xintKeepUnbracedNoExpand {\romannumeral0\xintkeepunbracednoexpand }% \long\def\xintkeepunbraced #1#2% @@ -393,74 +365,46 @@ \def\XINT_keepunbr_a #1% {% \xint_UDzerominusfork - #1-{\XINT_keep_keepnone }% - 0#1{\XINT_keep_neg }% + #1-\XINT_keep_keepnone + 0#1\XINT_keep_neg 0-{\XINT_keepunbr_pos #1}% \krof }% \long\def\XINT_keepunbr_pos #1.#2% {% - \XINT_keepunbr_loop_a #1.% - {}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye -}% -\def\XINT_keepunbr_loop_a #1.% -{% - \ifnum #1>\xint_c_vi - \expandafter\XINT_keepunbr_loop_b - \else - \expandafter\XINT_keepunbr_finish - \fi - #1.% -}% -\long\def\XINT_keepunbr_loop_b #1.#2#3#4#5#6#7#8#9% -{% - \xint_gob_til_xint_relax #9\XINT_keepunbr_enda\xint_relax - \expandafter\XINT_keepunbr_loop_c\the\numexpr #1-\xint_c_vii.% - {#3}{#4}{#5}{#6}{#7}{#8}{#9}.{#2}% -}% -\long\def\XINT_keepunbr_loop_c #1.#2#3#4#5#6#7#8.#9% - {\XINT_keepunbr_loop_a #1.{#9#2#3#4#5#6#7#8}}% -\long\def\XINT_keepunbr_enda #1.#2.#3#4\xint_bye -{% - \XINT_keepunbr_endb #4\W\W\W\W\W\W\Z #2{#3}% -}% -\def\XINT_keepunbr_endb #1#2#3#4#5#6#7\Z -{% - \xint_gob_til_W - #1\XINT_keepunbr_endc_ - #2\XINT_keepunbr_endc_i - #3\XINT_keepunbr_endc_ii - #4\XINT_keepunbr_endc_iii - #5\XINT_keepunbr_endc_iv - #6\XINT_keepunbr_endc_v - \W\XINT_keepunbr_endc_vi\Z -}% -\long\def\XINT_keepunbr_endc_ #1\Z #2#3#4#5#6#7#8#9{ #9}% -\long\def\XINT_keepunbr_endc_i #1\Z #2#3#4#5#6#7#8#9{ #9#2}% -\long\def\XINT_keepunbr_endc_ii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3}% -\long\def\XINT_keepunbr_endc_iii #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4}% -\long\def\XINT_keepunbr_endc_iv #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5}% -\long\def\XINT_keepunbr_endc_v #1\Z #2#3#4#5#6#7#8#9{ #9#2#3#4#5#6}% -\long\def\XINT_keepunbr_endc_vi\Z #1#2#3#4#5#6#7#8{ #8#1#2#3#4#5#6}% -\long\def\XINT_keepunbr_finish #1.#2#3#4#5#6#7#8#9\xint_bye -{% - \XINT_keepunbr_finish_a #1.% - #3\xint_c_ #4\xint_c_i #5\xint_c_ii #6\xint_c_iii #7\xint_c_iv - #8\xint_c_v\xint_relax\xint_c_vi\xint_bye - {#3}{#4}{#5}{#6}{#7}{#8}\xint_bye {#2}% -}% -\long\def\XINT_keepunbr_finish_a #1.#2\xint_relax #3#4\xint_bye -{% - \csname XINT_keepunbr_finish_b\romannumeral\ifnum#1>#3#3\else#1\fi\endcsname -}% -\long\def\XINT_keepunbr_finish_b #1\xint_bye #2{ #2}% -\long\def\XINT_keepunbr_finish_bi #1#2\xint_bye #3{ #3#1}% -\long\def\XINT_keepunbr_finish_bii #1#2#3\xint_bye #4{ #4#1#2}% -\long\def\XINT_keepunbr_finish_biii#1#2#3#4\xint_bye #5{ #5#1#2#3}% -\long\def\XINT_keepunbr_finish_biv #1#2#3#4#5\xint_bye #6{ #6#1#2#3#4}% -\long\def\XINT_keepunbr_finish_bv #1#2#3#4#5#6\xint_bye #7{ #7#1#2#3#4#5}% -\long\def\XINT_keepunbr_finish_bvi #1#2#3#4#5#6\xint_bye #7{ #7#1#2#3#4#5#6}% + \expandafter\XINT_keepunbr_loop + \the\numexpr#1-\XINT_lengthupto_loop + #1.#2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye + -\xint_c_viii.{}#2\xint_bye% +}% +\def\XINT_keepunbr_loop #1#2.% +{% + \xint_gob_til_minus#1\XINT_keepunbr_loop_end-% + \expandafter\XINT_keepunbr_loop + \the\numexpr#1#2-\xint_c_viii\expandafter.\XINT_keepunbr_loop_pickeight +}% +\long\def\XINT_keepunbr_loop_pickeight + #1#2#3#4#5#6#7#8#9{{#1#2#3#4#5#6#7#8#9}}% +\def\XINT_keepunbr_loop_end-\expandafter\XINT_keepunbr_loop + \the\numexpr-#1-\xint_c_viii\expandafter.\XINT_keepunbr_loop_pickeight + {\csname XINT_keepunbr_end#1\endcsname}% +\long\expandafter\def\csname XINT_keepunbr_end1\endcsname + #1#2#3#4#5#6#7#8#9\xint_bye { #1#2#3#4#5#6#7#8}% +\long\expandafter\def\csname XINT_keepunbr_end2\endcsname + #1#2#3#4#5#6#7#8\xint_bye { #1#2#3#4#5#6#7}% +\long\expandafter\def\csname XINT_keepunbr_end3\endcsname + #1#2#3#4#5#6#7\xint_bye { #1#2#3#4#5#6}% +\long\expandafter\def\csname XINT_keepunbr_end4\endcsname + #1#2#3#4#5#6\xint_bye { #1#2#3#4#5}% +\long\expandafter\def\csname XINT_keepunbr_end5\endcsname + #1#2#3#4#5\xint_bye { #1#2#3#4}% +\long\expandafter\def\csname XINT_keepunbr_end6\endcsname + #1#2#3#4\xint_bye { #1#2#3}% +\long\expandafter\def\csname XINT_keepunbr_end7\endcsname + #1#2#3\xint_bye { #1#2}% +\long\expandafter\def\csname XINT_keepunbr_end8\endcsname + #1#2\xint_bye { #1}% \def\xintTrim {\romannumeral0\xinttrim }% \def\xintTrimNoExpand {\romannumeral0\xinttrimnoexpand }% \long\def\xinttrim #1#2{\expandafter\XINT_trim_a\the\numexpr #1\expandafter.% @@ -469,8 +413,8 @@ \def\XINT_trim_a #1% {% \xint_UDzerominusfork - #1-{\XINT_trim_trimnone }% - 0#1{\XINT_trim_neg }% + #1-\XINT_trim_trimnone + 0#1\XINT_trim_neg 0-{\XINT_trim_pos #1}% \krof }% @@ -478,47 +422,44 @@ \long\def\XINT_trim_neg #1.#2% {% \expandafter\XINT_trim_neg_a\the\numexpr - \XINT_length_loop - 0.#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% - {}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye + #1-\numexpr\xint_c_ix\XINT_length_loop + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye + .{}#2\xint_bye }% \def\XINT_trim_neg_a #1% {% - \xint_UDzerominusfork - #1-{\XINT_trim_trimall }% - 0#1{\XINT_trim_trimall }% - 0-{\XINT_keep_loop_a #1}% + \xint_UDsignfork + #1{\expandafter\XINT_keep_loop\the\numexpr-\xint_c_viii+}% + -\XINT_trim_trimall \krof }% -\long\def\XINT_trim_trimall #1\xint_bye { }% +\edef\XINT_trim_trimall {\noexpand\expandafter\space\noexpand\xint_bye}% \long\def\XINT_trim_pos #1.#2% {% - \XINT_trim_loop_a #1.% + \expandafter\XINT_trim_loop\the\numexpr#1-\xint_c_viii.% #2\xint_relax\xint_relax\xint_relax\xint_relax \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye }% -\def\XINT_trim_loop_a #1.% +\def\XINT_trim_loop #1% {% - \ifnum #1>\xint_c_vii - \expandafter\XINT_trim_loop_b - \else - \expandafter\XINT_trim_finish - \fi - #1.% + \xint_UDsignfork + #1\XINT_trim_finish + -\XINT_trim_loop_a + \krof #1% }% -\long\def\XINT_trim_loop_b #1.#2#3#4#5#6#7#8#9% +\long\def\XINT_trim_loop_a #1.#2#3#4#5#6#7#8#9% {% - \xint_gob_til_xint_relax #9\XINT_trim_silentend\xint_relax - \expandafter\XINT_trim_loop_a\the\numexpr #1-\xint_c_viii.% + \xint_gob_til_xint_relax #9\xint_bye_thenstop\xint_relax + \expandafter\XINT_trim_loop\the\numexpr#1-\xint_c_viii.% }% -\def\XINT_trim_silentend #1\xint_bye { }% -\def\XINT_trim_finish #1.% +\def\XINT_trim_finish -#1.% {% \expandafter\expandafter\expandafter\XINT_trim_finish_a - \expandafter\expandafter\expandafter\space % avoids brace removal - \csname xint_gobble_\romannumeral#1\endcsname + \expandafter\expandafter\expandafter\space + \csname xint_gobble_\romannumeral\numexpr\xint_c_viii-#1\endcsname }% \long\def\XINT_trim_finish_a #1\xint_relax #2\xint_bye {#1}% \def\xintTrimUnbraced {\romannumeral0\xinttrimunbraced }% @@ -531,26 +472,26 @@ \def\XINT_trimunbr_a #1% {% \xint_UDzerominusfork - #1-{\XINT_trim_trimnone }% - 0#1{\XINT_trimunbr_neg }% + #1-\XINT_trim_trimnone + 0#1\XINT_trimunbr_neg 0-{\XINT_trim_pos #1}% \krof }% \long\def\XINT_trimunbr_neg #1.#2% {% \expandafter\XINT_trimunbr_neg_a\the\numexpr - \XINT_length_loop - 0.#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_relax\xint_bye -#1.% - {}#2\xint_relax\xint_relax\xint_relax\xint_relax - \xint_relax\xint_relax\xint_relax\xint_bye + #1-\numexpr\xint_c_ix\XINT_length_loop + #2\xint_relax\xint_relax\xint_relax\xint_relax + \xint_relax\xint_relax\xint_relax\xint_relax\xint_relax + \xint_c_i\xint_c_ii\xint_c_iii\xint_c_iv + \xint_c_v\xint_c_vi\xint_c_vii\xint_c_viii\xint_c_ix\xint_bye + .{}#2\xint_bye }% \def\XINT_trimunbr_neg_a #1% {% - \xint_UDzerominusfork - #1-{\XINT_trim_trimall }% - 0#1{\XINT_trim_trimall }% - 0-{\XINT_keepunbr_loop_a #1}% + \xint_UDsignfork + #1{\expandafter\XINT_keepunbr_loop\the\numexpr-\xint_c_viii+}% + -\XINT_trim_trimall \krof }% \def\xintApply {\romannumeral0\xintapply }% @@ -813,6 +754,7 @@ \long\def\xintBreakFor #1Z{}% \long\def\xintBreakForAndDo #1#2Z{#1}% \def\xintFor {\let\xintifForFirst\xint_firstoftwo + \let\xintifForLast\xint_secondoftwo \futurelet\XINT_token\XINT_for_ifstar }% \def\XINT_for_ifstar {\ifx\XINT_token*\expandafter\XINT_forx \else\expandafter\XINT_for \fi }% @@ -873,7 +815,8 @@ \XINT_toks {{#3}}% \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname \the\XINT_toks \csname XINT_for_right#1\endcsname }% - \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_for_d #1{#2}}% + \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo\XINT_for_d #1{#2}}% \futurelet\XINT_token\XINT_for_last? }% \long\def\XINT_forx_d #1#2#3% @@ -882,15 +825,19 @@ \XINT_toks {{#3}}% \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname \the\XINT_toks \csname XINT_for_right#1\endcsname }% - \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo\XINT_forx_d #1{#2}}% + \XINT_toks {\XINT_x\let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo\XINT_forx_d #1{#2}}% \XINT_xflet\XINT_for_last? }% \def\XINT_for_last? {% - \let\xintifForLast\xint_secondoftwo - \ifx\XINT_token Z\let\xintifForLast\xint_firstoftwo - \xint_afterfi{\xintBreakForAndDo{\XINT_x\xint_gobble_i Z}}\fi - \the\XINT_toks + \ifx\XINT_token Z\expandafter\XINT_for_last?yes\fi + \the\XINT_toks +}% +\def\XINT_for_last?yes +{% + \let\xintifForLast\xint_firstoftwo + \xintBreakForAndDo{\XINT_x\xint_gobble_i Z}% }% \catcode`U 3 \catcode`D 3 @@ -980,12 +927,14 @@ \the\XINT_toks \csname XINT_for_right#1\endcsname }% \XINT_x \let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo \expandafter\XINT_forever_d\expandafter #1\romannumeral`&&@#4{#2}{#3}#4{#5}% }% \catcode`j 3 \long\def\xintForpair #1#2#3in#4#5#6% {% \let\xintifForFirst\xint_firstoftwo + \let\xintifForLast\xint_secondoftwo \XINT_toks {\XINT_forpair_d #2{#6}}% \expandafter\the\expandafter\XINT_toks #4jZ% }% @@ -995,18 +944,16 @@ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}% \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname \the\XINT_toks \csname XINT_for_right\the\numexpr#1+\xint_c_i\endcsname}% - \let\xintifForLast\xint_secondoftwo - \ifx #5j\expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi - {\let\xintifForLast\xint_firstoftwo - \xintBreakForAndDo {\XINT_x \xint_gobble_i Z}}% + \ifx #5j\expandafter\XINT_for_last?yes\fi \XINT_x - \let\xintifForFirst\xint_secondoftwo\XINT_forpair_d #1{#2}% + \let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo + \XINT_forpair_d #1{#2}% }% \long\def\xintForthree #1#2#3in#4#5#6% {% \let\xintifForFirst\xint_firstoftwo + \let\xintifForLast\xint_secondoftwo \XINT_toks {\XINT_forthree_d #2{#6}}% \expandafter\the\expandafter\XINT_toks #4jZ% }% @@ -1016,18 +963,16 @@ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}% \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname \the\XINT_toks \csname XINT_for_right\the\numexpr#1+\xint_c_ii\endcsname}% - \let\xintifForLast\xint_secondoftwo - \ifx #5j\expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi - {\let\xintifForLast\xint_firstoftwo - \xintBreakForAndDo {\XINT_x \xint_gobble_i Z}}% + \ifx #5j\expandafter\XINT_for_last?yes\fi \XINT_x - \let\xintifForFirst\xint_secondoftwo\XINT_forthree_d #1{#2}% + \let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo + \XINT_forthree_d #1{#2}% }% \long\def\xintForfour #1#2#3in#4#5#6% {% \let\xintifForFirst\xint_firstoftwo + \let\xintifForLast\xint_secondoftwo \XINT_toks {\XINT_forfour_d #2{#6}}% \expandafter\the\expandafter\XINT_toks #4jZ% }% @@ -1037,14 +982,11 @@ \XINT_toks \expandafter{\romannumeral0\xintcsvtolist{ #4}}% \long\edef\XINT_x {\noexpand\XINT_y \csname XINT_for_left#1\endcsname \the\XINT_toks \csname XINT_for_right\the\numexpr#1+\xint_c_iii\endcsname}% - \let\xintifForLast\xint_secondoftwo - \ifx #5j\expandafter\xint_firstoftwo - \else\expandafter\xint_secondoftwo - \fi - {\let\xintifForLast\xint_firstoftwo - \xintBreakForAndDo {\XINT_x \xint_gobble_i Z}}% + \ifx #5j\expandafter\XINT_for_last?yes\fi \XINT_x - \let\xintifForFirst\xint_secondoftwo\XINT_forfour_d #1{#2}% + \let\xintifForFirst\xint_secondoftwo + \let\xintifForLast\xint_secondoftwo + \XINT_forfour_d #1{#2}% }% \catcode`Z 11 \catcode`j 11 @@ -1221,10 +1163,9 @@ }% \def\XINT_trim:f:csv_loop_b #1.#2,#3,#4,#5,#6,#7,#8,#9,% {% - \xint_gob_til_xint_relax #9\XINT_trim:f:csv_silentend\xint_relax + \xint_gob_til_xint_relax #9\xint_bye_thenstop\xint_relax \expandafter\XINT_trim:f:csv_loop_a\the\numexpr #1-\xint_c_viii.% }% -\def\XINT_trim:f:csv_silentend #1\xint_bye { }% \def\XINT_trim:f:csv_finish #1.% {% \expandafter\XINT_trim:f:csv_finish_a @@ -1249,12 +1190,11 @@ \def\XINT_keep:f:csv_a #1% {% \xint_UDzerominusfork - #1-{\XINT_keep:f:csv_zero }% - 0#1{\XINT_keep:f:csv_neg }% + #1-\xint_bye_thenstop + 0#1\XINT_keep:f:csv_neg 0-{\XINT_keep:f:csv_pos #1}% \krof }% -\def\XINT_keep:f:csv_zero .#1\xint_bye{ }% \def\XINT_keep:f:csv_neg #1.#2\xint_relax% {% \expandafter\XINT_keep:f:csv_neg_b @@ -1336,12 +1276,11 @@ \def\XINT_nthelt:f:csv_neg_a #1% {% \xint_UDzerominusfork - #1-{\XINT_nthelt:f:csv_none }% - 0#1{\XINT_nthelt:f:csv_none }% + #1-\xint_bye_thenstop + 0#1\xint_bye_thenstop 0-{\XINT_nthelt:f:csv_loop_a #1}% \krof }% -\def\XINT_nthelt:f:csv_none #1\xint_bye { }% \long\def\XINT_nthelt:f:csv_pos #1.#2% {% \expandafter\XINT_nthelt:f:csv_loop_a\the\numexpr #1+\xint_c_i\expandafter.% |