diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-13 11:43:10 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-13 11:43:10 -0300 |
| commit | 3b9dd52be02fd43c598f4adb6fa7844e6a573923 (patch) | |
| tree | 8f858942f5db0e3d9d7cad503b59ee1541a60aa6 /testes/nextvar.lua | |
| parent | 7dc6aae29057c9dc4588f780c7abd72a62ff4c8e (diff) | |
| download | lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.gz lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.bz2 lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.zip | |
Collective declaration for globals ('global *')
Diffstat (limited to 'testes/nextvar.lua')
| -rw-r--r-- | testes/nextvar.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/testes/nextvar.lua b/testes/nextvar.lua index 679cb1e4..e5a97178 100644 --- a/testes/nextvar.lua +++ b/testes/nextvar.lua | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | -- $Id: testes/nextvar.lua $ | 1 | -- $Id: testes/nextvar.lua $ |
| 2 | -- See Copyright Notice in file lua.h | 2 | -- See Copyright Notice in file lua.h |
| 3 | 3 | ||
| 4 | global * <const> | ||
| 5 | |||
| 4 | print('testing tables, next, and for') | 6 | print('testing tables, next, and for') |
| 5 | 7 | ||
| 6 | local function checkerror (msg, f, ...) | 8 | local function checkerror (msg, f, ...) |
| @@ -345,9 +347,6 @@ end | |||
| 345 | 347 | ||
| 346 | local nofind = {} | 348 | local nofind = {} |
| 347 | 349 | ||
| 348 | a,b,c = 1,2,3 | ||
| 349 | a,b,c = nil | ||
| 350 | |||
| 351 | 350 | ||
| 352 | -- next uses always the same iteration function | 351 | -- next uses always the same iteration function |
| 353 | assert(next{} == next{}) | 352 | assert(next{} == next{}) |
| @@ -396,7 +395,7 @@ for i=0,10000 do | |||
| 396 | end | 395 | end |
| 397 | end | 396 | end |
| 398 | 397 | ||
| 399 | n = {n=0} | 398 | local n = {n=0} |
| 400 | for i,v in pairs(a) do | 399 | for i,v in pairs(a) do |
| 401 | n.n = n.n+1 | 400 | n.n = n.n+1 |
| 402 | assert(i and v and a[i] == v) | 401 | assert(i and v and a[i] == v) |
