CMakePP / CMakePPLang

Object-oriented extension to the CMake language.
http://cmakepp.github.io/CMakePPLang/
Apache License 2.0
11 stars 4 forks source link

Type for valid CMake variable name #118

Open AutonomicPerfectionist opened 11 months ago

AutonomicPerfectionist commented 11 months ago

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.

ryanmrichard commented 11 months ago

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 commented 11 months ago

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