lua-users home
lua-l archive

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


I'm working on enhancing my LuaJSON library that uses LPEG for decoding such that it can output the location of invalid JSON data.

I tried throwing in the (-1 * lpeg.P(er)) at the end of the expression and that only seems to work when there's extraneous characters at the end of the valid data... If I insert invalid characters inside the data, it fails without calling the error function.

This seems to make sense, but I can't quite wrap my head around how to detect&display errors in a sane way.