diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-12 21:24:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-12 21:24:44 +0000 |
commit | d501b4397bbc0f4389add919be80ccfca5b3863e (patch) | |
tree | 41af122e914676e41bc048a14128468bdfa83f6d /Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx | |
parent | af6faae1a8553e2c55f7980152d84d8cf4ac5a96 (diff) |
l3 (12sep15)
git-svn-id: svn://tug.org/texlive/trunk@38360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx | 76 |
1 files changed, 71 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx b/Master/texmf-dist/source/latex/l3kernel/l3bootstrap.dtx index 9de367fc7ea..29d0a01caa8 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 5729 2015-07-31 05:56:12Z joseph $ +\GetIdInfo$Id: l3bootstrap.dtx 5983 2015-09-10 18:57:56Z joseph $ {L3 Bootstrap code} %</driver|package> %<*driver> @@ -318,11 +318,11 @@ end end end - tex.enableprimitives("", t) + tex.enableprimitives("", t) }% \fi \endgroup -%</package> +%</package> % \end{macrocode} % % \subsection{The \tn{pdfstrcmp} primitive with \XeTeX{} and \LuaTeX{}} @@ -387,7 +387,73 @@ \global\everyjob\expandafter {% \the\expandafter\everyjob - \expandafter\luatex_directlua:D\expandafter{\tempa}% + \expandafter\lua_now_x:n\expandafter{\tempa}% + } + \fi + \fi + \fi +\endgroup +% \end{macrocode} +% +% \subsection{Emulating \tn{Ucharchar} in \LuaTeX{}} +% +% Expandably creating character tokens can be done in macros but for the +% full Unicode range requires engine support in practical terms. That is +% available in \XeTeX{} as \tn{Ucharcat} but in \LuaTeX{} some Lua code +% is required. That is set up here, following the model above. Note that +% we do not try to emulate the syntax of the primitive (doable with \LuaTeX{} +% 0.80 or later, but not required by our use case). +% +% One minor wrinkle is that a catcode table is needed to return values. +% For format mode, long-term we can simply take an arbitrary one and make +% sure this is never allocated. In package mode use the same approach +% (and table) as \pkg{ucharcat}: look for an allocator and use it if available, +% or use a table unlikely to clash with any other use. We use the same table +% as \pkg{ucharcat} but as this is \enquote{disposable} we are safe. +% \begin{macrocode} +\begingroup + \expandafter\ifx\csname directlua\endcsname\relax + \else + \ifnum\luatexversion<70 % + \else +%<*initex> + % TEMP + \catcode`\@=11 % + \chardef\ucharcat@table="8000 % +%</initex> +%<*package> + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname newcatcodetable\endcsname\relax + \directlua{tex.enableprimitives("",{"initcatcodetable"})} + \chardef\ucharcat@table"7000 % + \initcatcodetable\ucharcat@table + \else + \newcatcodetable\ucharcat@table + \fi +%</package> + \catcode`\_=11 % + \catcode`\:=11 % + \def\tempa + {% + l3kernel = l3kernel or { } + local utf8_char = unicode.utf8.char + function l3kernel.charcat(charcode, catcode) + tex.setcatcode(\number\ucharcat@table, charcode, catcode) + tex.sprint(\number\ucharcat@table, utf8_char(charcode)) + end + } + \directlua{\tempa} + \ifnum 0% + \directlua + {% + if status.ini_version then + tex.write("1") + end + }>0 % + \global\everyjob\expandafter + {% + \the\expandafter\everyjob + \expandafter\lua_now_x:n\expandafter{\tempa}% } \fi \fi @@ -458,7 +524,7 @@ \endgroup \noexpand\endinput }% -%</package> +%</package> \fi \next % \end{macrocode} |