[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Modifier ? in lua pattern matching
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 26 May 2008 16:55:39 -0300
> 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)"