Hi,
I'm using PEG.js for building an editor whose requirements are among others, validation and auto-completion.
As suggested by otac0n (
here), I managed validation by catching parser errors and building an AST which contains errors as nodes - this way not just the first error is produced.
At this point, auto-completion works by turning off the parser's error handling, with the limitation that the parser is not able to provide suggestions for code which is after a parse error.
Is there a workaround to this problem I'm missing?
My first thought was to try to provide error nodes with parse-able code which will be replaced with the error code via a 2nd parsing pass - but this has its issues...
If anyone managed this somehow or has any ideas, it would be much appreciated.
Thanks a lot,
Roded