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".
This commit is contained in:
Roberto Ierusalimschy
2025-05-18 11:43:43 -03:00
parent f2c1531e6c
commit abbae57c78
15 changed files with 84 additions and 60 deletions

View File

@@ -8,11 +8,10 @@ local string = require "string"
global none
global print, assert, pcall, type, pairs, load
global tonumber, tostring, select
global<const> print, assert, pcall, type, pairs, load
global<const> tonumber, tostring, select
local minint <const> = math.mininteger
local maxint <const> = math.maxinteger
local<const> minint, maxint = math.mininteger, math.maxinteger
local intbits <const> = math.floor(math.log(maxint, 2) + 0.5) + 1
assert((1 << intbits) == 0)