RFR: Use regex match when looking for unnamed struct/union/enum in doc comment

Jorn Vernee jvernee at openjdk.org
Mon Jan 22 12:50:17 UTC 2024


Noticed this small issue when running the samples. We try to look for an anonymous struct in the doc comments we generate. Clang will put the file path of the file containing the struct in the declaration string, which causes all kinds of problems, so we filter it out. A regular expression is used for this, however, it is passed to `String::contains`, which doesn't accept a regex. Switch to `String::matches` so it works.

- I've added a new test case to TestDocComments
- I've also renamed the enclosing folder of this test, since it still had the bug id as a name (while the test itself doesn't)
- I also noticed an issue in the TestGlobalStructAccess test. We access a global variable with a struct type, but this variable is not marked as exported, so the test fails on Windows.

-------------

Commit messages:
 - contains -> matches

Changes: https://git.openjdk.org/jextract/pull/190/files
 Webrev: https://webrevs.openjdk.org/?repo=jextract&pr=190&range=00
  Stats: 31 lines in 11 files changed: 27 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jextract/pull/190.diff
  Fetch: git fetch https://git.openjdk.org/jextract.git pull/190/head:pull/190

PR: https://git.openjdk.org/jextract/pull/190


More information about the jextract-dev mailing list