usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
407 stars 77 forks source link

feat/error recovery robust field projection #2073

Open jurgenvinju opened 2 weeks ago

jurgenvinju commented 2 weeks ago

This experiment makes parse tree instances (ITree's in Java) which happen to have error productions robust again field projection (in the interpreter)

Of course further field projection on such a stub would not work anymore, because there is no more production to work with. So this gives only one layer of robustness. A future version of this could recursively keep returning empty error stubs, but I don't know how to obtain the right type for those trees from the interpreter.

The questions are:

At the very least field projection should work for fields which are before the dot. The rest is open for discussion I think.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 11.90476% with 37 lines in your changes missing coverage. Please review.

Project coverage is 49%. Comparing base (415773f) to head (e964a65). Report is 20 commits behind head on feat/error-recovery.

Files with missing lines Patch % Lines
...c/org/rascalmpl/values/parsetrees/TreeAdapter.java 0% 23 Missing :warning:
...almpl/interpreter/result/ConcreteSyntaxResult.java 0% 10 Missing :warning:
...rascalmpl/values/parsetrees/ProductionAdapter.java 55% 3 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## feat/error-recovery #2073 +/- ## ===================================================== - Coverage 49% 49% -1% + Complexity 6605 6602 -3 ===================================================== Files 685 685 Lines 61148 61187 +39 Branches 8850 8862 +12 ===================================================== + Hits 30239 30243 +4 - Misses 28706 28740 +34 - Partials 2203 2204 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jurgenvinju commented 1 week ago

This PR now also covers has, is, setLabeledField on error trees next to the getLabeledField it was originally for.