![]() |
||
|
Dear Mr Desgats,I have successfully managed to integrate lpeg-serialize into luasandbox and serialise and deserialise an LPEG pattern in a wikiproject. Thank you very much.
Alexander Mashin 24.05.2015 18:00, lua-l-request@lists.lua.org пишет:
Message: 5 Date: Sun, 24 May 2015 02:28:55 +0200 From: Julien Desgats <julien+lua@desgats.fr> Subject: Re: Long-term LPeg memoisation To: lua-l@lists.lua.org Message-ID: <20150524022855.55c471a7@desgats.fr> Content-Type: text/plain; charset=UTF-8 Hi, I'm just working on a library for that particular purpose ! This is basically a string.dump for LPeg patterns. https://github.com/jdesgats/lpeg-serialize This is nowhere near finished, that's why I didn't announced on this list yet. So don't expect it to be stable yet, any feedback or contribution is welcome. It is built as a completely separate module from LPeg, but you still need LPeg headers to compile it, see the Makefile for details. Compared to storing plain Lua code is simplicity (build your pattern and save it) and speed, as building and optimizing[1] large patterns can be quite long. [1] http://lua-users.org/lists/lua-l/2015-02/msg00284.html Le Sat, 23 May 2015 19:28:41 +0700, ÐлекÑандр Машин <alex.mashin@gmail.com> a écrit :Dear ALL, is it possible to save a compiled LPeg grammar or pattern to file or database and then to load it thence by means of pure Lua? Effectively it means whether I can cast userdata to string and string to userdata correctly. Alexander Mashin.