[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: LPEG error location display
- From: Thomas Harning <harningt@...>
- Date: Thu, 31 Jul 2008 00:03:21 -0400
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.