lua-users home
lua-l archive

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


On Tue, May 19, 2015 at 9:07 PM, Александр Машин <alex.mashin@gmail.com> wrote:
> Good time of day,
>
> I am trying to  link LPeg library to a very restrictive Lua environment
> (which is luasandbox Lua engine for PHP written in C++,
> https://github.com/wikimedia/mediawiki-php-luasandbox), which, in
> particular, reloads require () function.

I'm not familiar with the MediaWiki sandbox, but did you give LuLPeg a
try? It is a pure Lua implementation.

https://github.com/pygy/lulpeg/

If the sandbox is based on Lua 5.1 and disables `newproxy()`, you'll have to use

    LuLPeg.L(LuLPeg.P(...))

rather than

    #LuLPeg.P(...)

Otherwise, it is compatible, but slower.

—Pierre-Yves