summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/toks-ini.mkiv
diff options
context:
space:
mode:
authorMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
committerMojca Miklavec <mojca.miklavec@gmail.com>2012-05-14 17:38:55 +0000
commit15995e10bfc68edf79970c4ea4fbb6678566c46e (patch)
tree2de7ca2a83f2d37ef043ad7429a5cb945bb79ddb /Master/texmf-dist/tex/context/base/toks-ini.mkiv
parentc9a39f716f1e5ec820ed3aab2c9aef25c5a9d730 (diff)
ConTeXt 2012.05.14 16:00
git-svn-id: svn://tug.org/texlive/trunk@26371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/toks-ini.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/toks-ini.mkiv42
1 files changed, 17 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/context/base/toks-ini.mkiv b/Master/texmf-dist/tex/context/base/toks-ini.mkiv
index 2aa2ed4a6ac..4eb756b7537 100644
--- a/Master/texmf-dist/tex/context/base/toks-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/toks-ini.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Initialization,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright=PRAGMA]
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
@@ -20,11 +20,11 @@
%D Handy for manuals \unknown
\unexpanded\def\starttokens [#1]{\ctxlua{tokens.collectors.install("#1","stoptokens")}}
-\let\stoptokens \relax
-\def\flushtokens [#1]{\ctxlua{tokens.collectors.flush("#1")}}
-\def\showtokens [#1]{\ctxlua{tokens.collectors.show("#1")}}
-\def\testtokens [#1]{\ctxlua{tokens.collectors.with_words("#1")}}
-\def\registertoken #1{\ctxlua{tokens.collectors.register("#1")}}
+ \let\stoptokens \relax
+ \def\flushtokens [#1]{\ctxlua{tokens.collectors.flush("#1")}}
+ \def\showtokens [#1]{\ctxlua{tokens.collectors.show("#1")}}
+ \def\testtokens [#1]{\ctxlua{tokens.collectors.with_words("#1")}}
+ \def\registertoken #1{\ctxlua{tokens.collectors.register("#1")}}
%D Inspired by a prototype by Taco for Thomas cum suis.
@@ -45,33 +45,25 @@
%
% \stoptext
-% incompatible with mkii ! ! ! ! so we need other names here
-%
-% \def\dograbuntil#1#2%
-% {\long\def\next##1#1{#2##1}\next}
-%
-% \def\grabuntil#1%
-% {\expandafter\dograbuntil\expandafter{\csname#1\endcsname}}
+\unexpanded\def\defineremapper[#1]%
+ {\setuevalue{\e!start#1}{\toks_start_remapper{#1}}%
+ \setuevalue{\e!stop #1}{\toks_stop_remapper {#1}}%
+ \letvalue{#1}\relax
+ \normalexpanded{\expandafter\def\csname#1\endcsname##1{\csname\e!start#1\endcsname##1\csname\e!stop#1\endcsname}}}
-\def\dostartremapper#1%
+\unexpanded\def\toks_start_remapper#1%
{\ctxlua{tokens.collectors.install("#1", "\e!stop#1")}}
-\def\dostopremapper#1%
+\unexpanded\def\toks_stop_remapper#1%
{\ctxlua{tokens.collectors.handle("#1",function(str) return tokens.collectors.remapper.convert("#1",str) end, true)}}
-\def\remaptokens#1%
+\unexpanded\def\remaptokens#1%
{\ctxlua{tokens.collectors.handle("#1",function(str) return tokens.collectors.remapper.convert("#1",str) end)}}
-\unexpanded\def\defineremapper[#1]%
- {\setvalue{\e!start#1}{\dostartremapper{#1}}%
- \setvalue{\e!stop #1}{\dostopremapper {#1}}%
- \def\next##1{\setvalue{#1}####1{\getvalue{\e!start#1}####1##1}}%
- \expandafter\next\csname\e!stop#1\endcsname}
-
-\def\remapcharacter
- {\dodoubleempty\doremapcharacter}
+\unexpanded\def\remapcharacter
+ {\dodoubleempty\toks_remap_character}
-\def\doremapcharacter[#1][#2]#3%
+\def\toks_remap_character[#1][#2]#3%
{\ctxlua{tokens.collectors.install("store", "ctxlua")}#3%
\ctxlua{tokens.collectors.remapper.store("store","#1",\number#2)}}