summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-04-30 22:39:09 +0000
committerKarl Berry <karl@freefriends.org>2018-04-30 22:39:09 +0000
commita28e1bfccd6fe522fcd296426e4d89c7fb4f19b6 (patch)
treeb72347e08575b56fcfed87c4d837b48dcfd1e02a /Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
parentb40c37a9e22b8235ff9c0bc256d00f7af94304c3 (diff)
l3 (30apr18)
git-svn-id: svn://tug.org/texlive/trunk@47516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx75
1 files changed, 55 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index d5179a174ce..77431db7558 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3luatex.dtx Copyright (C) 2010-2017 The LaTeX3 Project
+%% File: l3luatex.dtx Copyright (C) 2010-2018 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -29,7 +29,7 @@
% \fi
%
% \title{^^A
-% The \pkg{l3luatex} package\\LuaTeX-specific functions^^A
+% The \pkg{l3luatex} package: \LuaTeX-specific functions^^A
% }
%
% \author{^^A
@@ -41,22 +41,20 @@
% }^^A
% }
%
-% \date{Released 2018/03/05}
+% \date{Released 2018-04-30}
%
% \maketitle
%
% \begin{documentation}
%
-% \section{Breaking out to \Lua{}}
-%
% The \LuaTeX{} engine provides access to the \Lua{} programming language,
% and with it access to the \enquote{internals} of \TeX{}. In order to use
% this within the framework provided here, a family of functions is
-% available. When used with \pdfTeX{} or \XeTeX{} these raise an
+% available. When used with \pdfTeX{}, \pTeX{}, \upTeX{} or \XeTeX{} these raise an
% error: use \cs{sys_if_engine_luatex:T} to avoid this. Details on using
% \Lua{} with the \LuaTeX{} engine are given in the \LuaTeX{} manual.
%
-% \subsection{\TeX{} code interfaces}
+% \section{Breaking out to \Lua{}}
%
% \begin{function}[EXP, added = 2015-06-29]{\lua_now_x:n, \lua_now:n}
% \begin{syntax}
@@ -123,10 +121,15 @@
% \end{texnote}
% \end{function}
%
-% \subsection{Lua interfaces}
+% \section{Lua interfaces}
%
% As well as interfaces for \TeX{}, there are a small number of Lua functions
-% provided here. Currently these are intended for internal use only.
+% provided here.
+%
+% \begin{function}{l3kernel}
+% All public interfaces provided by the module are stored within the
+% |l3kernel| table.
+% \end{function}
%
% \begin{function}{l3kernel.charcat}
% \begin{syntax}
@@ -151,8 +154,12 @@
% |l3kernel.filemoddate||(|\meta{file}|)|
% \end{syntax}
% Returns the of the date/time of last modification of the \meta{file} in the
-% format |D:|\meta{year}\meta{month}\meta{day}\meta{hour}\meta{minute}^^A
-% \meta{second}\meta{offset}, where the latter may be |Z| (UTC) or
+% format
+% \begin{quote}
+% |D:|\meta{year}\meta{month}\meta{day}\meta{hour}\meta{minute}^^A
+% \meta{second}\meta{offset}
+% \end{quote}
+% where the latter may be |Z| (UTC) or
% \meta{plus-minus}\meta{hours}|'|\meta{minutes}|'|. If the \meta{file} is
% not found, nothing is returned with \emph{no error raised}.
% \end{function}
@@ -189,6 +196,26 @@
%<*tex>
% \end{macrocode}
%
+% \begin{macrocode}
+%<@@=luatex>
+% \end{macrocode}
+%
+% \begin{macro}[EXP]{\@@_escape_x:n, \@@_now_x:n, \@@_shipout_x:n}
+% Copies of primitives.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_escape_x:n \luatex_luaescapestring:D
+\cs_new_eq:NN \@@_now_x:n \luatex_directlua:D
+\cs_new_eq:NN \@@_shipout_x:n \luatex_latelua:D
+% \end{macrocode}
+% \end{macro}
+%
+% These functions are set up in \pkg{l3str} for bootstrapping: we want to
+% replace them with a \enquote{proper} version at this stage, so clean up.
+% \begin{macrocode}
+\cs_undefine:N \lua_escape_x:n
+\cs_undefine:N \lua_now_x:n
+% \end{macrocode}
+%
% \begin{macro}[EXP]{\lua_now_x:n, \lua_now:n}
% \begin{macro}{\lua_shipout_x:n, \lua_shipout:n}
% \begin{macro}[EXP]{\lua_escape_x:n, \lua_escape:n}
@@ -196,17 +223,21 @@
% these have to be macros, we give them the same status in all cases.
% When \LuaTeX{} is not in use, simply give an error message/
% \begin{macrocode}
-\cs_new:Npn \lua_now_x:n #1 { \luatex_directlua:D {#1} }
+\cs_new:Npn \lua_now_x:n #1 { \@@_now_x:n {#1} }
\cs_new:Npn \lua_now:n #1 { \lua_now_x:n { \exp_not:n {#1} } }
-\cs_new_protected:Npn \lua_shipout_x:n #1 { \luatex_latelua:D {#1} }
+\cs_new_protected:Npn \lua_shipout_x:n #1 { \@@_shiphout_x:n {#1} }
\cs_new_protected:Npn \lua_shipout:n #1
{ \lua_shipout_x:n { \exp_not:n {#1} } }
-\cs_new:Npn \lua_escape_x:n #1 { \luatex_luaescapestring:D {#1} }
+\cs_new:Npn \lua_escape_x:n #1 { \@@_escape_x:n {#1} }
\cs_new:Npn \lua_escape:n #1 { \lua_escape_x:n { \exp_not:n {#1} } }
\sys_if_engine_luatex:F
{
\clist_map_inline:nn
- { \lua_now_x:n , \lua_now:n , \lua_escape_x:n , \lua_escape:n }
+ {
+ \use_x:n ,
+ \lua_escape_x:n , \lua_escape:n ,
+ \lua_now_x:n , \lua_now:n
+ }
{
\cs_set:Npn #1 ##1
{
@@ -292,7 +323,7 @@ local write = tex.write
local utf8_char = unicode.utf8.char
% \end{macrocode}
%
-% \begin{macro}{escapehex}
+% \begin{macro}[int]{escapehex}
% An internal auxiliary to convert a string to the matching hex escape.
% This works on a byte basis: extension to handled UTF-8 input is
% covered in \pkg{pdftexcmds} but is not currently required here.
@@ -432,13 +463,17 @@ l3kernel.strcmp = strcmp
%<*initex>
% \end{macrocode}
%
+% \begin{macrocode}
+%<@@=alloc>
+% \end{macrocode}
+%
% A small amount of generic code is used by almost all \LuaTeX{} material so
% needs to be loaded by the format.
% \begin{macrocode}
-attribute_count_name = "g__alloc_attribute_int"
-bytecode_count_name = "g__alloc_bytecode_int"
-chunkname_count_name = "g__alloc_chunkname_int"
-whatsit_count_name = "g__alloc_whatsit_int"
+attribute_count_name = "g_@@_attribute_int"
+bytecode_count_name = "g_@@_bytecode_int"
+chunkname_count_name = "g_@@_chunkname_int"
+whatsit_count_name = "g_@@_whatsit_int"
require("ltluatex")
% \end{macrocode}
%