ProSurfer73 / Macro-Parser

A C/C++ macro calculator
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Better && and || interpretation #14

Closed ProSurfer73 closed 2 years ago

ProSurfer73 commented 2 years ago

In the current situation, operators && and || needs to have the value true/false at the right side and the left side in order to be evaluated.

Only these expression are evaluated for : true || true ; true || false ; false || true ; false || false true && true ; true && false ; false && true ; false && false

However we would like the evaluation to work this way : true || UNKNOWN_BOOLEAN_VALUE => true UNKNOWN_BOOLEAN_VALUE || true => true false || UNKNOWN_BOOLEAN_VALUE => UNKNOWN_BOOLEAN_VALUE UNKNOWN_BOOLEAN_VALUE || false => UNKNOWN_BOOLEAN_VALUE true && UNKNOWN_BOOLEAN_VALUE => UNKNOWN_BOOLEAN_VALUE UNKNOWN_BOOLEAN_VALUE && true => UNKNOWN_BOOLEAN_VALUE false && UNKNOWN_BOOLEAN_VALUE => false UNKNOWN_BOOLEAN_VALUE && false => false

This will lead to a larger number of conditional expression being evaluated, and this will improve macro interpretation when importing header files.