[latex3-commits] [git/LaTeX3-latex3-latex2e] develop: Update l3kernel to 2022-05-30 (e6208c86)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon May 30 15:23:48 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : develop
Link       : https://github.com/latex3/latex2e/commit/e6208c8667796628efda638ed2aea1adf3921eb1

>---------------------------------------------------------------

commit e6208c8667796628efda638ed2aea1adf3921eb1
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon May 30 14:23:42 2022 +0100

    Update l3kernel to 2022-05-30


>---------------------------------------------------------------

e6208c8667796628efda638ed2aea1adf3921eb1
 texmf/tex/latex/l3kernel/expl3-code.tex    | 33 ++++++++++++++++++++++----
 texmf/tex/latex/l3kernel/expl3-generic.tex |  2 +-
 texmf/tex/latex/l3kernel/expl3.ltx         |  2 +-
 texmf/tex/latex/l3kernel/expl3.lua         | 37 ++++++++++++++++++++++++++++++
 texmf/tex/latex/l3kernel/expl3.sty         |  2 +-
 5 files changed, 68 insertions(+), 8 deletions(-)

diff --git a/texmf/tex/latex/l3kernel/expl3-code.tex b/texmf/tex/latex/l3kernel/expl3-code.tex
index 08d97cff..bb26a016 100644
--- a/texmf/tex/latex/l3kernel/expl3-code.tex
+++ b/texmf/tex/latex/l3kernel/expl3-code.tex
@@ -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
@@ -5022,12 +5022,12 @@ Type  H <return>  for immediate help}\def~{\errmessage{%
 \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}
@@ -31504,6 +31504,16 @@ Type  H <return>  for immediate help}\def~{\errmessage{%
   { \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
@@ -31519,7 +31529,7 @@ Type  H <return>  for immediate help}\def~{\errmessage{%
           }
       }
     \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
           {
@@ -31534,6 +31544,19 @@ Type  H <return>  for immediate help}\def~{\errmessage{%
     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: }
@@ -33117,7 +33140,7 @@ Type  H <return>  for immediate help}\def~{\errmessage{%
     \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: }
diff --git a/texmf/tex/latex/l3kernel/expl3-generic.tex b/texmf/tex/latex/l3kernel/expl3-generic.tex
index fe6d8d57..5045760a 100644
--- a/texmf/tex/latex/l3kernel/expl3-generic.tex
+++ b/texmf/tex/latex/l3kernel/expl3-generic.tex
@@ -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
diff --git a/texmf/tex/latex/l3kernel/expl3.ltx b/texmf/tex/latex/l3kernel/expl3.ltx
index 46d3ff32..eb42bb11 100644
--- a/texmf/tex/latex/l3kernel/expl3.ltx
+++ b/texmf/tex/latex/l3kernel/expl3.ltx
@@ -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
diff --git a/texmf/tex/latex/l3kernel/expl3.lua b/texmf/tex/latex/l3kernel/expl3.lua
index 10cec935..f965f889 100644
--- a/texmf/tex/latex/l3kernel/expl3.lua
+++ b/texmf/tex/latex/l3kernel/expl3.lua
@@ -50,6 +50,9 @@ 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
@@ -57,6 +60,7 @@ 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
@@ -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
diff --git a/texmf/tex/latex/l3kernel/expl3.sty b/texmf/tex/latex/l3kernel/expl3.sty
index 67067310..04df7d9a 100644
--- a/texmf/tex/latex/l3kernel/expl3.sty
+++ b/texmf/tex/latex/l3kernel/expl3.sty
@@ -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}
   [%





More information about the latex3-commits mailing list.