lua-users home
lua-l archive

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


> DATETIME
> VARCHAR(10)
> FLOAT(10,2)

Why do you need to parse those expressions with patterns?
Why not execute them, given that they are valid Lua code?
Try this:

setmetatable(_G,{ __index= function(t,v)
		return function (...) print(v,...) end
	end })

function try(s)
	assert(loadstring(s))()
end

try"DATETIME()"		-- had to add () here...
try"VARCHAR(10)"
try"FLOAT(10,2)"