diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-10-30 11:07:01 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-10-30 11:07:01 -0300 |
| commit | d342328e5b24c9b3c6c5b33bfcf9f8534210b8e6 (patch) | |
| tree | 033163b79dc14b69fc8d7160ae38cf3d9181533d /testes/locals.lua | |
| parent | 0149b781d438091ce086449101a916e9b4456b4e (diff) | |
| download | lua-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.lua | 4 |
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 |
