lua-users home
lua-l archive

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


Choonster TheMage <choonster.2010 <at> gmail.com> writes:
>
> The first part of line 22 is calling the `re.compile` function with a
> single string argument (parentheses are optional when you call a
> function with a single string/table literal as its only argument[1]),
> which compiles a regular expression into a standard LPeg pattern. It
> then uses LPeg's overloaded `/` (division) operator to turn the
> pattern returned by `re.compile` into a function capture[2], which
> calls the function defined on lines 23-32 with the captures made by
> the pattern as arguments and uses the function's return values as the
> results of the capture. It then assigns this function capture to the
> new local variable `param`.
> 

Amazing, thanks a lot for this.
You solved the '/' which was the most troubling point. Now I can go ahead
and figure out what the rest does ;)