Skip to content

[swift] Report syntax errors as processing errors - #6801

Merged
adangel merged 14 commits into
pmd:mainfrom
adangel:swift/processing-errors
Jun 29, 2026
Merged

adangel merged 14 commits into
pmd:mainfrom
adangel:swift/processing-errors

Conversation

@adangel

@adangel adangel commented Jun 22, 2026

Copy link
Copy Markdown
Member

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?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added the in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception label Jun 22, 2026
@pmd-actions-helper

pmd-actions-helper Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-06-29 06:36:08+00:00 for 7a36cd1)

@adangel adangel added this to the 7.26.0 milestone Jun 23, 2026

@UncleOwen UncleOwen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@adangel
adangel merged commit 27ec69f into pmd:main Jun 29, 2026
13 checks passed
@adangel
adangel deleted the swift/processing-errors branch June 29, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:grammar About the grammar of a lexer or parser, eg, a parse/lex exception

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants