Skip to content

Commit

Permalink
Update l3kernel to 2022-05-30
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed May 30, 2022
1 parent e6d846e commit e6208c8
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 8 deletions.
33 changes: 28 additions & 5 deletions texmf/tex/latex/l3kernel/expl3-code.tex
Expand Up @@ -70,7 +70,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx
\def\ExplFileDate{2022-05-04}%
\def\ExplFileDate{2022-05-30}%
\begingroup
\def\next{\endgroup}%
\expandafter\ifx\csname PackageError\endcsname\relax
Expand Down Expand Up @@ -5022,12 +5022,12 @@
\cs_new:Npn \__str_case:nnTF #1#2#3#4
{ \__str_case:nw {#1} #2 {#1} { } \s__str_mark {#3} \s__str_mark {#4} \s__str_stop }
\cs_generate_variant:Nn \str_case:nn { V , o , nV , nv }
\prg_generate_conditional_variant:Nnn \str_case:nn
{ V , o , nV , nv } { T , F , TF }
\cs_new_eq:NN \str_case:Nn \str_case:Vn
\cs_new_eq:NN \str_case:NnT \str_case:VnT
\cs_new_eq:NN \str_case:NnF \str_case:VnF
\cs_new_eq:NN \str_case:NnTF \str_case:VnTF
\prg_generate_conditional_variant:Nnn \str_case:nn
{ V , o , nV , nv } { T , F , TF }
\cs_new:Npn \__str_case:nw #1#2#3
{
\str_if_eq:nnTF {#1} {#2}
Expand Down Expand Up @@ -31504,6 +31504,16 @@
{ \lua_shipout_e:n { \exp_not:n {#1} } }
\cs_new:Npn \lua_escape:e #1 { \__lua_escape:n {#1} }
\cs_new:Npn \lua_escape:n #1 { \lua_escape:e { \exp_not:n {#1} } }
\str_new:N \l__lua_err_msg_str
\cs_generate_variant:Nn \msg_error:nnnn { nnnV }
\cs_new_protected:Npn \lua_load_module:n #1
{
\bool_if:nF { \__lua_load_module_p:n { #1 } }
{
\msg_error:nnnV
{ luatex } { module-not-found } { #1 } { \l__lua_err_msg_str }
}
}
\sys_if_engine_luatex:F
{
\clist_map_inline:nn
Expand All @@ -31519,7 +31529,7 @@
}
}
\clist_map_inline:nn
{ \lua_shipout_e:n , \lua_shipout:n }
{ \lua_shipout_e:n , \lua_shipout:n, \lua_load_module:n }
{
\cs_set_protected:Npn #1 ##1
{
Expand All @@ -31534,6 +31544,19 @@
The~feature~you~are~using~is~only~available~
with~the~LuaTeX~engine.~LaTeX3~ignored~'#1'.
}

\msg_new:nnnn { luatex } { module-not-found }
{ Lua~module~`#1'~not~found. }
{
The~file~`#1.lua'~could~not~be~found.~Please~ensure~
that~the~file~was~properly~installed~and~that~the~
filename~database~is~current. \\ \\
The~Lua~loader~provided~this~additional~information: \\
#2
}

\prop_gput:Nnn \g_msg_module_name_prop { luatex } { LaTeX3 }
\prop_gput:Nnn \g_msg_module_type_prop { luatex } { }
%% File: l3unicode.dtx
\ior_new:N \g__char_data_ior
\bool_lazy_or:nnTF { \sys_if_engine_luatex_p: } { \sys_if_engine_xetex_p: }
Expand Down Expand Up @@ -33117,7 +33140,7 @@
\cs_new:cpn { __text_change_case_upper_hy-x-yiwn:nnnN } #1#2#3#4
{ \__text_change_case_char:nnnN {#1} {#2} {#3} #4 }
\cs_new_eq:cc { __text_change_case_title_hy-x-yiwn:nnnN }
{ __text_change_case_upper_hy-x-yiwm:nnnN }
{ __text_change_case_upper_hy-x-yiwn:nnnN }
}
\bool_lazy_or:nnT
{ \sys_if_engine_luatex_p: }
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/l3kernel/expl3-generic.tex
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx
\def\ExplFileDate{2022-05-04}%
\def\ExplFileDate{2022-05-30}%
\let\ExplLoaderFileDate\ExplFileDate
\begingroup
\catcode`\_=11
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/l3kernel/expl3.ltx
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx
\def\ExplFileDate{2022-05-04}%
\def\ExplFileDate{2022-05-30}%
\let\ExplLoaderFileDate\ExplFileDate
\begingroup
\catcode`\_=11
Expand Down
37 changes: 37 additions & 0 deletions texmf/tex/latex/l3kernel/expl3.lua
Expand Up @@ -50,13 +50,17 @@ local cprint = tex.cprint
local write = tex.write
local write_nl = texio.write_nl
local utf8_char = utf8.char
local package_loaded = package.loaded
local package_searchers = package.searchers
local table_concat = table.concat

local scan_int = token.scan_int or token.scan_integer
local scan_string = token.scan_string
local scan_keyword = token.scan_keyword
local put_next = token.put_next
local token_create = token.create
local token_new = token.new
local set_macro = token.set_macro
local token_create_safe
do
local is_defined = token.is_defined
Expand Down Expand Up @@ -217,6 +221,39 @@ local luacmd do
end
end
end
local function try_require(name)
if package_loaded[name] then
return true, package_loaded[name]
end

local failure_details = {}
for _, searcher in ipairs(package_searchers) do
local loader, data = searcher(name)
if type(loader) == 'function' then
package_loaded[name] = loader(name, data) or true
return true, package_loaded[name]
elseif type(loader) == 'string' then
failure_details[#failure_details + 1] = loader
end
end

return false, table_concat(failure_details, '\n')
end
local char_given = command_id'char_given'
local c_true_bool = token_create(1, char_given)
local c_false_bool = token_create(0, char_given)
local c_str_cctab = token_create('c_str_cctab').mode

luacmd('__lua_load_module_p:n', function()
local success, result = try_require(scan_string())
if success then
set_macro(c_str_cctab, 'l__lua_err_msg_str', '')
put_next(c_true_bool)
else
set_macro(c_str_cctab, 'l__lua_err_msg_str', result)
put_next(c_false_bool)
end
end)
local register_luadata, get_luadata

if luatexbase then
Expand Down
2 changes: 1 addition & 1 deletion texmf/tex/latex/l3kernel/expl3.sty
Expand Up @@ -19,7 +19,7 @@
%% and all files in that bundle must be distributed together.
%%
%% File: expl3.dtx
\def\ExplFileDate{2022-05-04}%
\def\ExplFileDate{2022-05-30}%
\let\ExplLoaderFileDate\ExplFileDate
\ProvidesPackage{expl3}
[%
Expand Down

0 comments on commit e6208c8

Please sign in to comment.