Skip to content

Attributes

Syntax support for Lua 5.4 attributes. And you can still use both the const and close declaration and get constant check and scoped callback working when targeting Lua versions below 5.4.

const a = 123
close _ = <close>: -> print "Out of scope."

You can do desctructuring with variables attributed as constant.

const {:a, :b, c, d} = tb
-- a = 1

You can also declare a global variable to be const.

global const Constant = 123
-- Constant = 1

YueScriptCompiler

Loading compiler…