aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-14 17:11:36 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-14 17:11:36 +0200
commit50f4c40bdb5667aa7053434dede2dd98f6f9e243 (patch)
treec443c9337e238ff2825b2da4c9749fdf97aa574f /src/lanes.lua
parentec8574d298ef302bc4162d9b394e96bf08763632 (diff)
downloadlanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.tar.gz
lanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.tar.bz2
lanes-50f4c40bdb5667aa7053434dede2dd98f6f9e243.zip
Wording fix: parameter → argument
Diffstat (limited to 'src/lanes.lua')
-rw-r--r--src/lanes.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lanes.lua b/src/lanes.lua
index c860ba0..29fc4a9 100644
--- a/src/lanes.lua
+++ b/src/lanes.lua
@@ -158,12 +158,12 @@ local params_checker = function(settings_)
158 -- make a copy of the table to leave the provided one unchanged, *and* to help ensure it won't change behind our back 158 -- make a copy of the table to leave the provided one unchanged, *and* to help ensure it won't change behind our back
159 local settings = {} 159 local settings = {}
160 if type(settings_) ~= "table" then 160 if type(settings_) ~= "table" then
161 error "Bad parameter #1 to lanes.configure(), should be a table" 161 error "Bad argument #1 to lanes.configure(), should be a table"
162 end 162 end
163 -- any setting unknown to Lanes raises an error 163 -- any setting unknown to Lanes raises an error
164 for setting, _ in pairs(settings_) do 164 for setting, _ in pairs(settings_) do
165 if not param_checkers[setting] then 165 if not param_checkers[setting] then
166 error("Unknown parameter '" .. setting .. "' in configure options") 166 error("Unknown argument '" .. setting .. "' in configure options")
167 end 167 end
168 end 168 end
169 -- any setting not present in the provided parameters takes the default value 169 -- any setting not present in the provided parameters takes the default value
@@ -176,7 +176,7 @@ local params_checker = function(settings_)
176 param = default_params[key] 176 param = default_params[key]
177 end 177 end
178 if not checker(param) then 178 if not checker(param) then
179 error("Bad parameter " .. key .. ": " .. tostring(param), 2) 179 error("Bad argument " .. key .. ": " .. tostring(param), 2)
180 end 180 end
181 settings[key] = param 181 settings[key] = param
182 end 182 end
@@ -291,7 +291,7 @@ local opt_validators =
291-- 291--
292-- ... (more options may be introduced later) ... 292-- ... (more options may be introduced later) ...
293-- 293--
294-- Calling with a function parameter ('lane_func') ends the string/table 294-- Calling with a function argument ('lane_func') ends the string/table
295-- modifiers, and prepares a lane generator. 295-- modifiers, and prepares a lane generator.
296 296
297-- receives a sequence of strings and tables, plus a function 297-- receives a sequence of strings and tables, plus a function
@@ -306,7 +306,7 @@ local gen = function(...)
306 306
307 -- we need at least a function 307 -- we need at least a function
308 if n == 0 then 308 if n == 0 then
309 error("No parameters!", 2) 309 error("No arguments!", 2)
310 end 310 end
311 311
312 -- all arguments but the last must be nil, strings, or tables 312 -- all arguments but the last must be nil, strings, or tables
@@ -322,7 +322,7 @@ local gen = function(...)
322 elseif v == nil then 322 elseif v == nil then
323 -- skip 323 -- skip
324 else 324 else
325 error("Bad parameter " .. i .. ": " .. tv .. " " .. string_format("%q", tostring(v)), 2) 325 error("Bad argument " .. i .. ": " .. tv .. " " .. string_format("%q", tostring(v)), 2)
326 end 326 end
327 end 327 end
328 328
@@ -330,7 +330,7 @@ local gen = function(...)
330 local func = select(n, ...) 330 local func = select(n, ...)
331 local functype = type(func) 331 local functype = type(func)
332 if functype ~= "function" and functype ~= "string" then 332 if functype ~= "function" and functype ~= "string" then
333 error("Last parameter not function or string: " .. functype .. " " .. string_format("%q", tostring(func)), 2) 333 error("Last argument not function or string: " .. functype .. " " .. string_format("%q", tostring(func)), 2)
334 end 334 end
335 335
336 -- check that the caller only provides reserved library names, and those only once 336 -- check that the caller only provides reserved library names, and those only once