Repository navigation
[swift] Report syntax errors as processing errors - #6801
Merged
Merged
Conversation
Also update other conditions
ANTLR reports charPositionInLine with 0..n-1, while PMD uses 1-based column positions.
Note, this should not be needed, see pmd#6655
Contributor
|
Compared to main: (comment created at 2026-06-29 06:36:08+00:00 for 7a36cd1) |
UncleOwen
reviewed
Jun 27, 2026
UncleOwen
left a comment
Member
There was a problem hiding this comment.
I don't know anything about Swift. But the changes to PmdSwiftParser look good.
Do you also want to change adding_a_new_antlr_based_language.md, section 6?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
Basically a follow-up on #6764.
Swift has currently 4 rules. This doesn't look like a big user base. So I guess, it's probably fine, if we change PMD's behavior in that area. It's similar to fixing false negatives - now we report processing errors, which we previously didn't.
Note: I had to change BTree.swift, as it itself was invalid swift code (the generic where clause should be outside the generic parameter just before the function body).
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)