Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type for valid CMake variable name #118

Open
AutonomicPerfectionist opened this issue Sep 12, 2023 · 2 comments
Open

Type for valid CMake variable name #118

AutonomicPerfectionist opened this issue Sep 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@AutonomicPerfectionist
Copy link
Contributor

AutonomicPerfectionist commented Sep 12, 2023

Is your feature request related to a problem? Please describe.
Right now, when we want to say "this parameter must be a string denoting a valid CMake variable name," we use the desc type. However, desc is allowed to contain spaces and other special characters that are not valid in CMake variable names. This results in signatures not being specific enough and can lead to very hard-to-debug errors

Describe the solution you'd like
It would be nice to introduce a new built-in type, say we call it identifier, that is descended from desc but adds additional restrictions such that every identifier is guaranteed to be a valid CMake identifier. Pointers can then descend from identifier instead of desc. fxn may also descend from identifier since command names also follow the same restrictions.

@AutonomicPerfectionist AutonomicPerfectionist added the enhancement New feature or request label Sep 12, 2023
@ryanmrichard
Copy link
Contributor

I think adding identifier is okay, though I don't think it alone will fully solve the CMakeTest issue that inspired it. In particular, I think users of CMakeTest should be allowed to name tests with names like "This is my test".

@AutonomicPerfectionist
Copy link
Contributor Author

There's a separate issue CMakePP/CMakeTest#90 to figure out what to do with that, I just realized we had no true identifier type while thinking about that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants