summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/syst-ext.mkii
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/syst-ext.mkii')
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ext.mkii29
1 files changed, 25 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/syst-ext.mkii b/Master/texmf-dist/tex/context/base/syst-ext.mkii
index 898ee8000a5..73fb98b728f 100644
--- a/Master/texmf-dist/tex/context/base/syst-ext.mkii
+++ b/Master/texmf-dist/tex/context/base/syst-ext.mkii
@@ -498,8 +498,8 @@
%D We cannot use the simple scheme:
%D
%D \starttyping
-%D \def\settrue#1{\let#1=\iftrue}
-%D \def\settrue#1{\let#1=\iffalse}
+%D \def\settrue #1{\let#1=\iftrue}
+%D \def\setfalse#1{\let#1=\iffalse}
%D \stoptyping
%D
%D Such an implementation gives problems with nested
@@ -969,7 +969,7 @@
%D for conditional errors.
%D Krzysztof Leszczynski suggested to provide access to the level by
-%D means of a \type {#1}. I decided to pass the more frquently used
+%D means of a \type {#1}. I decided to pass the more frequently used
%D level as \type {#1} and the less favoured depth as \type {#2}. The
%D intended usage is:
%D
@@ -997,6 +997,15 @@
\global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
\@EA\dodorecurse\@EA1\@EA{\number#1}}
+\long\def\ydorecurse#1#2%
+ {\global\advance\outerrecurse \plusone
+ \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
+ \let\recurselevel\!!plusone
+ \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}%
+ \expandrecursecontent
+ \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
+ \global\advance\outerrecurse \minusone}
+
\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
\long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}%
@@ -1040,13 +1049,21 @@
\def\recurselevel{\number\fastrecursecounter}%
\dodofastrecurse}
+\def\resetrecurselevel{\let\recurselevel\!!zerocount}
+
\def\dodofastrecurse
- {\ifnum\fastrecursecounter>\lastrecursecounter\else
+ {\ifnum\fastrecursecounter>\lastrecursecounter
+ % \resetrecurselevel % slows down
+ \else
\fastrecursebody
\advance\fastrecursecounter\steprecursecounter
\expandafter\dodofastrecurse
\fi}
+% \appendtoks \resetrecurselevel \to \everydump
+
+\everydump\expandafter{\the\everydump\resetrecurselevel}
+
%D This alternative looks a bit different and uses a
%D pseudo counter. When this macro is nested, we have to use
%D different counters. This time we use keywords.
@@ -4752,6 +4769,10 @@
\def\stopstrictinspectnextcharacter
{\let\inspectnextcharacter\normalinspectnextcharacter}
+\def\strictdoifnextoptionalelse#1#2%
+ {\startstrictinspectnextcharacter
+ \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
+
%D \macros
%D {gobblespacetokens}
%D