Yes, lpeg is a rock that you install with "luarocks install lpeg".

Could you apply the attached patch to orbit/model.lua to try the new
LPEG-based matcher and write back? Thanks!

--
Fabio Mascarenhas


On Mon, Jan 25, 2010 at 8:22 PM, Ryan Pusztai <rpusz...@gmail.com> wrote:
> Hi Fabio,
>
> On Mon, Jan 25, 2010 at 4:56 PM, Fabio Mascarenhas <mascaren...@acm.org>
> wrote:
>>
>> Lua's pattern matcher is too poor to make both cases work with a
>> single pattern... you can make the second case work with
>>
>> self:find_all_by_vehicle_type_and_oem{ "BMW 5 Series", "BMW" }
>>
>> A more general solution needs to retrofit orbit.model to use LPEG
>> instead of string.gsub... it is not hard, but does introduce another
>> dependency.
>>
>
> Hum... Is there a LPeg rock? If so, is this an optional add-on that could be
> made. My applications main goal is to search a database by defining search
> criteria, so it is going to be very important for users to do both. Any
> alternatives/thoughts?
> I generate these queries from user input so I am not sure how to make the
> 'self:find_all_by_vehicle_type_and_oem()' to be programmaticly generated? I
> hope that is not a stupid question, but that is an option if I can figure
> out how to do it.
> Thanks.
> --
> Regards,
> Ryan
>
> _______________________________________________
> Kepler-Project mailing list
> Kepler-Project@lists.luaforge.net
> http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
> http://www.keplerproject.org/
>

Attachment: lpeg_condition.diff
Description: Binary data

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to