In rascal, when my DSL has a parse error, how can I be able to detail what likely caused the syntax/parse error, since the ParseError
exception just wraps the location of the issue in the file? Any resource will be valuable, Thanks.
That is a nice feature to have, an explainable parse error.
We are working on a branch that has error recovery. That error recovery will continue parsing even if there is an error. The resulting parse tree will be complete (it has all the characters) but also partial (some parts will not be recognized by the grammar). I don't know when this will be finished. It's a side project.
From such a recovered tree it will be doable to explain a parse error better than we do now.
Still, there is no better explanation than a counter factual observation. So typically the best explanation for a parse error is an alternative input sentence that is similar but different enough to succeed. So it's best to recommend users to experiment a bit with throwing away what's around the cursor (could be on a previous line) to see what happens.