summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-10-01 21:05:19 +0000
committerKarl Berry <karl@freefriends.org>2020-10-01 21:05:19 +0000
commitac45ed8c9c41ead15554f580f98dac4fd93a21b8 (patch)
treedebbcd7c58017a3fa625cdbb027e317040c97e3a /Master/texmf-dist/tex/generic
parente66d6693f79686059c6e9fdf9eab8db3b0077c44 (diff)
tokcycle (1oct20)
git-svn-id: svn://tug.org/texlive/trunk@56501 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/tokcycle/tokcycle.tex31
1 files changed, 22 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/generic/tokcycle/tokcycle.tex b/Master/texmf-dist/tex/generic/tokcycle/tokcycle.tex
index 50b9dd4cc95..eeba320682b 100644
--- a/Master/texmf-dist/tex/generic/tokcycle/tokcycle.tex
+++ b/Master/texmf-dist/tex/generic/tokcycle/tokcycle.tex
@@ -1,7 +1,7 @@
\def\tcname {tokcycle}
-\def\tcver {1.12}
+\def\tcver {1.2}
%
-\def\tcdate {2020/02/11}
+\def\tcdate {2020/10/01}
%
% Author : Steven B Segletes, Christian Tellechea (contributor)
% Maintainer : Steven B Segletes
@@ -57,7 +57,8 @@
\def\addtc@depth{\advance\tc@depth 1}
\def\subtc@depth{\tc@depth=\numexpr\tc@depth-1\relax}
\def\tc@resetifs{\activetokfalse\implicittokfalse\tc@implicitgrpfalse
- \catSIXfalse\activecharfalse\activetokunexpandablefalse}
+ \catSIXfalse\activecharfalse\activetokunexpandablefalse
+ \def\theactivespace{}}
\long\def\count@stringtoks#1{\tc@earg\count@toks{\string#1}}
\long\def\count@toks#1{\the\numexpr-1\count@@toks#1.\tc@endcnt}
\long\def\count@@toks#1#2\tc@endcnt{+1\tc@ifempty{#2}{\relax}{\count@@toks#2\tc@endcnt}}
@@ -92,7 +93,7 @@
\def\endtokcycraw{\subtc@depth\tctestifnum{\tc@depth=0}{\@aftertokcycle}{}}
% LOOP ENTRY POINT
\def\@tokcycle{\tc@resetifs\futurelet\tc@next\detect@CANTabsorb}
-\def\detect@CANTabsorb{\tctestifx{\tc@next\tc@sptoken}{\stringify\@@@@@spcT}%
+\def\detect@CANTabsorb{\tctestifx{\tc@next\tc@sptoken}{\stringify\@@@@@@spcT}%
{\tctestifx{\tc@next\bgroup}{\stringify\@@@@grpT}{\can@absorb}}}
% NON cat1,10 TOKENS
\long\def\can@absorb#1{\tc@tok{#1}\trapcatSIX{#1}\expandafter\can@absorb@
@@ -103,12 +104,16 @@
\long\def\can@absorb@@#1{\let\@tmp=#1\test@ifmacro\@tmp{\implicittokfalse
\@macT#1}{\trapimplicitegrp#1\implicitgrpfork#1}\@tokcycle}
%CONVERT NEXT (SPACE OR BEGIN-GROUP) TOKEN TO STRING
-\def\stringify#1{\expandafter#1\string}% #1 WILL BE \@@@@@spcT or \@@@@grpT
+\def\stringify#1{\expandafter#1\string}% #1 WILL BE \@@@@@@spcT or \@@@@grpT
%SPACE DECODE
-\def\@@@@@spcT{\futurelet\tc@str\@@@@spcT}
-\def\@@@@spcT{\tctestifx{\tc@str\tc@sptoken}%
+\def\@@@@@@spcT{\futurelet\tc@str\@@@@@spcT}
+\def\@@@@@spcT{%
+ \tctestifx{\tc@str\tc@sptoken}%
{\def\@tmp{\@@spcT{ }}\expandafter\@tmp\tc@absorbSpace}% EXPLICIT SPACE
- {\implicittoktrue\expandafter\@@@spcT\tc@gobble}}% IMPLICIT SPACE
+ {\implicittoktrue\tctestifcon{\if\expandafter\@firstoftwo\string\\\tc@str}%
+ {\expandafter\@@@spcT\tc@gobble}% IMPLICIT MACRO SPACE
+ {\activetoktrue\@@@@spcT}}}% IMPLICIT ACTIVE SPACE
+\def\@@@@spcT#1{\def\theactivespace{#1}\trapactivechar{#1}\@@spcT{\tc@sptoken}}
\def\@@@spcT{\csmk{\expandafter\@@spcT\thecs}}
\def\@@spcT#1{\@spcT{#1}\@tokcycle}
% GROUP DECODE
@@ -223,4 +228,12 @@ v1.12 2020/02/11
- Documentation correction: \tokcycleenvironment, not \tokencycleenvironment
- Documentation correction: misspelling in tokcycle-examples.tex
- Redefined \tc@defx and \tc@earg to omit #2 as part of definition
- - Corrected \trapcatSIXb definition to account for revised \tc@earg definition. \ No newline at end of file
+ - Corrected \trapcatSIXb definition to account for revised \tc@earg definition.
+
+v1.2 2020/10/1
+ -Added/fixed capability to handle active-implicit spaces. While the
+ #1 passed to the \Spacedirective, in such a case, is an implicit
+ space \tc@sptoken, the name of the active character from whence it
+ originated in the input stream is stored as an explicit cat-12 token
+ in the definition \theactivespace. The flags \implicittok and \activetok
+ are both set true, and the \activechar flag is checked, as well. \ No newline at end of file