schemagen: add C++20 keywords to the C++ keyword allow-list #22

Merged
andrew merged 1 commits from weaselbot/weaseljson:weaselbot/issue-18 into main 2026-06-22 00:54:26 +00:00
Member

Add concept, consteval, constinit, co_await, co_return, co_yield, requires, module, and import to the _CPP_KEYWORDS allow-list in contrib/schemagen/weaseljson_schemagen.py.

Property names that collide with these C++20 keywords are now sanitized with a trailing underscore (concept_), so the generated structs compile under C++20.

A regression test is added to verify all listed keywords are suffixed.

Closes #18

Add `concept`, `consteval`, `constinit`, `co_await`, `co_return`, `co_yield`, `requires`, `module`, and `import` to the `_CPP_KEYWORDS` allow-list in `contrib/schemagen/weaseljson_schemagen.py`. Property names that collide with these C++20 keywords are now sanitized with a trailing underscore (`concept_`), so the generated structs compile under C++20. A regression test is added to verify all listed keywords are suffixed. Closes #18
weaselbot added 1 commit 2026-06-21 16:52:16 +00:00
schemagen: add C++20 keywords to the C++ keyword allow-list
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64, true) (pull_request) Successful in 54s
CI / pre-commit (pull_request) Successful in 1m5s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64, false) (pull_request) Successful in 54s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64, true) (pull_request) Successful in 1m54s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64, false) (pull_request) Successful in 1m33s
9cd74631b6
Add concept, consteval, constinit, co_await, co_return, co_yield,
requires, module, and import to _CPP_KEYWORDS so property names that
happen to be C++20 keywords get sanitized with a trailing underscore.

Closes #18
andrew merged commit 5e18347e35 into main 2026-06-22 00:54:26 +00:00
andrew deleted branch weaselbot/issue-18 2026-06-22 00:54:30 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weaselab/weaseljson#22