aboutsummaryrefslogtreecommitdiff
path: root/testes/locals.lua
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-10-30 11:07:01 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-10-30 11:07:01 -0300
commitd342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 (patch)
tree033163b79dc14b69fc8d7160ae38cf3d9181533d /testes/locals.lua
parent0149b781d438091ce086449101a916e9b4456b4e (diff)
downloadlua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.tar.gz
lua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.tar.bz2
lua-d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6.zip
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.
Diffstat (limited to 'testes/locals.lua')
-rw-r--r--testes/locals.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/testes/locals.lua b/testes/locals.lua
index 5222802f..6cd10547 100644
--- a/testes/locals.lua
+++ b/testes/locals.lua
@@ -310,7 +310,7 @@ do -- testing presence of second argument
310 local function foo (howtoclose, obj, n) 310 local function foo (howtoclose, obj, n)
311 local ca -- copy of 'a' visible inside its close metamethod 311 local ca -- copy of 'a' visible inside its close metamethod
312 do 312 do
313 local a <close> = func2close(function (... | t) 313 local a <close> = func2close(function (...t)
314 assert(select("#", ...) == n) 314 assert(select("#", ...) == n)
315 assert(t.n == n and t[1] == ca and (t.n < 2 or t[2] == obj)) 315 assert(t.n == n and t[1] == ca and (t.n < 2 or t[2] == obj))
316 ca = 15 -- final value to be returned if howtoclose=="scope" 316 ca = 15 -- final value to be returned if howtoclose=="scope"
@@ -910,7 +910,7 @@ do
910 910
911 local extrares -- result from extra yield (if any) 911 local extrares -- result from extra yield (if any)
912 912
913 local function check (body, extra, ...|t) 913 local function check (body, extra, ...t)
914 local co = coroutine.wrap(body) 914 local co = coroutine.wrap(body)
915 if extra then 915 if extra then
916 extrares = co() -- runs until first (extra) yield 916 extrares = co() -- runs until first (extra) yield