Closed PieterOlivier closed 1 month ago
Attention: Patch coverage is 88.88889%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 49%. Comparing base (
2683d8c
) to head (4d94b28
). Report is 14 commits behind head on feat/error-recovery.
Files with missing lines | Patch % | Lines |
---|---|---|
src/org/rascalmpl/parser/gtd/SGTDBF.java | 80% | 1 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Previously, error recovery was only triggered when no more active stacks where left. This PR improves on this by also triggering recovery when only recovery stacks are left.
This change increases recovery quality tremendously, but it also decreased performance significantly. To combat this, filtering of "duplicate" skip nodes has been added. Only one skip node with for a specific starting position, result type, and skip length is added. This does not impact recovery quality but it does improve performance dramatically.
The end result of these changes is improved recovery quality and improved performance.
Note that the downside is that the resulting parse forest does not include some nodes. For instance, if we have a language that allows expressions with multiple productions like
<expr> + <expr>
and<expr> - <expr>
and an error occurs before the operator, only one of these expression productions will be included as an error node in the parse tree. Note that this information can be reconstructed by combining the error nodes with the grammar so it does not really limit the future use cases.This PR also adds support for limiting the match length. This feature has only been used in experiments but might be actively used in the future so I decided to leave it in.