diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv | 94 |
1 files changed, 55 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv index 825d1863641..eb5b3b90a64 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv +++ b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv @@ -3040,7 +3040,7 @@ \endgroup} %D \macros -%D {writestring,writeline,writebanner, +%D {writestring,writeline, %D writestatus,statuswidth,normalwritestatus} %D %D Maybe one didn't notice, but we've already introduced a @@ -3063,11 +3063,8 @@ \ifdefined\writestring \else - \newtoks\everywritestring - - \def\writedirect {\immediate\write\statuswrite} - \def\writeline {\writedirect{}} - \unexpanded\def\writestring#1{\begingroup\the\everywritestring\writedirect{#1}\endgroup} + \unexpanded\def\writestring{\immediate\write\statuswrite} + \unexpanded\def\writeline {\writestring{}} \fi @@ -3100,15 +3097,14 @@ %D a macro accepting two arguments and a boolean (in fact a %D few macro's too). -\newif\ifdebuggerinfo - -\unexpanded\def\debuggerinfo#1#2% - {\ifdebuggerinfo - \writestatus{debugger}{#1:: #2}% - \fi} - -\ifdefined\writestatus \else \let\writestatus\normalwritestatus \fi -\ifdefined\writebanner \else \unexpanded\def\writebanner{\writestring} \fi +% \newif\ifdebuggerinfo +% +% \unexpanded\def\debuggerinfo#1#2% +% {\ifdebuggerinfo +% \writestatus{debugger}{#1:: #2}% +% \fi} +% +% \ifdefined\writestatus \else \let\writestatus\normalwritestatus \fi % % % % % % % % % % % % % % % % % % % % % % % % @@ -3190,7 +3186,7 @@ %D are needed: \unexpanded\def\newif#1% - {\scratchcounter\escapechar + {\privatescratchcounter\escapechar \escapechar\minusone \expandafter\expandafter\expandafter \redoglobal\expandafter\expandafter\expandafter @@ -3199,7 +3195,7 @@ \redoglobal\expandafter\expandafter\expandafter \edef\@if#1{false}{\let\noexpand#1\noexpand\iffalse}% \dodoglobal\@if#1{false}% - \escapechar\scratchcounter} + \escapechar\privatescratchcounter} %D Also new: @@ -3849,15 +3845,16 @@ \global\expandafter\def\csname\??recurseaction\recursedepth\endcsname##1##2{#4}% \global\expandafter\let\csname\??recurseindex\recursedepth\endcsname\recurselevel \csname\??recursestepwise + % we need the x in order to avoid the \relax that tex adds \ifnum#3>\zerocount - \ifnum#2<#1\else d\fi + \ifnum#2<#1x\else d\fi \else\ifnum#3<\zerocount - \ifnum#1<#2\else r\fi + \ifnum#1<#2x\else r\fi \fi\fi \expandafter\endcsname\normalexpanded{{\number#1}{\number#2}{\number#3}}} % \expandafter\endcsname\expandafter{\number#1\expandafter}\expandafter{\number#2\expandafter}\expandafter{\number#3}} -\letvalue{\??recursestepwise }\syst_helpers_stepwise_exit +\letvalue{\??recursestepwise x}\syst_helpers_stepwise_exit \letvalue{\??recursestepwise d}\syst_helpers_stepwise_recurse \letvalue{\??recursestepwise r}\syst_helpers_stepwise_reverse @@ -4200,9 +4197,9 @@ %D Watch the one level expansion of the second argument. \unexpanded\def\doifelsemeaning#1#2% - {\edef\m_syst_string_one{\meaning#1}% + {\edef\m_syst_string_one{\normalmeaning#1}% \def \m_syst_string_two{#2}% - \edef\m_syst_string_two{\meaning\m_syst_string_two}% + \edef\m_syst_string_two{\normalmeaning\m_syst_string_two}% \ifx\m_syst_string_one\m_syst_string_two \expandafter\firstoftwoarguments \else @@ -5141,6 +5138,25 @@ \expandafter\syst_helpers_split_string#1#2#2\empty\\} %D \macros +%D {splitatperiod, +%D {splitatcomma, +%D splitatasterisk, +%D splitatcolon, +%D splitatcolons} + +\unexpanded\def\splitatperiod #1{\normalexpanded{\syst_helpers_splitatperiod #1}..\relax} +\unexpanded\def\splitatcomma #1{\normalexpanded{\syst_helpers_splitatcomma #1},,\relax} % not at ", " +\unexpanded\def\splitatasterisk#1{\normalexpanded{\syst_helpers_splitatasterisk#1}**\relax} +\unexpanded\def\splitatcolon #1{\normalexpanded{\syst_helpers_splitatcolon #1}::\relax} +\unexpanded\def\splitatcolons #1{\normalexpanded{\syst_helpers_splitatcolons #1}::::\relax} + +\unexpanded\def\syst_helpers_splitatperiod #1.#2.#3\relax#4#5{\def#4{#1}\def#5{#2}} +\unexpanded\def\syst_helpers_splitatcomma #1,#2,#3\relax#4#5{\def#4{#1}\def#5{#2}} +\unexpanded\def\syst_helpers_splitatasterisk #1*#2*#3\relax#4#5{\def#4{#1}\def#5{#2}} +\unexpanded\def\syst_helpers_splitatcolon #1:#2:#3\relax#4#5{\def#4{#1}\def#5{#2}} +\unexpanded\def\syst_helpers_splitatcolons #1::#2::#3\relax#4#5{\edef#4{#1}\edef#5{#2}} + +%D \macros %D {removesubstring} %D %D A first application of the two routines defined above is: @@ -5526,7 +5542,7 @@ {\xdef\m_syst_helpers_push_macro{\csstring#1}% \c_syst_helpers_pop_count\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \global\advance\lastnamedcs \minusone - \expandafter\let\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname} + \global\expandafter\let\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname} \unexpanded\def\localpopmacro#1% {\xdef\m_syst_helpers_push_macro{\csstring#1}% @@ -6237,23 +6253,23 @@ {\def\m_syst_string_three{#1}% \ifx\m_syst_string_two\m_syst_string_three \else \ifx\m_syst_string_one\m_syst_string_three - \advance\scratchcounter\plusone + \advance\privatescratchcounter\plusone \fi \expandafter\syst_helpers_count_token \fi} \unexpanded\def\counttoken#1\in#2\to#3% - {\scratchcounter\zerocount + {\privatescratchcounter\zerocount \def\m_syst_string_one{#1}% \def\m_syst_string_two{\end}% \syst_helpers_count_token#2\end - \dodoglobal#3\scratchcounter} + \dodoglobal#3\privatescratchcounter} \unexpanded\def\counttokens#1\to#2% - {\scratchcounter\zerocount - \def\syst_helpers_count_token##1{\advance\scratchcounter\plusone}% + {\privatescratchcounter\zerocount + \def\syst_helpers_count_token##1{\advance\privatescratchcounter\plusone}% \handletokens#1\with\syst_helpers_count_token - \dodoglobal#2\scratchcounter} + \dodoglobal#2\privatescratchcounter} %D \macros %D {splitofftokens} @@ -6264,10 +6280,10 @@ \unexpanded\def\splitofftokens#1\from#2\to#3% slow but hardly used {\ifnum#1>\zerocount - \scratchcounter#1\relax + \privatescratchcounter#1\relax \def\syst_helpers_split_off_tokens##1% - {\ifnum\scratchcounter>\zerocount - \advance\scratchcounter \minusone + {\ifnum\privatescratchcounter>\zerocount + \advance\privatescratchcounter \minusone \edef#3{#3##1}% \fi}% % \let#3\empty % #3 can be #2, so: @@ -6463,7 +6479,7 @@ {\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty} \unexpanded\def\freezedimensionwithunit#1#2% - {\setdimensionwithunit\scratchdimen#1{#2}\edef#1{\the\scratchdimen}} + {\setdimensionwithunit\privatescratchdimen#1{#2}\edef#1{\the\privatescratchdimen}} %D \macros %D {doifsometokselse, doifsometoks} @@ -6718,7 +6734,7 @@ %D This is a dirty one: we simply append a unit and discard it when needed. \def\doifelsedimension#1% - {\afterassignment\syst_helpers_if_dimension_else\scratchdimen#1pt\relax} + {\afterassignment\syst_helpers_if_dimension_else\privatescratchdimen#1pt\relax} \let\doifdimensionelse\doifelsedimension @@ -6864,10 +6880,10 @@ \syst_helpers_unspaced} \unexpanded\def\unspaceargument#1\to#2% - {\scratchcounter\catcode\spaceasciicode + {\privatescratchcounter\catcode\spaceasciicode \catcode\spaceasciicode\ignorecatcode \scantextokens{\edef#2{#1}}% - \catcode\spaceasciicode\scratchcounter} + \catcode\spaceasciicode\privatescratchcounter} \unexpanded\def\unspaceafter#1#2% {\unspaceargument#2\to\ascii @@ -6924,7 +6940,7 @@ \def\syst_helpers_if_non_zero_positive_else#1#2\end % #3#4% {\ifx#1\relax - \ifcase\scratchcounter + \ifcase\privatescratchcounter \endgroup \doubleexpandafter\secondoftwoarguments \else @@ -6937,7 +6953,7 @@ \fi} \def\doifelsenonzeropositive#1% - {\begingroup\afterassignment\syst_helpers_if_non_zero_positive_else\scratchcounter=0#1\relax\empty\end} + {\begingroup\afterassignment\syst_helpers_if_non_zero_positive_else\privatescratchcounter=0#1\relax\empty\end} \let\doifnonzeropositiveelse\doifelsenonzeropositive @@ -7005,7 +7021,7 @@ \unexpanded\def\retestfeature % timer support is new per 10/5/2005 {\bgroup \ifcase\interactionmode\let\wait\relax\fi - \writestatus\m!system{starting feature test}\wait + \writestatus\m!system{starting feature test (n=\number\c_syst_helpers_test_feature_m)}\wait \resettimer \c_syst_helpers_test_feature_n\zerocount \syst_helpers_test_feature_step |