Handling Errors

Return to Contents

Whenever a Lexer_Error or Parser_Error is raised it is always accompanied with a string that contains encoded information about where in the input the error occurred.

Such strings should not be examined directly, but if the Decode function from Packrat.Errors is used then an array of symbol/position pairs is obtained. Each of those pairs describes a point in the input where, if the given symbol was successfully found, a more successful parse would have resulted.

Unfortunately at this time no resumption of lexing or parsing can be done once an error has occurred.