CL doesnt parse #if preprocessors properly

General questions regarding the usage of CodeLite
hbr_in
CodeLite Expert
Posts: 113
Joined: Fri Jul 11, 2008 9:12 am
Contact:

CL doesnt parse #if preprocessors properly

Post by hbr_in »

Hi,

i have been using CL everyday now and have fell in love with it. Thanks for the cool IDE.

Now i have few doubts & requests for the same

1. CL doesnt parse #if preprocessors properly. I mean it doesnt properly display the code under else part of #if 0

Code: Select all

#if 0
  do_a();
#else
  do_b();
#endif
Here both do_a() & do_b() are greyed out. The same when it is #if 1. Both are displayed.

Many a times a MACRO under a #if preprocessor is not considered correctly. Its a random behaviour so i cannot give u sure shot examples

#define MACRO1 1

#ifdef MACRO1
#define NEED_DATA
#else
#undef NEED_DATA
#endif

#ifdef NEED_DATA
do_code_a();
#else
do_code_b();
#endif

If i right click on NEED_DATA above & select show definitions, sometimes it says #define NEED_DATA & sometimes it says #undef NEED_DATA. But its very random.

I tried to re-tag project, file, workspace, but it still is random.

Hope u understand what i am saying

Regards
Gururraja
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: CL doesnt parse #if preprocessors properly

Post by eranif »

First, CodeLite does not parse preprocessor at all

The colour changes you see ("if 0" coloured in grey) are part of Scintilla's lexing and not by CodeLite code-completion engine.

There is a known bug with the

Code: Select all

#if 0
. Since this is not going to be officially supported by Scintilla any time soon, and the current implementation is very poor, I am going to remove this feature until it does.

Eran
Make sure you have read the HOW TO POST thread
Post Reply