Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Enum parsing problem

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
franckyinuk Posted - Dec 23 2013 : 04:33:49 AM
Hi,

I am using the latest version of VA, and I am still noticing a problem with long enum list in C++.
When an enum has more than 85 entries then none get recognized and highlighted.

Could it be looked at?

Cheers,
Franck.


VA_X.dll file version 10.8.2023.0 built 2013.12.20
DevEnv.exe version 10.0.40219.1 Premium
msenv.dll version 10.0.40219.1
Comctl32.dll version 6.10.7601.17514
Windows 7 6.1 Build 7601 Service Pack 1
8 processors (x86-64, WOW64)
Language info: 1252, 0x809
5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 20 2014 : 7:39:47 PM
This makes sense, and explains why you are doing this. I have put in a bug report for this, to see what can be done about supporting longer macros:

case=79740
franckyinuk Posted - Jan 14 2014 : 09:04:27 AM
Sorry for the long delay.

The macro included in the file I sent is the correct one, although it gets replaced by a more complex macro in other files (like to create strings out of the enum names).
So in short it is necessary.

So can VA deal with it?
Because it does detect correctly that the entries are part of an enum and it fails simply because of the size of the list.
feline Posted - Jan 02 2014 : 3:40:54 PM
I have the file, thank you for this. This is not actually a problem parsing an enum, it looks like its simply down to the size, the number of characters, in a single macro.

Is there a technical reason for creating an enum via a macro? I assume you have simplified the macro you sent me, since the macro you sent me basically just replaces a comma with an = sign, which seems a little redundant.
franckyinuk Posted - Jan 02 2014 : 07:13:43 AM
Hi,

I have just sent the file you requested.
it looks like this


#define EnumEntryM(Name,Value) Name = Value


namespace VTK
{

////////////////////////////////////////////////////////////////////////////////
// //
// Example where I don't get any highlighting for the entries in the enum //
// //
////////////////////////////////////////////////////////////////////////////////

#define ResultTypesWithVeryLongNamesTypeEntriesM() \ EnumEntryM(ResultTypesWithVeryLongNames0, 0), \ EnumEntryM(ResultTypesWithVeryLongNames1, 1), \ ...
EnumEntryM(ResultTypesWithVeryLongNames135, 135), \ EnumEntryM(ResultTypesWithVeryLongNames136, 136)

enum ResultTypesWithVeryLongNamesType
{
ResultTypesWithVeryLongNamesTypeEntriesM()
};


////////////////////////////////////////////////////////////////////////////////
// //
// Example where I get the correct highlighting but only because the list is shorter, about 80 entries seems to be the threshold for this example
// also it seems related to the length of the names, as I couldn't see the problem with names like Result1 - Result136
//
// //
////////////////////////////////////////////////////////////////////////////////

#define ResultTypesWithVeryLongName1TypeEntriesM() \ EnumEntryM(ResultTypesWithVeryLongName10, 0), \ EnumEntryM(ResultTypesWithVeryLongName11, 1), \ ...
EnumEntryM(ResultTypesWithVeryLongName179, 79), \ EnumEntryM(ResultTypesWithVeryLongName180, 80)

enum ResultTypesWithVeryLongName1Type
{
ResultTypesWithVeryLongName1TypeEntriesM()
};


In this example you can see 2 lists. The first one doesn't get highlighted and the second one does.
The difference is that the first list has 137 entries while the second only has 81 entries.

I could only see the problem with long names like ResultTypesWithVeryLongNames0. A name like Result0 didn't show the issue.
Also you can see the behaviour if you shorten the first list.

Though it is possible that the threshold could be different on your machine.

To me it suggests some maximum character length as long names and long list do trigger the issue.

I hope this helps you reproducing the issue.

Cheers,
Franck.
feline Posted - Dec 23 2013 : 6:36:06 PM
Is VA active and colouring other items in the file in question?

Can you post / send me a sample enum that shows this problem?

I have tested this with VS2023, VA 2010, winXP, with the following, complete enum which has 99 items, and all of the items are coloured and understood correctly by VA:


enum testLongEnumColours
{
	longEnumItem01,
	longEnumItem02,

	// ...

	longEnumItem98,
	longEnumItem99
};



If you can send me the file or enum in question please submit via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

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