summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/xint/xint.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/xint/xint.sty')
-rw-r--r--Master/texmf-dist/tex/generic/xint/xint.sty69
1 files changed, 45 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/generic/xint/xint.sty b/Master/texmf-dist/tex/generic/xint/xint.sty
index bb99f667863..30747397538 100644
--- a/Master/texmf-dist/tex/generic/xint/xint.sty
+++ b/Master/texmf-dist/tex/generic/xint/xint.sty
@@ -22,7 +22,7 @@
%% in the same archive or directory.)
%%
%%----------------------------------------------------------------
-%% The xint bundle (version 1.09c of October 9, 2013)
+%% The xint bundle (version 1.09d of October 22, 2013)
%% xint: Expandable operations on long numbers
%% Copyright (C) 2013 by Jean-Francois Burnol
%%----------------------------------------------------------------
@@ -152,7 +152,7 @@
\fi
\XINT_providespackage
\ProvidesPackage {xint}%
- [2013/10/09 v1.09c Expandable operations on long numbers (jfB)]%
+ [2013/10/22 v1.09d Expandable operations on long numbers (jfB)]%
\def\xint_gobble_ {}%
\def\xint_gobble_i #1{}%
\def\xint_gobble_ii #1#2{}%
@@ -163,6 +163,7 @@
\def\xint_gobble_vii #1#2#3#4#5#6#7{}%
\def\xint_gobble_viii #1#2#3#4#5#6#7#8{}%
\def\xint_firstofone #1{#1}%
+\xint_firstofone{\let\XINT_sptoken= } % 1.09d, 2013/10/22
\def\xint_firstoftwo #1#2{#1}%
\def\xint_secondoftwo #1#2{#2}%
\def\xint_firstoftwo_andstop #1#2{ #1}%
@@ -622,29 +623,40 @@
}%
\def\XINT_seqo_nd #1#2#3#4{\XINT_seqo_nb {#1}{#2}{#3}{#4{#1}}}%
\catcode`z 3%
+\def\XINT_xflet #1%
+{%
+ \expandafter\futurelet\expandafter\XINT_token
+ \expandafter#1\romannumeral-`0\romannumeral-`0%
+}%
\def\xintApplyInline #1#2%
{%
\expandafter\def\expandafter\XINT_inline_macro\expandafter ##\expandafter 1%
\expandafter {#1{##1}}%
- \expandafter\XINT_inline_b\romannumeral-`0#2z%
+ \XINT_xflet\XINT_inline_b #2z% THIS z HAS CATCODE 3
}%
\def\XINT_inline_b {\futurelet\XINT_token\XINT_inline_c }%
-\def\XINT_inline_c
+\def\XINT_inline_b
{%
- \ifx\XINT_token z\expandafter\xint_gobble_i
- \else \expandafter\XINT_inline_d
+ \ifx\XINT_token\XINT_sptoken
+ \xint_afterfi{\XINT_xflet\XINT_inline_b }%
+ \else
+ \xint_afterfi
+ {\ifx\XINT_token z\expandafter\xint_gobble_i
+ \else\expandafter\XINT_inline_d\fi }%
\fi
}%
\def\XINT_inline_d #1%
{%
- \def\XINT_item{{#1}}\futurelet\XINT_token\XINT_inline_e
+ \def\XINT_item{{#1}}\XINT_xflet\XINT_inline_e
}%
\def\XINT_inline_e
{%
- \ifx\XINT_token z%
- \expandafter\XINT_inline_w
+ \ifx\XINT_token\XINT_sptoken
+ \xint_afterfi{\XINT_xflet\XINT_inline_e }%
\else
- \expandafter\XINT_inline_f
+ \xint_afterfi
+ {\ifx\XINT_token z\expandafter\XINT_inline_w
+ \else \expandafter\XINT_inline_f\fi }%
\fi
}%
\def\XINT_inline_f
@@ -656,7 +668,7 @@
\expandafter\XINT_inline_macro\XINT_item
\def\XINT_inline_macro ##1{#1}\XINT_inline_d
}%
-\def\XINT_inline_w #1% swallows list terminator
+\def\XINT_inline_w #1%
{%
\expandafter\XINT_inline_macro\XINT_item
}%
@@ -666,12 +678,12 @@
\def\XINT_for #1#2in#3#4#5%
{%
\XINT_toks \expandafter{\csname XINT_for_d\romannumeral#2\endcsname {#5}}%
- \expandafter\XINT_for_b #3,z,%
+ \expandafter\XINT_for_b #3,z,% THIS z HAS CATCODE 3.
}%
\def\XINT_forx *#1#2in#3#4#5%
{%
\XINT_toks \expandafter{\csname XINT_forx_d\romannumeral#2\endcsname {#5}}%
- \expandafter\XINT_forx_b\romannumeral-`0#3z%
+ \XINT_xflet\XINT_forx_b #3z% THIS z HAS CATCODE 3.
}%
\def\XINT_for_b {\futurelet\XINT_token\XINT_for_c }%
\def\XINT_for_c
@@ -712,50 +724,59 @@
\ifx\XINT_token z\xint_afterfi{\expandafter\XINT_x \xint_gobble_iv}\fi
\the\XINT_toks
}%
-\def\XINT_forx_b {\futurelet\XINT_token\XINT_forx_c }%
-\def\XINT_forx_c
+\def\XINT_forx_b
{%
- \ifx\XINT_token z\expandafter\xint_gobble_iii\fi
- \the\XINT_toks
+ \ifx\XINT_token\XINT_sptoken
+ \xint_afterfi{\XINT_xflet\XINT_forx_b }%
+ \else
+ \xint_afterfi
+ {\ifx\XINT_token z\expandafter\xint_gobble_iii\fi
+ \the\XINT_toks }%
+ \fi
}%
\def\XINT_forx_di #1#2%
{%
\def\XINT_y ##1##2##3##4{#1}%
\def\XINT_x {\XINT_y {#2}{####2}{####3}{####4}}%
\XINT_toks {\XINT_x \XINT_forx_di {#1}}%
- \futurelet\XINT_token\XINT_forx_e
+ \XINT_xflet\XINT_forx_e
}%
\def\XINT_forx_dii #1#2%
{%
\def\XINT_y ##1##2##3##4{#1}%
\def\XINT_x {\XINT_y {####1}{#2}{####3}{####4}}%
\XINT_toks {\XINT_x \XINT_forx_dii {#1}}%
- \futurelet\XINT_token\XINT_forx_e
+ \XINT_xflet\XINT_forx_e
}%
\def\XINT_forx_diii #1#2%
{%
\def\XINT_y ##1##2##3##4{#1}%
\def\XINT_x {\XINT_y {####1}{####2}{#2}{####4}}%
\XINT_toks {\XINT_x \XINT_forx_diii {#1}}%
- \futurelet\XINT_token\XINT_forx_e
+ \XINT_xflet\XINT_forx_e
}%
\def\XINT_forx_div #1#2%
{%
\def\XINT_y ##1##2##3##4{#1}%
\def\XINT_x {\XINT_y {####1}{####2}{####3}{#2}}%
\XINT_toks {\XINT_x \XINT_forx_div {#1}}%
- \futurelet\XINT_token\XINT_forx_e
+ \XINT_xflet\XINT_forx_e
}%
\def\XINT_forx_e
{%
- \ifx\XINT_token z\xint_afterfi{\expandafter\XINT_x \xint_gobble_iii}\fi
- \the\XINT_toks
+ \ifx\XINT_token\XINT_sptoken
+ \xint_afterfi{\XINT_xflet\XINT_forx_e}%
+ \else
+ \xint_afterfi
+ {\ifx\XINT_token z\xint_afterfi{\expandafter\XINT_x \xint_gobble_iii}\fi
+ \the\XINT_toks }%
+ \fi
}%
\def\xintForpair #1#2#3#4in#5#6#7%
{%
\XINT_toks \expandafter{%
\csname XINT_forii_d\romannumeral#2\endcsname {#7}}%
- \expandafter\XINT_forii_b #5,z,%
+ \expandafter\XINT_forii_b #5,z,% THIS z HAS CATCODE 3
}%
\def\XINT_forii_b {\futurelet\XINT_token\XINT_forii_c }%
\def\XINT_forii_c