raydac/java-comment-preprocessor

JCP fails on unknown value

reisi007 opened this issue · 3 comments

Hi,

I am using JCP for a product line. If a feature is included (e.g. for the feature belt) //#define belt is added.
Currently //#if belt && dev fails, if belt or dev is unknown. Note that this is possible to rewrite as 2 //#ifdef after each other, which is not possible with //#if belt || dev. It would be great to have a way to treat all undefined variables as false in the #if...

Thanks!

ok, I will add special flag to recognize unknown variables as FALSE

added /U CLI option and unknownVarAsFalse boolean option into Maven and ANT to enable interpretation of unknown variables as FALSE, information about detection of such variables will be printed if caller in debug mode, now you can try

Thanks! Works as expected 😀