simplecpp icon indicating copy to clipboard operation
simplecpp copied to clipboard

some preprocessor directives do not handle comments properly

Open firewave opened this issue 4 months ago • 1 comments

The test is unconditionally removing all comments (addressed in #506) leading to tests which test the behavior of such not actually testing it since they did not materialize in the token list.

Affected tests: has_include_2 missingHeader4

It also affects the #line lineno preprocessor handling.

firewave avatar Aug 23 '25 12:08 firewave

/**/#/**/if/**/0/**/
#error "if"
#endif

#if 0
#error "endif"
#/**/endif

/**/#/**/define/**/DEF_1/**/
#ifndef DEF_1
#error "DEF_1"
#endif

/**/#/**/define/**/DEF_2/**/1/**/
#if !DEF_2
#error "DEF_2"
#endif

#define DEF_3
/**/#/**/if/**/!/**/defined/**/(/**/DEF_3/**/)/**/
#error "DEF_3"
#endif

/**/#/**/3/**/
/**/#/**/3/**/"test.c"/**/
/**/#/**/line/**/3/**/
/**/#/**/line/**/3/**/"test.c"/**/

/**/#/**/pragma/**/once/**/

/**/#/**/include/**/<string>/**/
/**/#/**/include/**/"simplecpp.h"/**/

firewave avatar Sep 12 '25 11:09 firewave