News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Lexer bug in macros

Started by carra, July 11, 2012, 09:30:48 AM

Previous topic - Next topic

carra

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:


#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.

oBFusCATed

Confirmed on Linux + r8043...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: carra on July 11, 2012, 09:30:48 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

carra

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.

stahta01

Quote from: 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.

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

Likely you tested code written before that.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

MortenMacFly

Quote from: carra on July 11, 2012, 10:44:54 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:
Quote from: stahta01 on July 11, 2012, 11:10:16 AM
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).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

carra

Quote from: MortenMacFly on July 11, 2012, 11:44:09 AM
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)