Open jemc opened 2 years ago
It should be possible to override a string constant, a boolean constant, or a numeric constant.
If the constant has some other (unsupported) type, or if the CLI arg fails to parse as the expected type, a compilation error will result, requesting the user to fix the CLI invocation with a supported kind of value defined.
We want to allow overriding a
:const
value at compile-time (without editing source code), by specifying a compile-time CLI argument for it.For example, consider the following program:
When compiled as normal, it would print the source-code-defined value (
"unknown"
):But when compiled with a compile-time constant value override defined, it would print the overridden value: