Parsing Expression Grammars For Lua with Labeled Failures
$ luarocks install lpeglabel
LPegLabel is a conservative extension of the
library that provides an implementation of Parsing
Expression Grammars (PEGs) with labeled failures.
Labels can be used to signal different kinds of errors
and to specify which recovery pattern should handle a
given label. Labels can also be combined with the standard
patterns of LPeg.
Besides that, LPegLabel also reports the farthest
failure position in case of an ordinary failure
(which is represented by label 'fail').