diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 212e9ff56dc..9e27324cbc1 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx @@ -145,7 +145,7 @@ % \end{macro} % \end{macro} % \end{macro} -\GetIdInfo$Id: l3bootstrap.dtx 4750 2014-05-06 16:56:59Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 4782 2014-05-16 22:12:19Z joseph $ {L3 Bootstrap code} %</driver|package> %<*driver> @@ -326,11 +326,11 @@ % % Note that \LuaTeX{} prior to version $0.36$ is not supported by % \pkg{expl3}: here that means simply skipping the definition, which will -% then be picked up later. In format mode, the definition needs to be done -% both during the format construction process and at the start of each -% job. To achieve that while not requiring a separate file, the Lua code -% is saved into a macro then used twice. That isn't required for package -% mode but it does not harm and keeps code-sharing easier. +% then be picked up later. This definition may need to be done twice: one +% \enquote{now} and once at the start of every job. The latter can occur +% in package mode if for example a custom format is being constructed. +% To achieve this while not requiring a separate file, the Lua code is saved +% into a macro then used twice. % \begin{macrocode} \begingroup \expandafter\ifx\csname directlua\endcsname\relax @@ -339,14 +339,9 @@ \else \catcode`\_=11 % \catcode`\:=11 % -%<*initex> \def\tempa -%</initex> -%<*package> - \directlua -%</package> {% - l3kernel = { } + l3kernel = l3kernel or { } function l3kernel.strcmp (A, B) if A == B then tex.write ("0") @@ -357,13 +352,23 @@ end end } -%<*initex> \directlua{\tempa} - \global\everyjob\expandafter - {% - \expandafter\luatex_directlua:D\expandafter{\tempa}% - } -%</initex> +% \end{macrocode} +% A test for \LuaTeX{} in Ini\TeX{} mode. +% \begin{macrocode} + \ifnum 0% + \directlua + {% + if status.ini_version then + tex.write("1") + end + }>0 % + \global\everyjob\expandafter + {% + \the\expandafter\everyjob + \expandafter\luatex_directlua:D\expandafter{\tempa}% + } + \fi \long\gdef\expl_pdfstrcmp#1#2% {% \luatex_directlua:D @@ -389,6 +394,7 @@ % must be available if it is. % \begin{macrocode} \begingroup + \def\next{\endgroup} \def\ShortText{Required primitives not found}% \def\LongText% {% @@ -406,9 +412,8 @@ \expandafter\ifx\csname expl_pdfstrcmp\endcsname\relax %<*initex> \def\LineBreak{^^J}% - \edef\Error% + \edef\next {% - \endgroup \newlinechar`\noexpand\^^J\relax \errhelp {% @@ -419,26 +424,33 @@ Format building will abort!\LineBreak }% \errmessage{\ShortText}% + \endgroup \noexpand\end }% %</initex> %<*package> \def\LineBreak{\noexpand\MessageBreak}% - \edef\Error% + \expandafter\ifx\csname PackageError\endcsname\relax + \def\LineBreak{^^J}% + \begingroup + \def\PackageError#1#2#3% + {% + \endgroup + \errhelp{#3}% + \errmessage{#1 Error: #2!} + }% + \fi + \edef\next {% - \endgroup \noexpand\PackageError{expl3}{\ShortText} {\LongText Loading of expl3 will abort!}% + \endgroup \noexpand\endinput }% %</package> - \expandafter\expandafter\expandafter\Error - \else - \endgroup \fi -\else - \endgroup -\fi + \fi +\next % \end{macrocode} % % \subsection{Extending allocators} |