Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Dangling { in disabled code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mwb1100
Ketchup Master

82 Posts

Posted - May 21 2009 :  1:43:21 PM  Show Profile  Reply with Quote
I'm running a somewhat old version of VAX - 1649, so forgive me if this has already been addressed (I didn't notice anything mentioned in the release notes).

If a section of code that's disabled due to an #if or #ifdef ends with what would be an unbalanced brace if the code were enabled, VAX's Context box gets confused and all the functions that follow get lumped in as members of the function that has the sorta unbalanced brace:


void foo()
{
#if 0
    if (true) {
        return;
    }
    else {      // this dangling { in a disabled #if section
                //  confuses VAX's Context dropdown control
#endif
    return;
}

void bar()
{
    return;
}

int main() 
{  
    foo();
    bar();

    return 0;
}


Only foo() shows up in the global scope, while bar() and main() show up only inside of foo()'s scope as foo.bar or foo.main. Also in the editor window, bar and main get colored as variables.

I know that one of VAX's features/behaviors is parsing disabled sections (partly becuase uncertainty of whether or not a section will be disabled at compile time), but I'd like to know if this is something that I can control at least to some extent (other than getting rid of the unbalanced brace). This behavior has been bugging me for the past couple of days on a particular file, and it took more troubleshooting than I would have liked to track down.

The IDE has information on whether or not #if sections will be compiled, as it displays disabled sections differently - can VAX somehow use that information? Or can we at least get it to ignore sections that are clearly disabled - like "#if 0" sections?

Edited by - mwb1100 on May 21 2009 1:56:40 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 21 2009 :  5:57:08 PM  Show Profile  Reply with Quote
VA parses all #ifdef blocks, so you can navigate and use completion listboxes even in disabled configurations. So this is by design.

But #ifdef 0 is somewhat different, since it is never compiled, but it can confuse the parser, like in your case so I've put in an enhancement request to see what the developers make of it:

case=27255
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000