-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map trailing commas as
TrailingComma
Marker
, to fix J.Erroneous
…
… issues seen (#4869) * Do not allow J.Erroneous LST nodes by default in tests * Allow erroneous nodes in FindCompileErrorsTest * Use `TrailingComma` marker for enum values and array initializers Add an overload for `ReloadableJava17ParserVisitor#convert()` which allows supplying a `Markers` function, so that we can capture trailing commas using a `TrailingComma` marker and then also avoid the issue with the `J.Erroneous` getting constructed. * Update whitespace handling for last enum constant The last enum constant should only be right-padded if it has a trailing comma or semicolon. This is important because the whitespace after it belongs to the prefix of the next statement or the `J.Block#end`. * Allow errorneous nodes in specific tests * Update JavaDoc for typeValidation.erroneous after feedback * Use overloaded method * Apply to Java 21 parser as well * Format Java 21 parser * Apply to Java 11 parser as well * Apply to Java 8 parser as well * Fix failing tests * Minimize diff between versions to make it easier to compare --------- Co-authored-by: Knut Wannheden <[email protected]> Co-authored-by: Laurens Westerlaken <[email protected]>
- Loading branch information
1 parent
d11eae9
commit 82b61de
Showing
14 changed files
with
363 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.