Author Topic: V20 C Preprocessor doesn't grey out code for #if expressions  (Read 308 times)

jej45

  • Community Member
  • Posts: 32
  • Hero Points: 1
V20 C Preprocessor doesn't grey out code for #if expressions
« on: November 11, 2015, 12:55:20 pm »
Consider the following
#if 0
  int b = 0;  // this line is grayed out - as expected
#endif

#define ON 1
#define OFF 0
#define THIS OFF
#if THIS == ON
  int b = 0;  // this line isn't grayed out
#endif

#if THIS == 1
  int b = 0;  // this line isn't grayed out
#endif

#ifdef THAT
  int b = 0;  // this line isn't grayed out
#endif

#define HUEY 0
#if HUEY
  int b = 0;  // this line isn't grayed out
#endif

« Last Edit: November 11, 2015, 01:17:18 pm by jej45 »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3578
  • Hero Points: 229
Re: V20 C Preprocessor doesn't grey out code for #if expressions
« Reply #1 on: November 11, 2015, 04:21:07 pm »
Since SlickEdit's tagging for C++ does not parse header files included by the current source file, there's no pointer in doing preprocessing assignments within the current source file.

The advantage to what SlickEdit currently does is that users don't have to specify the precise include file search path for every project and it's much faster. You just have to add files to your project if you want them tagged. Users typically don't want to take the time to define their includes for their projects.

In the future, we may offer multi modes of operation.

jej45

  • Community Member
  • Posts: 32
  • Hero Points: 1
Re: V20 C Preprocessor doesn't grey out code for #if expressions
« Reply #2 on: November 11, 2015, 04:27:45 pm »
OK - but what if the definition is in the current file, not in the header?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3578
  • Hero Points: 229
Re: V20 C Preprocessor doesn't grey out code for #if expressions
« Reply #3 on: November 11, 2015, 04:29:01 pm »
Since SlickEdit's tagging for C++ does not parse header files included by the current source file, there's no pointer in doing preprocessing assignments within the current source file.