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

can accept case condition: { } break; #50

Closed
dascritch opened this issue Feb 21, 2011 · 2 comments
Closed

can accept case condition: { } break; #50

dascritch opened this issue Feb 21, 2011 · 2 comments

Comments

@dascritch
Copy link

I had to write this because of very long case/break , for using folding functions of my editor (kde4 enviro):

switch (variable)
{
case condition1 :
{
[... 412 lines]
}
break;

case condition2 :
{
    [... 96 lines]
}
break;

}

this lead to :

Line ### : {
Expected to see a statement and instead saw a block.

@valueof
Copy link
Member

valueof commented Feb 21, 2011

What do { ... } accomplish in your examples? As I can see it could as well be:

switch (variable) {
case cond:
  [ 412 lines ]
[ ... ]
}

I don't see any disadvantages from using blocks here but I also don't see any advantages and I need to prioritize tickets.

@dascritch
Copy link
Author

I use kate (kde4 editor) and it helps it to see blocks.
There is also the case when I disable temporary a condition.

By example

// if (!stabe_condition)
{
[ 412 lines ]
}

This is not bogus, and you don't need to comment the brackets only for that.

danielctull pushed a commit to danielctull-forks/jshint that referenced this issue Jan 14, 2018
This issue was closed.
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