diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-18 11:43:43 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-18 11:43:43 -0300 |
| commit | abbae57c7844b1121e7251d56f681394f20c1821 (patch) | |
| tree | 823201f4d2631fcae027117681553de80b2c96f0 /testes/math.lua | |
| parent | f2c1531e6cacb10926158d8def5fa5841a0f357e (diff) | |
| download | lua-abbae57c7844b1121e7251d56f681394f20c1821.tar.gz lua-abbae57c7844b1121e7251d56f681394f20c1821.tar.bz2 lua-abbae57c7844b1121e7251d56f681394f20c1821.zip | |
Variable attributes can prefix name list
In this format, the attribute applies to all names in the list;
e.g. "global<const> print, require, math".
Diffstat (limited to '')
| -rw-r--r-- | testes/math.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/testes/math.lua b/testes/math.lua index 242579b1..0d228d09 100644 --- a/testes/math.lua +++ b/testes/math.lua | |||
| @@ -8,11 +8,10 @@ local string = require "string" | |||
| 8 | 8 | ||
| 9 | global none | 9 | global none |
| 10 | 10 | ||
| 11 | global print, assert, pcall, type, pairs, load | 11 | global<const> print, assert, pcall, type, pairs, load |
| 12 | global tonumber, tostring, select | 12 | global<const> tonumber, tostring, select |
| 13 | 13 | ||
| 14 | local minint <const> = math.mininteger | 14 | local<const> minint, maxint = math.mininteger, math.maxinteger |
| 15 | local maxint <const> = math.maxinteger | ||
| 16 | 15 | ||
| 17 | local intbits <const> = math.floor(math.log(maxint, 2) + 0.5) + 1 | 16 | local intbits <const> = math.floor(math.log(maxint, 2) + 0.5) + 1 |
| 18 | assert((1 << intbits) == 0) | 17 | assert((1 << intbits) == 0) |
