lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > Is there an easy way to restrict the behaviour of the configuration code? 
> 
> You can write reader function that starts by sending "return {" and ends
> by sending "}" and that appends "," after each input line. In this way,
> only assignments and inner table constructors are valid in the input. Of
> course, you still need to limit exported functions.
	But this way you would still accept (weird) things like:

(function () _G.mynewfunction = function () ... end end)()

	Which will be translated to:

return {
(function () _G.mynewfunction = function () ... end end)() ,
}

	And will create a new function in a global variable.

	Regards,
		Tomás