Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: carra on July 11, 2012, 09:30:48 am

Title: Lexer bug in macros
Post by: carra on July 11, 2012, 09:30:48 am
I saw this lexer problem quite a bit ago, but I had forgotten to post it until now. As you may know, preprocessor macros admit embedded comments, very useful to clarify big multiline macros. Let's take this simple iterator macro as an example:

Code
#define ITER_C_STR( chars )  for( /* empty */; *(chars); (chars)++ )

If you view this macro in C::B editor, it will highlight it as a macro only up to the comment, and all the rest is colored as if it was normal code and not part of the macro. It seems to be only a lexer issue, since it will compile OK and the macro is even added to autocompletion list correctly.
Title: Re: Lexer bug in macros
Post by: oBFusCATed on July 11, 2012, 09:53:35 am
Confirmed on Linux + r8043...
Title: Re: Lexer bug in macros
Post by: MortenMacFly on July 11, 2012, 10:11:19 am
It seems to be only a lexer issue, since it will compile OK and the macro is even added to autocompletion list correctly.
Please try in SciTE (http://www.scintilla.org/SciTE.html) and if its the same there, file a bug report to the scintilla guys.
Title: Re: Lexer bug in macros
Post by: carra on July 11, 2012, 10:44:54 am
I tried with SciTE 3.20 and the bug is still there. There is a bug listed in scintilla about this (ID: 3487406). BUT, as you see here: http://sourceforge.net/tracker/index.php?func=detail&aid=3487406&group_id=2439&atid=102439

... they report it as already fixed ??
Well, it clearly isn't.
Title: Re: Lexer bug in macros
Post by: stahta01 on July 11, 2012, 11:10:16 am
I tried with SciTE 3.20 and the bug is still there. There is a bug listed in scintilla about this (ID: 3487406). BUT, as you see here: http://sourceforge.net/tracker/index.php?func=detail&aid=3487406&group_id=2439&atid=102439

... they report it as already fixed ??
Well, it clearly isn't.

The fix was committed on Date: 2012-06-25 00:25:59 PDT.

Likely you tested code written before that.

Tim S.
Title: Re: Lexer bug in macros
Post by: MortenMacFly on July 11, 2012, 11:44:09 am
... they report it as already fixed ??
It is, and if you compile C::B yourself, it will be there, too. Note what stahta01 said:
The fix was committed on Date: 2012-06-25 00:25:59 PDT.
Likely you tested code written before that.
SciTE 3.2.0 was released before that date. so most likely next SciTE will have this fixed, too (just as the next C::B nightly).
Title: Re: Lexer bug in macros
Post by: carra on July 11, 2012, 12:00:04 pm
SciTE 3.2.0 was released before that date. so most likely next SciTE will have this fixed, too (just as the next C::B nightly).
I see, so that was it. Well, in this case I have nothing left to complain here! :) I'll check this in next nightly (since I don't compile C::B)