lua-users home
lua-l archive

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


I'm trying to get lpeg working.

Compiles and runs part of the supplied test.lua before silently exiting.
+
+

>OS prompt
Same whether Lua is invoked from the command line or from a Lua interpreter.
Running under C compiler debug shows s.status is returning 2

Hacking assert to print the results shows nothing useful, last item is true.

Seems to fail at about test.lua line 368
for _, s in ipairs{" 3 + 5*9 / (1+1) ", "3+4/2", "3+3-3- 9*2+3*9/1-  8"} do
  assert(m.match(G, s) == loadstring("return "..s)())
end

Commenting out the assert( line above and the test continues, then dumps
out again later.

Closest I can get the problem is m.match(G, s)
Loadstring seems to work fine.
On entry print(G) says userdata

Tracing this backwards in C debug is obviously going to be difficult,
not helped by my being uncomfortable with Lua and knowing nothing about
Lpeg. If it raised an error it might help.

Any ideas what might kick out Lua?
This is probably going to be environmental but why this library when the
others have been reliable.