Vertical bar removed from syntax of vararg table

The syntax 'function foo (a, b, ...arg)' is already used by JavaScript
for this same semantics, so it seems natural to use the same notation in
Lua.
This commit is contained in:
Roberto I
2025-10-30 11:07:01 -03:00
parent 0149b781d4
commit d342328e5b
5 changed files with 20 additions and 22 deletions

View File

@@ -310,7 +310,7 @@ do -- testing presence of second argument
local function foo (howtoclose, obj, n)
local ca -- copy of 'a' visible inside its close metamethod
do
local a <close> = func2close(function (... | t)
local a <close> = func2close(function (...t)
assert(select("#", ...) == n)
assert(t.n == n and t[1] == ca and (t.n < 2 or t[2] == obj))
ca = 15 -- final value to be returned if howtoclose=="scope"
@@ -910,7 +910,7 @@ do
local extrares -- result from extra yield (if any)
local function check (body, extra, ...|t)
local function check (body, extra, ...t)
local co = coroutine.wrap(body)
if extra then
extrares = co() -- runs until first (extra) yield