Contributor
MattG

Improving the Quality of Error Messages in PEG Parsers


Mentors
Sérgio Queiroz de Medeiros
Organization
LabLua

Parsing Expression Grammars (PEGs) are an expressive formalism for designing and implementing top-down parsers with local backtracking. An issue that users of PEG-based parsers face is poor reporting of syntax errors on the part of PEG-based parsers. Labeled failures are an extension to PEGs that aims to address this issue by annotating a PEG with labels corresponding to syntax errors, improving the quality of error messages generated by a PEG-based parser.

LPegLabel is an extension of the LPeg tool that provides an implementation of PEGs with labeled failures. Labels can be used to signal different kinds of errors and to specify which alternative in a labeled ordered choice should handle a given label.

The goal of this project is to rewrite the parsers of some Lua libraries, such as the module re from LPeg and lua-parser, by using LPegLabel. After this rewriting we should get parsers with better error messages.