Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Highlighting broken in switch/case

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Klaus Posted - May 21 2010 : 2:08:48 PM
I've experienced a syntax highlighting problem in a C++ project, which I've narrowed down to the following code:

test.h:
enum Test { A, B, C };

test.cpp:
#include "test.h"
int main(int argc, char* argv[])
{
switch (A) {
case A: ;
case B:
case C:
break;
}
return 0;
}

If the enum is declared in a header file, and you have a semicolon somewhere after a case, then the previous enum value is not highlighted any more.

This wouldn't be much of a problem, but in my code this also happens with a macro directly after a case (if there is a semicolon after the macro or even part of the macro definition). I couldn't reproduce that in the example above, but I assume that if you fix this one, then the problem with the macros will also go away. :)

EDIT: Sorry, forgot some info:
Version 10.6.1823.0, Build 2010.05.06, VS 2005

Thanks...
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - May 26 2010 : 04:03:34 AM
Thank you for taking the time to deal with this.
I've added your findings to the case.
Klaus Posted - May 25 2010 : 05:25:59 AM
Hi, I've looked into the macro issue again: Macros work fine, unless there's a macro called ASSERT. Try these definitions before the switch:

#define ASSERT(n) printf(n)
#define TEST(n) ASSERT(n)
...
case A: TEST(0);

The issue occurs because of the name ASSERT. Rename it and the "A" will be highlighted. The issue also occurs if TEST(n) expands to nothing, which is equivalent to a single semicolon after the case.
accord Posted - May 24 2010 : 12:15:41 PM
I am seeing the same effect here using VA1823 and VS2005 SP1, but also wondering why wasn't you able to reproduce this with the macro. Did you tried with your original macro or a simplified one?

I have put in a bug report for this:

case=44723

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000