[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Porting LPeg to Lua 5.3.0-work2
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 9 Apr 2014 17:37:36 +0200
This seems to be nontrivial.
I tried to build LPeg-0.12 for use with Lua 5.3. In `makefile`,
I set LUADIR to the directory into which Lua 5.3.0-work2
was unpacked. `make` worked. After putting lpeg.so in
/usr/local/lib/lua/5.3, lua53 was willing to load it. However,
it does not seamlessly cooperate with the new numbers.
Example:
$ lua53 -l lpeg
Lua 5.3.0 (work2) Copyright (C) 1994-2014 Lua.org, PUC-Rio
> P=lpeg.P
> C=lpeg.C
> C(3):match"123"
123
> P(3):match"123"return ("%X"):format(P(3):match"123")
644261071678341124
> ("%X"):format(644261071678341124)
8F0E00800000004
On re-runs, the first 4 bytes vary. They always seem to be close
to the address of _ENV in the current run.
E.g.:
> return ("%X"):format(P(3):match"123")
87D100800000004
> _ENV
table: 0x87d13c0