CMakePP / CMinx

Generates API documentation for CMake functions and macros
https://cmakepp.github.io/CMinx/
Apache License 2.0
14 stars 5 forks source link

cmakedoc.cmake_regexer purpose strings should be enums #7

Closed AutonomicPerfectionist closed 4 years ago

AutonomicPerfectionist commented 5 years ago

Using plain strings (such as "block comment end") for processing is fragile, especially if these strings are not constants. Retyping these string literals everywhere will eventually lead to mistypes and unmaintainable code. Using enums allow greater flexibility, quick and easy comparisons, and easy extension for more purposes (if needed).

ryanmrichard commented 5 years ago

Honestly I'd probably throw away all the code I wrote in favor of using an actual parser/lexer, which fixes this problem :slightly_smiling_face: