diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx | 146 |
1 files changed, 53 insertions, 93 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 9e27324cbc1..4ff6c7dd5cf 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 4782 2014-05-16 22:12:19Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 4889 2014-05-26 19:59:25Z joseph $ {L3 Bootstrap code} %</driver|package> %<*driver> @@ -241,15 +241,6 @@ % % \subsection{Internal functions and variables} % -% \begin{function}{\__expl_package_check:} -% \begin{syntax} -% \cs{__expl_package_check:} -% \end{syntax} -% Used to ensure that all parts of \pkg{expl3} are loaded together -% (\emph{i.e.}~as part of \pkg{expl3}). Issues an error if a kernel package -% is loaded independently of the bundle. -% \end{function} -% % \begin{variable}{\l__kernel_expl_bool} % A boolean which records the current code syntax status: \texttt{true} if % currently inside a code environment. This variable should only be @@ -297,6 +288,7 @@ %<*initex> \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname directlua\endcsname\relax +\else \directlua{tex.enableprimitives ('', tex.extraprimitives ( ))} \fi %</initex> @@ -314,23 +306,21 @@ \fi % \end{macrocode} % -% \begin{macro}{\expl_pdfstrcmp} % If \LuaTeX{} is in use then no primitive \cs{(pdf)strcmp} is available. -% However, it can be emulated using some Lua code. Since this is not -% the primitive, we do not use a misleading name: instead, a temporary -% version is set up as \cs{expl_pdfstrcmp}. The latter is then picked up -% and moved to the correct place by \pkg{l3names}. In earlier versions of +% However, it can be emulated using some Lua code. In earlier versions of % the code, the \pkg{pdftexcmds} package was loaded to do this task. However, % that raises some issues in \enquote{generic} (it fails with Con\TeX{}t -% MkIV), and also adds a hardly-needed dependency. -% -% 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. 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. +% MkIV), and also adds a hardly-needed dependency. 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. 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. +% (In the long term, the Lua code here may be best moved to a separate +% file.) +% +% No macro definition is given just yet: that is left until \pkg{l3basics}. % \begin{macrocode} \begingroup \expandafter\ifx\csname directlua\endcsname\relax @@ -369,29 +359,16 @@ \expandafter\luatex_directlua:D\expandafter{\tempa}% } \fi - \long\gdef\expl_pdfstrcmp#1#2% - {% - \luatex_directlua:D - {% - l3kernel.strcmp - ( - "\luatex_luaescapestring:D {#1}" , - "\luatex_luaescapestring:D {#2}" - ) - }% - } \fi \fi \endgroup % \end{macrocode} -% \end{macro} % % \subsection{Engine requirements} % % The code currently requires functionality equivalent to \tn{pdfstrcmp} % in addition to \eTeX{}. This is picked up by testing for the \cs{pdfstrcmp} -% primitive or emulation as \cs{expl_pdfstrcmp}, as the \eTeX{} primitives -% must be available if it is. +% primitive or a version of \LuaTeX{} capable of emulating it. % \begin{macrocode} \begingroup \def\next{\endgroup} @@ -408,46 +385,48 @@ \LineBreak }% \expandafter\ifx\csname pdfstrcmp\endcsname\relax - \catcode`\_=11 % - \expandafter\ifx\csname expl_pdfstrcmp\endcsname\relax + \expandafter\ifx\csname directlua\endcsname\relax + \else + \ifnum\luatexversion<36 % %<*initex> - \def\LineBreak{^^J}% - \edef\next - {% - \newlinechar`\noexpand\^^J\relax - \errhelp - {% - \LongText - For pdfTeX and XeTeX the '-etex' command-line switch is also - needed.\LineBreak - \LineBreak - Format building will abort!\LineBreak - }% - \errmessage{\ShortText}% - \endgroup - \noexpand\end - }% + \def\LineBreak{^^J}% + \edef\next + {% + \newlinechar`\noexpand\^^J\relax + \errhelp + {% + \LongText + For pdfTeX and XeTeX the '-etex' command-line switch is also + needed.\LineBreak + \LineBreak + Format building will abort!\LineBreak + }% + \errmessage{\ShortText}% + \endgroup + \noexpand\end + }% %</initex> %<*package> - \def\LineBreak{\noexpand\MessageBreak}% - \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 - {% - \noexpand\PackageError{expl3}{\ShortText} - {\LongText Loading of expl3 will abort!}% - \endgroup - \noexpand\endinput - }% + \def\LineBreak{\noexpand\MessageBreak}% + \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 + {% + \noexpand\PackageError{expl3}{\ShortText} + {\LongText Loading of expl3 will abort!}% + \endgroup + \noexpand\endinput + }% %</package> + \fi \fi \fi \next @@ -492,25 +471,6 @@ %</package> % \end{macrocode} % -% If \LuaTeX{} is in use there are more allocators to create. Con\TeX{}t -% already does that, so skip any loading in that case: this is done using the -% \cs{newattribute} allocator. Otherwise, there is a need for a test to -% differentiate between \LaTeXe{} and plain. -% \begin{macrocode} -%<*package> -\ifdefined\directlua - \ifdefined\newattribute - \else - \ifdefined\RequirePackage - \RequirePackage{luatex} - \else - \input luatex.sty % - \fi - \fi -\fi -%</package> -% \end{macrocode} -% % \subsection{The \LaTeX3 code environment} % % The code environment is now set up. |