summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-05-23 01:09:14 +0200
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-05-23 01:09:14 +0200
commit414dd110e53e9f20f3308de3525e7f7dea17264b (patch)
treeb4afd7e547dcf29cd291ec248ca46c5b45cf1683
parentb8438d8d3c128128aa8b172b466f34478603d2c9 (diff)
downloadluatexbase-414dd110e53e9f20f3308de3525e7f7dea17264b.tar.gz
generalise better catcode defenses
-rw-r--r--luatex.dtx37
-rw-r--r--luatexbase-attr.dtx50
-rw-r--r--luatexbase-cctb.dtx51
-rw-r--r--luatexbase-compat.dtx50
-rw-r--r--luatexbase-loader.dtx58
-rw-r--r--luatexbase-mcb.dtx53
-rw-r--r--luatexbase-modutils.dtx52
-rw-r--r--luatexbase-regs.dtx60
-rw-r--r--luatexbase.dtx53
9 files changed, 209 insertions, 255 deletions
diff --git a/luatex.dtx b/luatex.dtx
index 2e82699..2a03561 100644
--- a/luatex.dtx
+++ b/luatex.dtx
@@ -156,10 +156,10 @@ See source file '\inFileName' for licence and contact information.
%
% \subsection{Preliminaries}
%
-% Catcode defenses.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
-\begingroup\catcode61\catcode48\catcode32=10\relax%
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
@@ -168,44 +168,30 @@ See source file '\inFileName' for licence and contact information.
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 13 5 % endlinechar
+ \y 13 5 % carriage return
\y 61 12 % =
\y 32 10 % space
\y 123 1 % {
\y 125 2 % }
\y 35 6 % #
- \y 10 12 % ^^J
- \y 33 12 % !
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 64 11 % @ (letter)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
- \y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
\y 58 12 % :
- \y 60 12 % <
- \y 64 11 % @ (letter)
- \y 62 12 % >
\y 91 12 % [
\y 93 12 % ]
\y 94 7 % ^
- \y 95 12 % _ (other)
\y 96 12 % `
\toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
- \edef\y#1{\endgroup\edef#1{\the\toks0}\x\relax}%
-\expandafter\y\csname lltxb@luatex@endinput\endcsname
-% \end{macrocode}
-%
-% Reload protection, especially for \plaintex.
-%
-% \begin{macrocode}
- \csname lltxb@luatex@loaded\endcsname
-\expandafter\let\csname lltxb@luatex@loaded\endcsname\lltxb@luatex@endinput
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatex@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -243,8 +229,7 @@ See source file '\inFileName' for licence and contact information.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@luatex@endinput%
- \expandafter\endinput
+ \expandafter\luatex@sty@endinput%
\fi
% \end{macrocode}
%
@@ -303,7 +288,7 @@ See source file '\inFileName' for licence and contact information.
% This is the end, my friend\dots the end.
%
% \begin{macrocode}
-\lltxb@luatex@endinput%
+\luatex@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-attr.dtx b/luatexbase-attr.dtx
index e58a965..27a89f1 100644
--- a/luatexbase-attr.dtx
+++ b/luatexbase-attr.dtx
@@ -180,48 +180,47 @@ See source file '\inFileName' for details.
%
% \subsubsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@attr@loaded\endcsname
-\expandafter\let\csname lltxb@attr@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 34 12 % "
- \y 36 3 % $ $
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
+ \y 58 12 % :
\y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
\y 62 12 % >
- \y 95 12 % _ (other)
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
+ \y 95 8 % _
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@attr@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@attr@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -259,8 +258,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@attr@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@attr@sty@endinput%
\fi
% \end{macrocode}
%
@@ -339,7 +337,7 @@ See source file '\inFileName' for details.
% That's all folks!
%
% \begin{macrocode}
-\lltxb@attr@AtEnd
+\luatexbase@attr@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-cctb.dtx b/luatexbase-cctb.dtx
index 8d1f3f5..dd19d48 100644
--- a/luatexbase-cctb.dtx
+++ b/luatexbase-cctb.dtx
@@ -276,48 +276,46 @@ See source file '\inFileName' for details.
%
% \subsubsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@cctb@loaded\endcsname
-\expandafter\let\csname lltxb@cctb@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
+ \y 58 12 % :
\y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
\y 62 12 % >
- \y 95 12 % _ (other)
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
+ \y 95 8 % _
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@cctb@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@cctb@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -355,8 +353,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@cctb@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@cctb@sty@endinput%
\fi
% \end{macrocode}
%
@@ -647,7 +644,7 @@ See source file '\inFileName' for details.
% That's all, folks!
%
% \begin{macrocode}
-\lltxb@cctb@AtEnd
+\luatexbase@cctb@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-compat.dtx b/luatexbase-compat.dtx
index e518e0d..ebe78bc 100644
--- a/luatexbase-compat.dtx
+++ b/luatexbase-compat.dtx
@@ -200,48 +200,45 @@ See source file '\inFileName' for details.
%
% \subsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@compat@loaded\endcsname
-\expandafter\let\csname lltxb@compat@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
\y 42 12 % *
- \y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
+ \y 58 12 % :
\y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@compat@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@compat@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -279,8 +276,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@compat@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@compat@sty@endinput%
\fi
% \end{macrocode}
%
@@ -381,7 +377,7 @@ See source file '\inFileName' for details.
% That's all folks!
%
% \begin{macrocode}
-\lltxb@compat@AtEnd
+\luatexbase@compat@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-loader.dtx b/luatexbase-loader.dtx
index 9d57ac5..bee0757 100644
--- a/luatexbase-loader.dtx
+++ b/luatexbase-loader.dtx
@@ -172,48 +172,45 @@ See source file '\inFileName' for details.
%
% \subsubsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@loader@loaded\endcsname
-\expandafter\let\csname lltxb@loader@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 34 12 % "
- \y 36 3 % $ $
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
- \y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 58 12 % :
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
+ \y 95 8 % _
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@loader@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@loader@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -251,8 +248,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@loader@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@loader@sty@endinput%
\fi
% \end{macrocode}
%
@@ -277,7 +273,7 @@ See source file '\inFileName' for details.
\luatexbase@directlua{%
local file = "luatexbase.loader.lua"
local path = assert(kpse.find_file(file, 'tex'),
- "File '"..file.."' no found")
+ "File '"..file.."' not found")
texio.write_nl("("..path..")")
dofile(path)}
% \end{macrocode}
@@ -285,7 +281,7 @@ See source file '\inFileName' for details.
% That's all, folks!
%
% \begin{macrocode}
-\lltxb@loader@AtEnd
+\luatexbase@loader@sty@endinput%
%</texpackage>
% \end{macrocode}
%
@@ -301,8 +297,8 @@ module('luatexbase', package.seeall)
% approximate |LUAINPUTS|. But we need to handle suffixes ourselves.
%
% |lua_suffixes| is taken verbatim from Kpathsea's source
-% (\file{tex-file.c}, constant |LUA_SUFFIXES|),\footnote{Unchanged since
-% 2007-07-06, last checked 2010-05-10.}.
+% (\file{tex-file.c}, constant |LUA_SUFFIXES|).\footnote{Unchanged since
+% 2007-07-06, last checked 2010-05-10.}
%
% \begin{macrocode}
local lua_suffixes = {
diff --git a/luatexbase-mcb.dtx b/luatexbase-mcb.dtx
index b944cd2..e073232 100644
--- a/luatexbase-mcb.dtx
+++ b/luatexbase-mcb.dtx
@@ -286,48 +286,42 @@ See source file '\inFileName' for details.
%
% \subsubsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@mcb@loaded\endcsname
-\expandafter\let\csname lltxb@mcb@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
- \y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
- \y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 58 12 % :
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@mcb@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@mcb@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -365,8 +359,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@mcb@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@mcb@sty@endinput%
\fi
% \end{macrocode}
%
@@ -388,7 +381,7 @@ See source file '\inFileName' for details.
% That's all folks!
%
% \begin{macrocode}
-\lltxb@mcb@AtEnd
+\luatexbase@mcb@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx
index 81394be..c622be2 100644
--- a/luatexbase-modutils.dtx
+++ b/luatexbase-modutils.dtx
@@ -297,48 +297,45 @@ See source file '\inFileName' for details.
%
% \subsubsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@modutils@loaded\endcsname
-\expandafter\let\csname lltxb@modutils@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 34 12 % "
- \y 36 3 % $ $
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
\y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
- \y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 58 12 % :
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
+ \y 95 8 % _
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@modutils@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@modutils@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -376,8 +373,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@modutils@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@modutils@sty@endinput%
\fi
% \end{macrocode}
%
@@ -456,7 +452,7 @@ See source file '\inFileName' for details.
% \end{macrocode}
%
% \begin{macrocode}
-\lltxb@modutils@AtEnd
+\luatexbase@modutils@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase-regs.dtx b/luatexbase-regs.dtx
index 079b004..647bb26 100644
--- a/luatexbase-regs.dtx
+++ b/luatexbase-regs.dtx
@@ -153,48 +153,49 @@ See source file '\inFileName' for details.
%
% \subsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@regs@loaded\endcsname
-\expandafter\let\csname lltxb@regs@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
+ \y 33 12 % !
+ \y 36 3 % $ $ (in etex.sty)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
- \y 44 12 % ,
+ \y 42 12 % * (in etex.sty)
+ \y 43 12 % + (in etex.sty)
+ \y 44 12 % , (in etex.sty)
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
- \y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 58 12 % :
+ \y 60 12 % < (in etex.sty)
+ \y 62 12 % > (in etex.sty)
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@regs@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@regs@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -232,8 +233,7 @@ See source file '\inFileName' for details.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@regs@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@regs@sty@endinput%
\fi
% \end{macrocode}
%
@@ -415,7 +415,7 @@ See source file '\inFileName' for details.
% That's all folks!
%
% \begin{macrocode}
-\lltxb@regs@AtEnd
+\luatexbase@regs@sty@endinput%
%</texpackage>
% \end{macrocode}
%
diff --git a/luatexbase.dtx b/luatexbase.dtx
index 4bfd5cb..a69721c 100644
--- a/luatexbase.dtx
+++ b/luatexbase.dtx
@@ -139,48 +139,42 @@ See source file '\inFileName' for licence and contact information.
%
% \subsection{Preliminaries}
%
-% Reload protection, especially for \plaintex.
+% Catcode defenses and reload protection.
%
% \begin{macrocode}
- \csname lltxb@core@loaded\endcsname
-\expandafter\let\csname lltxb@core@loaded\endcsname\endinput
-% \end{macrocode}
-%
-% Catcode defenses.
-%
-% \begin{macrocode}
-\begingroup
+\begingroup\catcode61\catcode48\catcode32=10\relax% = and space
\catcode123 1 % {
\catcode125 2 % }
\catcode 35 6 % #
- \toks0{}%
- \def\x{}%
+ \toks0\expandafter{\expandafter\endlinechar\the\endlinechar}%
+ \edef\x{\endlinechar13}%
\def\y#1 #2 {%
\toks0\expandafter{\the\toks0 \catcode#1 \the\catcode#1}%
\edef\x{\x \catcode#1 #2}}%
- \y 123 1 % {
- \y 125 2 % }
- \y 35 6 % #
- \y 10 12 % ^^J
- \y 34 12 % "
- \y 36 3 % $ $
+ \y 13 5 % carriage return
+ \y 61 12 % =
+ \y 32 10 % space
+ \y 123 1 % {
+ \y 125 2 % }
+ \y 35 6 % #
+ \y 64 11 % @ (letter)
\y 39 12 % '
\y 40 12 % (
\y 41 12 % )
- \y 42 12 % *
- \y 43 12 % +
- \y 44 12 % ,
\y 45 12 % -
\y 46 12 % .
\y 47 12 % /
- \y 60 12 % <
- \y 61 12 % =
- \y 64 11 % @ (letter)
- \y 62 12 % >
- \y 95 12 % _ (other)
+ \y 58 12 % :
+ \y 91 12 % [
+ \y 93 12 % ]
+ \y 94 7 % ^
\y 96 12 % `
- \edef\y#1{\endgroup\edef#1{\the\toks0\relax}\x}%
-\expandafter\y\csname lltxb@core@AtEnd\endcsname
+ \toks0\expandafter{\the\toks0 \relax\noexpand\endinput}%
+ \edef\y#1{\noexpand\expandafter\endgroup%
+ \noexpand\ifx#1\relax \edef#1{\the\toks0}\x\relax%
+ \noexpand\else \noexpand\expandafter\noexpand\endinput%
+ \noexpand\fi}%
+\expandafter\y\csname luatexbase@sty@endinput\endcsname%
% \end{macrocode}
%
% Package declaration.
@@ -218,8 +212,7 @@ See source file '\inFileName' for licence and contact information.
This package can only be used with the LuaTeX engine^^J%
(command `lualatex' or `luatex').^^J%
Package loading has been stopped to prevent additional errors.}
- \lltxb@core@AtEnd
- \expandafter\endinput
+ \expandafter\luatexbase@sty@endinput%
\fi
% \end{macrocode}
%
@@ -249,7 +242,7 @@ See source file '\inFileName' for licence and contact information.
% This is the end, my friend\dots the end.
%
% \begin{macrocode}
-\lltxb@core@AtEnd
+\luatexbase@sty@endinput%
%</texpackage>
% \end{macrocode}
%