lua-users home
lua-l archive

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


> You can do that without changing the parser.
> All you need to do is to use the upvalues in the
> desired order at the start of the function before
> referring to anything else.

Indeed. And it seems a perfect job for ltokenp which I've just announced!

Just replace
	function X (...) <U>
by
	function X (...) local _UPVALUES=U
taking care to handle empty or missing <U>.

A simple state machine can do it.