http://languagejs.com/ is a JavaScript PEG library written for the
Cappuccino project that claims to have a good approach to error handling.
>From the page:

The most unique addition Language.js makes to PEG is how it handles errors.
> No parse ever fails in Language.js, instead SyntaxErrorNodes are placed
> into the resultant tree. This makes it trivial to do things like write
> syntax highlighters that have live error reporting. This also means that
> Language.js is very competent at handling multiple errors (as opposed to
> aborting on the first one that is reached).
>
> A new operator designed specifically to handle errors trivially and
> declaratively is added on top of the normal PEG operators. The naughty OR
> operator (%) behaves just like the choice operator (/), but only gets used
> if the parse first completely fails. Because of this, performance is
> guaranteed to never be affected, regardless of how many error rules you add
> to the grammar. Thus, you are allowed to offer alternative "incorrect but
> valid" grammars to provide increasingly useful errors to your users.
>
_______________________________________________
fonc mailing list
[email protected]
http://vpri.org/mailman/listinfo/fonc

Reply via email to