Skip to content

[matlab] Fix #2258: Handle literal backslashes in character vectors - #7177

Merged
adangel merged 3 commits into
pmd:mainfrom
subotac:fix/matlab-backslash-literals
Oct 29, 2026
Merged

adangel merged 3 commits into
pmd:mainfrom
subotac:fix/matlab-backslash-literals

Conversation

@subotac

@subotac subotac commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Describe the PR

Treat backslashes literally in MATLAB character vectors, preserving doubled quotes as the quote escape. Remove the unused C-style escape patterns and add a CPD token regression for regular expressions, Windows paths, trailing backslashes and adjacent strings.

Verified with ./mvnw.cmd -B -ntp -pl pmd-matlab -am clean verify.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests in the affected module and its dependencies
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added release note

@pmd-actions-helper

pmd-actions-helper Bot commented Oct 9, 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-10-23 18:19:35+00:00 for 6fd8f34)

Comment thread pmd-matlab/src/main/javacc/Matlab.jj Resolved
@subotac

subotac commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the release-note conflict with current main, preserving the reviewed lexer changes. The MATLAB module and dependency verification passes.

@adangel adangel changed the title [matlab] Handle literal backslashes in character vectors [matlab] Fix #2258: Handle literal backslashes in character vectors Oct 29, 2026
@adangel adangel added this to the 7.29.0 milestone Oct 29, 2026

@adangel adangel 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.

Thanks!

@adangel
adangel merged commit e3975e2 into pmd:main Oct 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[matlab] CPD: Parse error with backslashes in character vectors/string literals

3 participants