Skip to content

Commit

Permalink
Merge 99b0ae0 into 0dcc7ee
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Dec 8, 2023
2 parents 0dcc7ee + 99b0ae0 commit 41bed95
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .luacheckrc
@@ -1,4 +1,4 @@
std = "max"
std = "min"
include_files = {
"**/*.lua",
"sile.in",
Expand All @@ -21,6 +21,7 @@ files["**/*_spec.lua"] = {
std = "+busted"
}
globals = {
package = { fields = { "searchpath" } },
"SILE",
"SU",
"luautf8",
Expand Down
2 changes: 1 addition & 1 deletion core/cli.lua
Expand Up @@ -108,7 +108,7 @@ cli.parseArguments = function ()
-- http://lua-users.org/wiki/VarargTheSecondClassCitizen
local summary = function (...)
local contentloc = SILE.traceStack:locationHead()
local codeloc = table.unpack({...}, 1, select('#', ...))
local codeloc = pl.utils.unpack({...}, 1, select('#', ...))
return ("Processing at: %s\n\tUsing code at: %s"):format(contentloc, codeloc)
end
local unexpected = function ()
Expand Down
2 changes: 1 addition & 1 deletion core/deprecations.lua
Expand Up @@ -30,7 +30,7 @@ SILE.fluent = setmetatable({}, {
__call = function (_, ...)
fluentglobal()
SILE.fluent = fluent
return fluent(table.unpack({...}, 1, select("#", ...)))
return fluent(pl.utils.unpack({...}, 1, select("#", ...)))
end,
__index = function (_, key)
fluentglobal()
Expand Down
1 change: 1 addition & 0 deletions core/packagemanager.lua
Expand Up @@ -30,6 +30,7 @@ end

local function loadInSandbox(untrusted_code)
_deprecated()
-- luacheck: ignore _ENV
if _ENV then -- simple Lua 5.2 version check
local env = {}
local untrusted_function, message = load(untrusted_code, nil, 't', env)
Expand Down
1 change: 1 addition & 0 deletions core/sile.lua
Expand Up @@ -6,6 +6,7 @@ SILE.features = require("core.features")

-- Initialize Lua environment and global utilities
SILE.lua_version = _VERSION:sub(-3)
-- luacheck: ignore jit
SILE.lua_isjit = type(jit) == "table"
SILE.full_version = string.format("SILE %s (%s)", SILE.version, SILE.lua_isjit and jit.version or _VERSION)

Expand Down
4 changes: 2 additions & 2 deletions core/utilities.lua
Expand Up @@ -115,7 +115,7 @@ end
utilities.debug = function (category, ...)
if SILE.quiet then return end
if utilities.debugging(category) then
local inputs = table.pack(...)
local inputs = pl.utils.pack(...)
for i, input in ipairs(inputs) do
if type(input) == "function" then
local status, output = pcall(input)
Expand Down Expand Up @@ -261,7 +261,7 @@ end

utilities.compress = function (items)
local rv = {}
local max = math.max(table.unpack(pl.tablex.keys(items)))
local max = math.max(pl.utils.unpack(pl.tablex.keys(items)))
for i = 1, max do if items[i] then rv[#rv+1] = items[i] end end
return rv
end
Expand Down
2 changes: 1 addition & 1 deletion outputters/debug.lua
Expand Up @@ -44,7 +44,7 @@ end

function outputter:_writeline (...)
self:_ensureInit()
local args = table.pack(...)
local args = pl.utils.pack(...)
for i = 1, #args do
outfile:write(args[i])
if i < #args then outfile:write("\t") end
Expand Down
2 changes: 1 addition & 1 deletion outputters/text.lua
Expand Up @@ -23,7 +23,7 @@ end

function outputter:_writeline (...)
self:_ensureInit()
local args = table.pack(...)
local args = pl.utils.pack(...)
for i=1, #args do
outfile:write(args[i])
end
Expand Down
4 changes: 2 additions & 2 deletions packages/base.lua
Expand Up @@ -81,7 +81,7 @@ function package:deprecatedExport (name, func, noclass, notable)
SU.deprecated(("class.%s"):format(name),
("class.packages.%s:%s"):format(self._name, name),
"0.14.0", "0.16.0", _deprecate_class_funcs)
return func(table.unpack(inputs, 1, select("#", ...) + 1))
return func(pl.utils.unpack(inputs, 1, select("#", ...) + 1))
end
end

Expand All @@ -94,7 +94,7 @@ function package:deprecatedExport (name, func, noclass, notable)
SU.deprecated(("require('packages.%s').exports.%s"):format(self._name, name),
("class.packages.%s:%s"):format(self._name, name),
"0.14.0", "0.16.0", _deprecate_exports_table)
return func(table.unpack(inputs, 1, select("#", ...) + 1))
return func(pl.utils.unpack(inputs, 1, select("#", ...) + 1))
end
end

Expand Down
1 change: 1 addition & 0 deletions packages/bibtex/bibliography.lua
@@ -1,4 +1,5 @@
-- luacheck: globals setfenv getfenv
-- luacheck: ignore _ENV

-- The following functions borrowed from Norman Ramsey's nbibtex,
-- with permission.
Expand Down
2 changes: 1 addition & 1 deletion packages/math/base-elements.lua
Expand Up @@ -1112,7 +1112,7 @@ function elements.table:_init (children, options)
self.children = children
self.options = options
self.nrows = #self.children
self.ncols = math.max(table.unpack(mapList(function(_, row)
self.ncols = math.max(pl.utils.unpack(mapList(function(_, row)
return #row.children end, self.children)))
SU.debug("math", "self.ncols =", self.ncols)
self.rowspacing = self.options.rowspacing and SILE.length(self.options.rowspacing)
Expand Down
2 changes: 1 addition & 1 deletion packages/math/texlike.lua
Expand Up @@ -83,7 +83,7 @@ local mathGrammar = function (_ENV)
-- Remove the last mathlist if empty. This way,
-- `inner1 \\ inner2 \\` is the same as `inner1 \\ inner2`.
if not t[#t][1] or not t[#t][1][1] then table.remove(t) end
return table.unpack(t)
return pl.utils.unpack(t)
end

START "texlike_math"
Expand Down

0 comments on commit 41bed95

Please sign in to comment.