Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Underline if();

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
mmb Posted - Jul 05 2006 : 07:45:47 AM
Some of the supiest error one ahve to find in a C-like language is a forgotten ';' after an 'if' like this

if (bla);
...

I would bet such a code is in 99,9 percent of all cases simply wrong
but sometimes really hard to find.
Simply underline such constructs (maybe add an option to switch this on).
When adding an option you could also add an option to underline
while(); and for(); although these construct do happen but sometimes
are as bad as the if...

6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 08 2006 : 2:00:00 PM
by static code analysis i was thinking more along the lines of LINT, which is where people will want us to end up if we are not careful

http://www.gimpel.com/

as for the students, something tells me that if they ignore compiler warnings they will also ignore more colouring on the screen *rolls eyes*
Admin Posted - Jul 06 2006 : 7:46:57 PM
You present some interesting ideas but we're far from implementing them at this point. Our lists of things to do are quite long.

mmb Posted - Jul 06 2006 : 6:03:59 PM
feline: It's true that VC2005 produces the right warning C4390. The VC6 compiler is silent here. We use both IDE's (VC6 used less resources in a virtual machine).
Sorryly I'm sometimes called by students that typically ignore all warnings to "look, I do it all right but it did not work". So, this feature would save me some walking

An the other hand, how would you call "enhanced coloring" if not static analysis?

feline Posted - Jul 06 2006 : 5:37:24 PM
mmb which IDE are you using? i know that VS2005 can produce some fairly reasonable warnings / errors when i make a typo.

some of the time you can tell you have made a typo because local variables or function calls are not coloured correctly.

it would be reasonable to think VA could detect this, i am just concerned about entering the world of static code analysis, since that is a whole new product.
mmb Posted - Jul 05 2006 : 2:56:45 PM
I'm sorry to say that it is not possible to detect this kind of errors using regular expressions. Context free grammars would be needed to detect all possible if's. But this is not the point:

This kind of errors are often difficult to detect but depending on the parse tree that is generated by VA easily to underline.
bugfix Posted - Jul 05 2006 : 09:34:45 AM
In vs.net you can search w/ regular expressions for such kind of stuff.
Out of my mind it should look smth like
(if|for|while)[\\t ]*\\(.*\\)[\\t ]*;

Another common typo is if(bla = blub) instead of if(bla == blub)

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