summaryrefslogtreecommitdiff
path: root/luatexbase-modutils.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-05-23 18:20:29 +0200
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2010-11-11 15:49:17 +0100
commitccf067d02062a1d45cefbbab158d6e4df1443dcc (patch)
tree008a610c9faf371c3b039497a67c6be98620990b /luatexbase-modutils.dtx
parentafd6550bbe12c1593196d30df4a14d456cf3c6f7 (diff)
downloadluatexbase-ccf067d02062a1d45cefbbab158d6e4df1443dcc.tar.gz
Make use_module private.
Diffstat (limited to 'luatexbase-modutils.dtx')
-rw-r--r--luatexbase-modutils.dtx19
1 files changed, 9 insertions, 10 deletions
diff --git a/luatexbase-modutils.dtx b/luatexbase-modutils.dtx
index 9e1ebb5..95e4611 100644
--- a/luatexbase-modutils.dtx
+++ b/luatexbase-modutils.dtx
@@ -169,14 +169,12 @@ See source file '\inFileName' for details.
%
% \subsection{Lua functions}
%
-% The main functions are |luatexbase.require_module| and
-% |luatexbase.use_module| which may be used as a replacement to |require()|.
-% The only difference between these functions is, |require_module| accepts a
-% second, optional argument in order to specify a minimal version. They do the
-% same as |require()| but also make sure the module loaded correctly
-% identifies itself with the name given, and its version is greater than the
-% minimal version required. The version can be given either as a (floating
-% point) number or as a date in YYYY/MM/DD format.
+% The main function is |luatexbase.require_module| which may be used as a
+% replacement to |require()|, but also checks that the module correctly
+% identified itself, and accepts a second, optional argument containing
+% version information to be checked against the similar information provided
+% by the loaded module. The version can be given either as a (floating point)
+% number or as a date in YYYY/MM/DD format.
%
% Modules identify themselves using |luatexbase.provides_module|, whose only
% argument is a table with some information about the module. The mandatory
@@ -466,7 +464,7 @@ local function warn(...) module_warning('luatexbase.modutils', ...) end
% Load a module without version checking.
%
% \begin{macrocode}
-function use_module(name)
+local function use_module(name)
require(name)
if not modules[name] then
warn("Module didn't properly identified itself: %s", name)
@@ -479,7 +477,8 @@ end
% \begin{macrocode}
function require_module(name, version)
if not version then
- return use_module(name)
+ use_module(name)
+ return
end
luaversion = parse_version(version)
if modules[name] then