Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hints fore case and if ... else ... #3

Closed
mumpitzstuff opened this issue Jan 9, 2012 · 5 comments
Closed

Hints fore case and if ... else ... #3

mumpitzstuff opened this issue Jan 9, 2012 · 5 comments
Assignees
Milestone

Comments

@mumpitzstuff
Copy link

It would be nice to have the hint feature for cases (switch) and for if ... else ... constructs in C.

@chookapp
Copy link
Owner

chookapp commented Jan 9, 2012

Could you, please, give an example of where you would expect the "hint" to be for "case" statements? I thought of this a while ago and didn't come up with a good place to put it.

Also, Bracketeer already has a hint for "if" and "else" in C. So I'm not sure I understand...

@mumpitzstuff
Copy link
Author

It seems that statements like

if (...)
{
...
}
else
{
...
}

are not recognized by your hint algorithm. It may be a bug?

Our case statements have always this format:

switch (...)
{
case 1:
{
...
}
default:
{
...
}
}

But i agree there are many possibilities to write C code. Another format could be:

switch (...)
{
case 1:
... <no break no hint (such constructs are to dangerous to use in my opinion)>
case 2:
...
break;
default:
...
break;
}

@mumpitzstuff
Copy link
Author

Hmm sry some parts of my comment are removed.

case 1:
{

}

This should be easy to add to your hint algorithm.

For the last example use the breaks to add the hint. The case without break is a really dangerous thing in my opinion and should not be used. Therefore it is a rare case and it is not needed to add a hint here.

@chookapp
Copy link
Owner

Nice idea, I will consider it for the next Bracketeer version

@ghost ghost assigned chookapp Jan 11, 2012
@chookapp
Copy link
Owner

chookapp commented Mar 3, 2012

Done

@chookapp chookapp closed this as completed Mar 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants